| | |
| | | /// </summary> |
| | | public class HomeWin : UIBase |
| | | { |
| | | |
| | | //经验区 |
| | | [SerializeField] Text playerLevelText; |
| | | [SerializeField] SmoothSlider expSlider; |
| | |
| | | [SerializeField] Button horseBtn; |
| | | [SerializeField] HorseController horseImg; |
| | | [SerializeField] Text horseLVText; |
| | | |
| | | |
| | | //聊天 |
| | | [SerializeField] Button chatBtn; |
| | | [SerializeField] Transform transFastChat; |
| | | [SerializeField] InputField inputFastChat; |
| | | [SerializeField] ButtonEx btnFastChatSend; |
| | | [SerializeField] ImageEx imgFastChatSend; |
| | | [SerializeField] TextEx txtFastChatSend; |
| | | [SerializeField] ButtonEx btnFastChatClose; |
| | | [SerializeField] ButtonEx btnChatWin; |
| | | [SerializeField] TextEx txtChatChannel; |
| | | |
| | | |
| | | [SerializeField] Transform transChatBulletView; |
| | | GameObject chatBulletViewPrefab; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化组件 |
| | | /// </summary> |
| | |
| | | }); |
| | | |
| | | restBtn.AddListener(GotoRest); |
| | | funcColBtn.AddListener(()=> |
| | | funcColBtn.AddListener(() => |
| | | { |
| | | rightFuncInHome.ShowFuncCol(true); |
| | | }); |
| | | |
| | | horseBtn.AddListener(OpenHorse); |
| | | |
| | | chatBtn.SetListener(() => |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Chat, true)) |
| | | return; |
| | | |
| | | transFastChat.SetActive(true); |
| | | chatBtn.SetActive(false); |
| | | UpdateChat(ChatManager.Instance.nowChatTab); |
| | | |
| | | }); |
| | | btnFastChatClose.SetListener(() => |
| | | { |
| | | transFastChat.SetActive(false); |
| | | chatBtn.SetActive(true); |
| | | }); |
| | | btnChatWin.SetListener(() => |
| | | { |
| | | transFastChat.SetActive(false); |
| | | chatBtn.SetActive(true); |
| | | UIManager.Instance.OpenWindow<ChatWin>(); |
| | | }); |
| | | |
| | | btnFastChatSend.SetListener(() => |
| | | { |
| | | // 如果在聊天输入界面无输入文字点击发送,则关闭聊天输入界面 |
| | | if (string.IsNullOrEmpty(inputFastChat.text)) |
| | | { |
| | | transFastChat.SetActive(false); |
| | | chatBtn.SetActive(true); |
| | | return; |
| | | } |
| | | |
| | | if (!ChatManager.Instance.CheckChatLimit(inputFastChat.text, out int errorCode)) |
| | | { |
| | | ChatManager.Instance.ShowChatErrorTip(errorCode); |
| | | return; |
| | | } |
| | | ChatManager.Instance.SendChatInfo(ChatManager.Instance.nowChatChannel, inputFastChat.text); |
| | | ChatManager.Instance.AddChatChannelSendTime(ChatManager.Instance.nowChatChannel, TimeUtility.AllSeconds); |
| | | UpdateSendButton(); |
| | | inputFastChat.text = string.Empty; |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | officialTip.SetActive(OfficialRankManager.Instance.CanOfficialLVUP()); |
| | | |
| | | DisplayHorse(); |
| | | |
| | | DisplayChatBulletView(); |
| | | chatBtn.SetActive(true); |
| | | transFastChat.SetActive(false); |
| | | inputFastChat.characterLimit = ChatManager.Instance.characterLimit; |
| | | UpdateSendButton(); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | FirstChargeManager.Instance.OnFirstChargeTaskUpdateEvent += OnFirstChargeTaskUpdateEvent; |
| | | OfficialRankManager.Instance.RealmMissionRefreshEvent += OnOfficialCanLVUpEvent; |
| | | HorseManager.Instance.OnHorseUpdateEvent += DisplayHorse; |
| | | ChatManager.Instance.OnChatTabChangeEvent += OnChatTabChangeEvent; |
| | | GuildManager.Instance.EnterOrQuitGuildEvent += EnterOrQuitGuildEvent; |
| | | Display(); |
| | | DisplayFirstChargeBtn(); |
| | | |
| | |
| | | FirstChargeManager.Instance.OnFirstChargeTaskUpdateEvent -= OnFirstChargeTaskUpdateEvent; |
| | | OfficialRankManager.Instance.RealmMissionRefreshEvent -= OnOfficialCanLVUpEvent; |
| | | HorseManager.Instance.OnHorseUpdateEvent -= DisplayHorse; |
| | | ChatManager.Instance.OnChatTabChangeEvent -= OnChatTabChangeEvent; |
| | | GuildManager.Instance.EnterOrQuitGuildEvent -= EnterOrQuitGuildEvent; |
| | | |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | | } |
| | | |
| | | private void UpdateSendButton() |
| | | { |
| | | bool isCanSend = ChatManager.Instance.IsCanSend(ChatManager.Instance.nowChatChannel, out int remainingSeconds); |
| | | btnFastChatSend.interactable = isCanSend; |
| | | imgFastChatSend.gray = !isCanSend; |
| | | txtFastChatSend.text = isCanSend ? Language.Get("Chat11") : Language.Get("Chat14", remainingSeconds); |
| | | txtFastChatSend.colorType = isCanSend ? TextColType.NavyBrown : TextColType.LightWhite; |
| | | } |
| | | |
| | | |
| | | private void EnterOrQuitGuildEvent(bool obj) |
| | | { |
| | | if (!obj) |
| | | { |
| | | UpdateChat(ChatManager.Instance.nowChatTab); |
| | | } |
| | | } |
| | | |
| | | private void OnChatTabChangeEvent(ChatTab tab) |
| | | { |
| | | UpdateChat(tab); |
| | | } |
| | | |
| | | void UpdateChat(ChatTab tab) |
| | | { |
| | | txtChatChannel.text = ChatManager.Instance.GetChatTabName(tab); |
| | | } |
| | | |
| | | void DisplayChatBulletView() |
| | | { |
| | | if (chatBulletViewPrefab == null) |
| | | { |
| | | chatBulletViewPrefab = UIUtility.CreateWidget("ChatBulletView", "ChatBulletView"); |
| | | } |
| | | chatBulletViewPrefab.transform.SetParentEx(transChatBulletView.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | // 新增:确保 ChatBulletView 组件启用 |
| | | // var chatBulletView = chatBulletViewPrefab.GetComponent<ChatBulletView>(); |
| | | // if (chatBulletView != null) |
| | | // { |
| | | // chatBulletView.enabled = true; |
| | | // } |
| | | } |
| | | |
| | | void OnOfficialCanLVUpEvent() |
| | |
| | | if (showEffect) |
| | | { |
| | | headEffect.transform.DOLocalMove(new Vector3(400 * expSlider.value - 200 - 24, 0, 0), 0.5f); |
| | | headEffect.Play(closePMA:true); |
| | | headEffect.Play(closePMA: true); |
| | | } |
| | | } |
| | | |
| | |
| | | GameNetSystem.Instance.SendInfo(getReward); |
| | | return; |
| | | } |
| | | |
| | | |
| | | TaskManager.Instance.ClickTask(); |
| | | } |
| | | |
| | |
| | | private void OnSecondEvent() |
| | | { |
| | | DisplayFirstChargeBtn(); |
| | | UpdateSendButton(); |
| | | } |
| | | |
| | | void OnUnLockHeroCountEvent() |
| | |
| | | //equipShowSwitch;//当前配置的坐骑外观ID存储在(最大支持 1~999) |
| | | var skinConfig = HorseSkinConfig.Get(HorseManager.Instance.GetUsingHorseSkinID(true)); |
| | | horseImg.Create(skinConfig.SkinID, 0, 0.6f); |
| | | horseLVText.text = Language.Get("Horse8",HorseManager.Instance.classLV, HorseManager.Instance.horseLV); |
| | | horseLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV, HorseManager.Instance.horseLV); |
| | | } |
| | | else |
| | | { |