Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | _player.ActorInfo.ResetHp((int)vNetData.Value); |
| | | break; |
| | | case PlayerDataRefresh.MaxHP: |
| | | _player.ActorInfo.SyncServerHpEx = vNetData.Value; |
| | | _player.ActorInfo.ResetHp(-1, -1, (int)vNetData.Value); |
| | | break; |
| | | case PlayerDataRefresh.Family: |
| | |
| | |
|
| | | public sealed override void RefreshLifeBar(ulong value)
|
| | | {
|
| | | // Debug.LogFormat("{0} 血量改变: {1}", ServerInstID, value);
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero != null && _hero.SelectTarget == this)
|
| | | {
|
| | |
| | | set |
| | | { |
| | | _syncHpex = value; |
| | | //if (sid != PlayerDatas.Instance.PlayerId) |
| | | //{ |
| | | // Debug.LogFormat("<color=green>============ 设置 {1} 血量Ex: {0}</color>", _syncHpex, sid); |
| | | //} |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // Debug.LogFormat("<color=green>============ 设置 {1} 血量Ex: {0}</color>", _syncHpex, sid); |
| | | // } |
| | | } |
| | | }// 服务端血量Ex的校准值 |
| | | |
| | |
| | | MaxHpEx = (ushort)valMaxEx; |
| | | } |
| | | |
| | | //if (sid != PlayerDatas.Instance.PlayerId) |
| | | //{ |
| | | // Debug.LogFormat("<color=yellow>设置NPC {0}, 当前hp: {1}, hpEx: {2}</color>", sid, Hp, HpEx); |
| | | //} |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // Debug.LogFormat("<color=yellow>设置血量 {0}, 当前hp: {1}, hpEx: {2}</color>", sid, Hp, HpEx); |
| | | // } |
| | | |
| | | if (OnHpChange != null) |
| | | { |
| | |
| | | |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // Debug.LogFormat("<color=red>伤血量: {0}, 当前hp: {1}, hpEx: {2}</color>", value, Hp, HpEx); |
| | | // Debug.LogFormat("<color=red> 伤血量: {0}, 当前hp: {1}, hpEx: {2}</color>", value, Hp, HpEx); |
| | | // } |
| | | |
| | | if (_multiple > HpEx) |
| | |
| | | Hp -= value; |
| | | } |
| | | |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // if (HpEx > 0) |
| | | // { |
| | | // Debug.Log("Error"); |
| | | // } |
| | | // } |
| | | |
| | | if (HpEx * FullHp + Hp < SyncServerHpEx * FullHp + SyncServerHp) |
| | | { |
| | | Hp = SyncServerHp; |
| | |
| | | private GameObject m_ClothesModel;
|
| | | private GameObject m_WeaponModel;
|
| | | private GameObject m_SecondaryModel;
|
| | | private GameObject m_HandModel;
|
| | | private GameObject m_WingModel;
|
| | | private GameObject m_HorseModel;
|
| | | private GA_Guard m_Guard;
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | [DisallowMultipleComponent]
|
| | | [RequireComponent(typeof(RectTransform))]
|
| | | [ExecuteInEditMode]
|
| | | public class ChatBubbleBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Text m_Target;
|
| | | [SerializeField] RectOffset m_Padding;
|
| | | [SerializeField] bool left = false;
|
| | |
|
| | | RectTransform m_Rect;
|
| | | RectTransform rect
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_Rect == null)
|
| | | {
|
| | | m_Rect = transform as RectTransform;
|
| | | }
|
| | | return m_Rect;
|
| | | }
|
| | | }
|
| | |
|
| | | public RectOffset padding
|
| | | {
|
| | | get { return m_Padding; }
|
| | | }
|
| | |
|
| | | private bool preferredWidth = false;
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | Refresh();
|
| | | }
|
| | |
|
| | | public void DisplayContent(string content, bool _left = false)
|
| | | {
|
| | | if (m_Target == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | left = _left;
|
| | | preferredWidth = true;
|
| | | var targetRect = m_Target.rectTransform;
|
| | | var richText = m_Target as RichText;
|
| | | if (richText != null && !left)
|
| | | {
|
| | | richText.AutoNewLine = false;
|
| | | }
|
| | | m_Target.text = content;
|
| | | if (!left)
|
| | | {
|
| | | if (m_Target.preferredWidth > targetRect.rect.width)
|
| | | {
|
| | | m_Target.alignment = TextAnchor.UpperLeft;
|
| | | preferredWidth = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Target.alignment = TextAnchor.UpperRight;
|
| | | }
|
| | | }
|
| | | if (richText != null)
|
| | | {
|
| | | richText.AutoNewLine = true;
|
| | | }
|
| | |
|
| | | Refresh();
|
| | | }
|
| | |
|
| | | [ExecuteInEditMode]
|
| | | private void LateUpdate()
|
| | | {
|
| | | Refresh();
|
| | | }
|
| | |
|
| | | void Refresh()
|
| | | {
|
| | | if (m_Target == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var targetRect = m_Target.rectTransform;
|
| | | var sizeDelta = targetRect.sizeDelta;
|
| | | var width = preferredWidth || !Application.isPlaying ? m_Target.preferredWidth : sizeDelta.x;
|
| | | sizeDelta.x = width + m_Padding.left + m_Padding.right;
|
| | | sizeDelta.y = sizeDelta.y + m_Padding.top + m_Padding.bottom;
|
| | | if (sizeDelta != rect.sizeDelta)
|
| | | {
|
| | | rect.sizeDelta = sizeDelta;
|
| | | }
|
| | |
|
| | | if (!left)
|
| | | {
|
| | | if (targetRect.anchorMin != Vector2.one)
|
| | | {
|
| | | targetRect.anchorMin = Vector2.one;
|
| | | }
|
| | | if (targetRect.anchorMax != Vector2.one)
|
| | | {
|
| | | targetRect.anchorMax = Vector2.one;
|
| | | }
|
| | | if (targetRect.pivot != Vector2.one)
|
| | | {
|
| | | targetRect.pivot = Vector2.one;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (targetRect.anchorMin != Vector2.up)
|
| | | {
|
| | | targetRect.anchorMin = Vector2.up;
|
| | | }
|
| | | if (targetRect.anchorMax != Vector2.up)
|
| | | {
|
| | | targetRect.anchorMax = Vector2.up;
|
| | | }
|
| | | if (targetRect.pivot != Vector2.up)
|
| | | {
|
| | | targetRect.pivot = Vector2.up;
|
| | | }
|
| | | }
|
| | |
|
| | | var position = targetRect.anchoredPosition;
|
| | | position.x = left ? padding.left : -padding.right;
|
| | | position.y = -padding.top;
|
| | | if (targetRect.anchoredPosition != position)
|
| | | {
|
| | | targetRect.anchoredPosition = position;
|
| | | }
|
| | | }
|
| | |
|
| | | public float GetBubbleHeight(string content, ArrayList list)
|
| | | {
|
| | | if (m_Target is RichText)
|
| | | {
|
| | | (m_Target as RichText).SetExtenalData(list);
|
| | | }
|
| | | m_Target.text = content;
|
| | | return m_Target.preferredHeight + padding.top + padding.bottom;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3c276a7c4ec66ff4aa7e131b74286d9a |
| | | timeCreated: 1541123752 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Text.RegularExpressions;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | using EnhancedUI.EnhancedScroller;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class ChatContentBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] ScrollerController m_ChatContentControl;
|
| | | [SerializeField] RichText m_DestText;
|
| | | [SerializeField] RichText m_DestSysText;
|
| | | [SerializeField] RichText m_DestTipText;
|
| | | [SerializeField] RectTransform m_ContaienrNewInfo;
|
| | |
| | | [SerializeField] Image m_LockAreaCheck;
|
| | | [SerializeField, Header("显示区域大小")] float m_ContentDisplaySize = 630;
|
| | | [SerializeField, Header("锁定当前区域比例"), Range(0, 1)] float m_Percent = 0.3f;
|
| | |
|
| | | [SerializeField] ChatPlayerMineCell m_ChatMineCell;
|
| | | [SerializeField] ChatPlayerOtherCell m_ChatOtherCell;
|
| | | [SerializeField] ChatMineVoiceCell m_ChatMineVoiceCell;
|
| | | [SerializeField] ChatOtherVoiceCell m_ChatOtherVoiceCell;
|
| | |
|
| | | private ChatInfoType m_ChatType = ChatInfoType.System;
|
| | | public ChatInfoType chatType
|
| | | {
|
| | |
| | | m_LockAreaBtn.onClick.AddListener(OnLockAreaBtn);
|
| | | m_ChatContentControl.mScrollRect.onValueChanged.AddListener(OnScrollValChange);
|
| | |
|
| | | if (m_DestText.font == null)
|
| | | {
|
| | | m_DestText.font = FontUtility.preferred;
|
| | | }
|
| | | if (m_DestSysText.font == null)
|
| | | {
|
| | | m_DestSysText.font = FontUtility.preferred;
|
| | |
| | | switch (_type)
|
| | | {
|
| | | case ScrollerDataType.Header:
|
| | | _height = m_ChatMineCell.GetHeight(chat.content, chat.infoList);
|
| | | return true;
|
| | | case ScrollerDataType.Normal:
|
| | | _height = 90;
|
| | | break;
|
| | | _height = m_ChatOtherCell.GetHeight(chat.content, chat.infoList);
|
| | | return true;
|
| | | case ScrollerDataType.Extra1:
|
| | | case ScrollerDataType.Tail:
|
| | | _height = 30;
|
| | | break;
|
| | | case ScrollerDataType.Extra2:
|
| | | _height = m_ChatMineVoiceCell.GetHeight(chat.content, chat.infoList);
|
| | | return true;
|
| | | case ScrollerDataType.Extra3:
|
| | | _height = chat.content.Equals(string.Empty) ? 80 : 110;
|
| | | break;
|
| | | _height = m_ChatOtherVoiceCell.GetHeight(chat.content, chat.infoList);
|
| | | return true;
|
| | | }
|
| | | OnGetChatDynamicHeight(chat.content, ref _height, _type, chat.infoList);
|
| | | return true;
|
| | |
| | | m_DestTipText.text = _content;
|
| | | _textHeight = Mathf.Max(m_DestTipText.preferredHeight, m_DestTipText.fontSize);
|
| | | _height += Mathf.Max(0, _textHeight - 23);
|
| | | }
|
| | | else if (_type == ScrollerDataType.Extra2 || _type == ScrollerDataType.Extra3)
|
| | | {
|
| | | m_DestText.SetExtenalData(_infoList);
|
| | | m_DestText.text = _content;
|
| | | _textHeight = Mathf.Max(m_DestText.preferredHeight, m_DestText.fontSize);
|
| | | _height += Mathf.Max(0, _textHeight - 8);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DestText.SetExtenalData(_infoList);
|
| | | m_DestText.text = _content;
|
| | | _textHeight = Mathf.Max(m_DestText.preferredHeight, m_DestText.fontSize);
|
| | | _height += Mathf.Max(0, _textHeight - 30);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | public class ChatMineVoiceCell : ScrollerUI
|
| | | {
|
| | | [SerializeField] Text m_VoiceTxt;
|
| | | [SerializeField] Button m_VoiceBtn;
|
| | | [SerializeField] RichText m_ChatTxt;
|
| | | [SerializeField] Image m_ChatBubble;
|
| | | [SerializeField] Text vipText;
|
| | | [SerializeField] Text playerNameText;
|
| | | [SerializeField] Text m_VoiceTimes;
|
| | | [SerializeField] Button m_Voice;
|
| | | [SerializeField] ChatBubbleBehaviour m_ChatBubble;
|
| | | [SerializeField] Text m_VipLevel;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] Text m_ChatTime;
|
| | | [SerializeField] Image m_ChatIcon;
|
| | | [SerializeField] ImageFitterText m_Fitter;
|
| | | [SerializeField] float spacing = 15.0f;
|
| | |
|
| | | ChatCenter m_ChatCenter;
|
| | | ChatCenter chatCenter
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | #region 更新高度
|
| | | m_ChatTxt.AutoNewLine = false;
|
| | | m_ChatTxt.text = _data.content;
|
| | | if (m_ChatTxt.preferredWidth > m_ChatTxt.rectTransform.rect.width)
|
| | | {
|
| | | m_ChatTxt.alignment = TextAnchor.UpperLeft;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ChatTxt.alignment = TextAnchor.UpperRight;
|
| | | }
|
| | | m_Fitter.FiterRealTxtWidth = m_ChatTxt.alignment == TextAnchor.UpperRight;
|
| | | m_Fitter.gameObject.SetActive(!string.IsNullOrEmpty(_data.content));
|
| | | m_ChatTxt.AutoNewLine = true;
|
| | | #endregion
|
| | | m_ChatBubble.DisplayContent(_data.content);
|
| | | m_ChatBubble.gameObject.SetActive(!string.IsNullOrEmpty(_data.content));
|
| | |
|
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(_data.job, 0));
|
| | | playerNameText.text = _data.name;
|
| | | m_PlayerName.text = _data.name;
|
| | | m_ChatTime.text = _data.createTime.ToString("yyyy-MM-dd HH:mm"); |
| | | if (_data.vipLv > 0)
|
| | | {
|
| | | vipText.text = string.Format("V{0}", _data.vipLv);
|
| | | m_VipLevel.text = string.Format("V{0}", _data.vipLv);
|
| | | }
|
| | | else
|
| | | {
|
| | | vipText.text = string.Empty;
|
| | | m_VipLevel.text = string.Empty;
|
| | | }
|
| | | m_VoiceBtn.onClick.RemoveAllListeners();
|
| | | m_VoiceTxt.text = _data.soundLength.ToString("0.0");
|
| | | m_VoiceBtn.onClick.AddListener(() =>
|
| | | m_Voice.onClick.RemoveAllListeners();
|
| | | m_VoiceTimes.text = _data.soundLength.ToString("0.0");
|
| | | m_Voice.onClick.AddListener(() =>
|
| | | {
|
| | | OnVoiceClick(_data, Mathf.Min(8.0f, _data.soundLength));
|
| | | });
|
| | |
| | | chatCenter.PlaySpeech(_chat.player, _chat.soundTick, _length);
|
| | | }
|
| | | }
|
| | |
|
| | | public float GetHeight(string content, ArrayList list)
|
| | | {
|
| | | var minHeight = m_ChatIcon.rectTransform.sizeDelta.y;
|
| | | var chatHeight = m_ChatBubble.GetBubbleHeight(content, list) + Mathf.Abs(m_ChatBubble.transform.localPosition.y);
|
| | | if (string.IsNullOrEmpty(content))
|
| | | {
|
| | | chatHeight = 0;
|
| | | }
|
| | | return (chatHeight > minHeight ? chatHeight : minHeight) + spacing;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | public class ChatOtherVoiceCell : ScrollerUI
|
| | | {
|
| | | [SerializeField] Text m_VoiceTxt;
|
| | | [SerializeField] Button m_VoiceBtn;
|
| | | [SerializeField] RichText m_ChatTxt;
|
| | | [SerializeField] Image m_ChatBubble;
|
| | | [SerializeField] Text vipText;
|
| | | [SerializeField] Text playerNameText;
|
| | | [SerializeField] Text m_VoiceTimes;
|
| | | [SerializeField] Button m_Voice;
|
| | | [SerializeField] ChatBubbleBehaviour m_ChatBubble;
|
| | | [SerializeField] Text m_VipLevel;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] Text m_ChatTime;
|
| | | [SerializeField] Image m_ChatIcon;
|
| | | [SerializeField] ImageFitterText m_Fitter;
|
| | | [SerializeField] Button m_ViewPlayer;
|
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] float spacing = 15.0f;
|
| | |
|
| | | ChatCenter m_ChatCenter;
|
| | | ChatCenter chatCenter
|
| | |
| | | }
|
| | | public override void Refresh(CellView cell)
|
| | | {
|
| | | m_ViewPlayer.RemoveAllListeners();
|
| | | m_Func.RemoveAllListeners();
|
| | | ChatUeseData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index) as ChatUeseData;
|
| | | if (_data == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | m_ViewPlayer.onClick.AddListener(() =>
|
| | | m_Func.onClick.AddListener(() =>
|
| | | {
|
| | | ViewPlayer(_data);
|
| | | });
|
| | | m_ChatTxt.text = _data.content;
|
| | | m_Fitter.gameObject.SetActive(!string.IsNullOrEmpty(_data.content));
|
| | | m_ChatBubble.DisplayContent(_data.content, true);
|
| | | m_ChatBubble.gameObject.SetActive(!string.IsNullOrEmpty(_data.content));
|
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(_data.job, 0));
|
| | | playerNameText.text = _data.name;
|
| | | m_PlayerName.text = _data.name;
|
| | | m_ChatTime.text = _data.createTime.ToString("yyyy-MM-dd HH:mm");
|
| | | if (_data.vipLv > 0)
|
| | | {
|
| | | vipText.text = string.Format("V{0}", _data.vipLv);
|
| | | m_VipLevel.text = string.Format("V{0}", _data.vipLv);
|
| | | }
|
| | | else
|
| | | {
|
| | | vipText.text = string.Empty;
|
| | | m_VipLevel.text = string.Empty;
|
| | | }
|
| | | m_VoiceBtn.onClick.RemoveAllListeners();
|
| | | m_VoiceTxt.text = _data.soundLength.ToString("0.0");
|
| | | m_VoiceBtn.onClick.AddListener(() =>
|
| | | m_Voice.onClick.RemoveAllListeners();
|
| | | m_VoiceTimes.text = _data.soundLength.ToString("0.0");
|
| | | m_Voice.onClick.AddListener(() =>
|
| | | {
|
| | | OnVoiceClick(_data, Mathf.Min(8.0f, _data.soundLength));
|
| | | });
|
| | |
| | | }
|
| | | HrefAnalysis.Inst.ExcuteHrefEvent(string.Format("showplayer={0}", user.player));
|
| | | }
|
| | |
|
| | | public float GetHeight(string content, ArrayList list)
|
| | | {
|
| | | var minHeight = m_ChatIcon.rectTransform.sizeDelta.y;
|
| | | var chatHeight = m_ChatBubble.GetBubbleHeight(content, list) + Mathf.Abs(m_ChatBubble.transform.localPosition.y);
|
| | | if (string.IsNullOrEmpty(content))
|
| | | {
|
| | | chatHeight = 0;
|
| | | }
|
| | | return (chatHeight > minHeight ? chatHeight : minHeight) + spacing;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Text m_VipLv; |
| | | [SerializeField] Text m_PlayerName; |
| | | [SerializeField] Text m_ChatTime; |
| | | [SerializeField] RichText m_Chat; |
| | | [SerializeField] ImageFitterText m_Fitter; |
| | | [SerializeField] ChatBubbleBehaviour m_ChatBubble; |
| | | [SerializeField] Button m_Func; |
| | | [SerializeField] float spacing = 5.0f; |
| | | |
| | | ChatCenter m_ChatCenter; |
| | | ChatCenter chatCenter |
| | |
| | | }
|
| | | var chatUserData = data as ChatUeseData; |
| | | |
| | | #region 更新高度 |
| | | m_Chat.AutoNewLine = false; |
| | | m_Chat.text = data.content; |
| | | if (type == ScrollerDataType.Header) |
| | | { |
| | | if (m_Chat.preferredWidth > m_Chat.rectTransform.rect.width) |
| | | { |
| | | m_Chat.alignment = TextAnchor.UpperLeft; |
| | | } |
| | | else |
| | | { |
| | | m_Chat.alignment = TextAnchor.UpperRight; |
| | | } |
| | | m_Fitter.FiterRealTxtWidth = m_Chat.alignment == TextAnchor.UpperRight; |
| | | } |
| | | m_Chat.AutoNewLine = true; |
| | | m_ChatBubble.DisplayContent(data.content); |
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(chatUserData.job, 0)); |
| | | #endregion |
| | | |
| | | m_Func.onClick.RemoveAllListeners(); |
| | | m_Func.onClick.AddListener(() => |
| | |
| | | } |
| | | HrefAnalysis.Inst.ExcuteHrefEvent(string.Format("showplayer={0}", user.player)); |
| | | } |
| | | |
| | | public float GetHeight(string content, ArrayList list)
|
| | | {
|
| | | var minHeight = m_ChatIcon.rectTransform.sizeDelta.y;
|
| | | var chatHeight = m_ChatBubble.GetBubbleHeight(content, list) + Mathf.Abs(m_ChatBubble.transform.localPosition.y);
|
| | | return (chatHeight > minHeight ? chatHeight : minHeight) + spacing;
|
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | using UnityEngine.UI; |
| | | using System; |
| | | using Snxxz.UI; |
| | | |
| | | public class ChatPlayerOtherCell : ScrollerUI |
| | | { |
| | | [SerializeField] Image m_ChatIcon; |
| | | [SerializeField] Text m_VipLv; |
| | | [SerializeField] Text m_PlayerName; |
| | | [SerializeField] Text m_ChatTime; |
| | | [SerializeField] RectTransform m_Bottom; |
| | | [SerializeField] RichText m_Chat; |
| | | [SerializeField] Button m_Func; |
| | | |
| | | ChatCenter m_ChatCenter; |
| | | ChatCenter chatCenter |
| | | { |
| | | get |
| | | { |
| | | return m_ChatCenter ?? (m_ChatCenter = ModelCenter.Instance.GetModel<ChatCenter>()); |
| | | } |
| | | } |
| | | public override void Refresh(CellView cell) |
| | | { |
| | | var data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index); |
| | | if (data == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | #region 更新高度 |
| | | if (type == ScrollerDataType.Header) |
| | | { |
| | | if (m_Chat.preferredWidth > m_Chat.rectTransform.rect.width) |
| | | { |
| | | m_Chat.alignment = TextAnchor.UpperLeft; |
| | | } |
| | | else |
| | | { |
| | | m_Chat.alignment = TextAnchor.UpperRight; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | var chatUserData = data as ChatUeseData; |
| | | m_Func.onClick.RemoveAllListeners(); |
| | | m_Func.onClick.AddListener(() => |
| | | { |
| | | OnFunc(cell); |
| | | }); |
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(chatUserData.job, 0)); |
| | | m_PlayerName.text = chatUserData.name; |
| | | m_ChatTime.text = data.createTime.ToString("yyyy-MM-dd HH:mm"); |
| | | if (chatUserData.vipLv > 0) |
| | | { |
| | | m_VipLv.text = string.Format("V{0}", chatUserData.vipLv); |
| | | } |
| | | else |
| | | { |
| | | m_VipLv.text = string.Empty; |
| | | } |
| | | m_Chat.AutoNewLine = true; |
| | | m_Chat.text = data.content; |
| | | } |
| | | |
| | | private void OnFunc(CellView cell) |
| | | { |
| | | int index = cell.index; |
| | | ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, index); |
| | | if (_data == null) |
| | | { |
| | | return; |
| | | } |
| | | ChatUeseData user = _data as ChatUeseData; |
| | | if (user.player == PlayerDatas.Instance.baseData.PlayerID)
|
| | | namespace EnhancedUI.EnhancedScroller
|
| | | {
|
| | | public class ChatPlayerOtherCell : ScrollerUI
|
| | | {
|
| | | [SerializeField] Image m_ChatIcon;
|
| | | [SerializeField] Text m_VipLv;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] Text m_ChatTime;
|
| | | [SerializeField] ChatBubbleBehaviour m_ChatBubble;
|
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] float spacing = 5.0f; |
| | |
|
| | | ChatCenter m_ChatCenter;
|
| | | ChatCenter chatCenter
|
| | | {
|
| | | return;
|
| | | } |
| | | HrefAnalysis.Inst.ExcuteHrefEvent(string.Format("showplayer={0}", user.player)); |
| | | } |
| | | get
|
| | | {
|
| | | return m_ChatCenter ?? (m_ChatCenter = ModelCenter.Instance.GetModel<ChatCenter>());
|
| | | }
|
| | | }
|
| | | public override void Refresh(CellView cell)
|
| | | {
|
| | | var data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, cell.index);
|
| | | if (data == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var chatUserData = data as ChatUeseData;
|
| | | m_Func.onClick.RemoveAllListeners();
|
| | | m_Func.onClick.AddListener(() =>
|
| | | {
|
| | | OnFunc(cell);
|
| | | });
|
| | | m_ChatIcon.SetSprite(GeneralDefine.GetJobHeadPortrait(chatUserData.job, 0));
|
| | | m_PlayerName.text = chatUserData.name;
|
| | | m_ChatTime.text = data.createTime.ToString("yyyy-MM-dd HH:mm");
|
| | | if (chatUserData.vipLv > 0)
|
| | | {
|
| | | m_VipLv.text = string.Format("V{0}", chatUserData.vipLv);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_VipLv.text = string.Empty;
|
| | | }
|
| | | m_ChatBubble.DisplayContent(data.content, true);
|
| | | }
|
| | |
|
| | | private void OnFunc(CellView cell)
|
| | | {
|
| | | int index = cell.index;
|
| | | ChatData _data = chatCenter.GetChatData(ChatCtrl.Inst.presentChatType, index);
|
| | | if (_data == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | ChatUeseData user = _data as ChatUeseData;
|
| | | if (user.player == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | HrefAnalysis.Inst.ExcuteHrefEvent(string.Format("showplayer={0}", user.player));
|
| | | }
|
| | |
|
| | | public float GetHeight(string content, ArrayList list)
|
| | | {
|
| | | var minHeight = m_ChatIcon.rectTransform.sizeDelta.y;
|
| | | var chatHeight = m_ChatBubble.GetBubbleHeight(content, list) + Mathf.Abs(m_ChatBubble.transform.localPosition.y);
|
| | | return (chatHeight > minHeight ? chatHeight : minHeight) + spacing;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | |
| | | {
|
| | | case -5:
|
| | | case 0:
|
| | | StateDetermination();
|
| | | bool Bool= StateDetermination();
|
| | | if (Bool)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (mainModel.TaskId_Skill.Contains(Task_ID))
|
| | | {
|
| | | mainModel.TaskSkillID = Task_ID;
|
| | |
| | |
|
| | |
|
| | |
|
| | | private void StateDetermination()//状态判定
|
| | | private bool StateDetermination()//状态判定
|
| | | {
|
| | | bool _bool = false;
|
| | | DropItemManager.StopMissionPickup = true;//主动停止拾取物品
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | |
| | | if (value.NPCID == npcId && value.MapID != mapID)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Task_Transfer1");
|
| | | return;
|
| | | _bool = true;
|
| | | return _bool;
|
| | | }
|
| | | }
|
| | | var MonsterConfig = Config.Instance.Get<MonsterRefreshPointConfig>(npcId);
|
| | | if (MonsterConfig != null && MonsterConfig.MapId != mapID)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Task_Transfer1");
|
| | | return;
|
| | | _bool = true;
|
| | | return _bool;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return _bool;
|
| | | }
|
| | |
|
| | | private void OnClickDeliveryButton()//传送符
|
| | |
| | | [SerializeField] TeamInvitationEntrance m_TeamInvitationEntrance;
|
| | |
|
| | | [SerializeField] FairyCallMemberBehaviour m_FairyCallBehaviour;
|
| | | [SerializeField] MapSwitchingBehaviour m_MapSwitchingBehaviour;
|
| | | #region
|
| | | private int mapId = 0;
|
| | | public delegate void OnChatCallback();//聊天回调
|
| | |
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | m_MapSwitchingBehaviour.InitAwake();
|
| | | recordPositionBool = true;
|
| | | m_TaskAndTeamPanel.localPosition = TaskListTipAnchor1.localPosition;
|
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition;
|
| | |
| | | m_AnimationFadeOut.Init();
|
| | | m_TeamInvitationEntrance.Init();
|
| | | m_FairyCallBehaviour.Init();
|
| | | m_MapSwitchingBehaviour.Init();
|
| | | m_BossBriefInfos.gameObject.SetActive(false);
|
| | | UpdateWishAwardImag();
|
| | | ArticleExperience();//关于经验条
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, November 02, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using TableConfig; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class MapSwitchingBehaviour:MonoBehaviour {
|
| | | [SerializeField] Button m_Btn_MapSwitch;
|
| | | List<int> MapIdList = new List<int>();
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public void InitAwake()
|
| | | {
|
| | | var config = Config.Instance.Get<FuncConfigConfig>("MapLine").Numerical4;
|
| | | int[] mapList = ConfigParse.GetMultipleStr<int>(config);
|
| | | MapIdList.Clear();
|
| | | for (int i = 0; i < mapList.Length; i++)
|
| | | {
|
| | | MapIdList.Add(mapList[i]);
|
| | | }
|
| | | }
|
| | | public void Init()
|
| | | {
|
| | | int MapID = PlayerDatas.Instance.baseData.MapID;
|
| | | if (MapIdList.Contains(MapID))
|
| | | {
|
| | | m_Btn_MapSwitch.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Btn_MapSwitch.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | private void Awake()
|
| | | {
|
| | | |
| | | } |
| | | private void Start()
|
| | | {
|
| | | m_Btn_MapSwitch.AddListener(OnClickMapSwitch);
|
| | | } |
| | | private void OnEnable()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | |
| | | } |
| | | |
| | | private void OnClickMapSwitch()
|
| | | {
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Task_Transfer1");
|
| | | return;
|
| | | }
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
| | | "What?系不系要退出去", (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | model.ExitCurrentDungeon();
|
| | | }
|
| | | });
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5a7bad04558b04444bec738226d3bad1 |
| | | timeCreated: 1541144798 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | return; |
| | | } |
| | | textBuilder.Length = 0; |
| | | var start = quickRange.index + index * quickRange.single; |
| | | var start = quickRange.index + index * quickRange.single;
|
| | | var end = start + value.Length; |
| | | if (quickRange.length == quickRange.single)
|
| | | {
|
| | | end = start + quickRange.length;
|
| | | } |
| | | textBuilder.Append(setting, 0, start); |
| | | textBuilder.Append(value); |
| | | if (quickRange.length == quickRange.single
|
| | | && quickRange.length > value.Length)
|
| | | {
|
| | | textBuilder.Append('*', quickRange.length - value.Length);
|
| | | } |
| | | textBuilder.Append(setting, end, setting.Length - end); |
| | | setting = textBuilder.ToString(); |
| | | PlayerDatas.Instance.baseData.Setting = setting; |