| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Saturday, October 14, 2017 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using DG.Tweening; |
| | | using System; |
| | | using TableConfig; |
| | | using System.Collections; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class MainInterfaceWin : Window |
| | | { |
| | | [SerializeField] InGamePushContainer m_InGamePusher; |
| | | [SerializeField] SkillContainer m_SkillContainer; |
| | | [SerializeField] HeadPortraitTip m_HeadPortraitTip; |
| | | [SerializeField] LowSettingTip m_LowSettingTip; |
| | | [SerializeField] ChatFrame m_ChatTip; |
| | | [SerializeField] HighSettingTip m_HighSettingTip; |
| | | [SerializeField] TaskListTip m_TaskListTip;//任务 |
| | | [SerializeField] TopRightTip m_TopRightTip; |
| | | |
| | | [SerializeField] Button friendQuestBtn; |
| | | [SerializeField] Button fairyRequestBtn; |
| | | [SerializeField] FunctionForecastTip m_FunctionForecastTip;//功能预告 |
| | | [SerializeField] IsShowXpButton m_IsShowXp;//XP 技能常显 |
| | | // [SerializeField] XpSkill m_XpSkill; |
| | | [SerializeField] SkillButtonEffects m_SkillButtonEffects; |
| | | |
| | | [Header("副本面板移动速度")] |
| | | public float CopyOfThePanelSpeed = 1f;//副本面板移动速度 |
| | | [SerializeField] Transform CopyOfThePanel; |
| | | [SerializeField] Transform m_ContainerBossList; |
| | | [SerializeField] DungeonBossBriefInfoContainer m_BossBriefInfos; |
| | | [SerializeField] Transform CopyOfThePosition1; |
| | | [SerializeField] Transform CopyOfThePosition2; |
| | | |
| | | [SerializeField] IntensifySmoothSlider _ExpSlider;//经验条 |
| | | [SerializeField] Button _DownButton;//查看经验数值 |
| | | [SerializeField] Text _ExpRate;//数值 |
| | | [SerializeField] UIEffect m_UIEffect_A;//经验特效 |
| | | [SerializeField] UIEffect m_UIEffect_B;//经验特效 |
| | | private float ExpValueFloat = 0; |
| | | private bool SliderOpen = true; |
| | | public float _Delaytime = 0.1f;//延迟时间 |
| | | |
| | | |
| | | [Header("任务面板的移动速度")] |
| | | public float Speed = 0.2f; |
| | | [Header("技能面板和按钮面板的移动速度")] |
| | | public float SwitchSkillTipAndButtonTipSpeed = 0.2f; |
| | | public float DoFade = 0.2f; |
| | | [SerializeField] Transform m_LowSettingTipGroup;//按钮面板 |
| | | [SerializeField] Transform m_CastSkillTip;//技能面板 |
| | | [SerializeField] Transform m_position1_S; |
| | | [SerializeField] Transform m_position2_S; |
| | | public static bool recordPositionBool = true; |
| | | |
| | | [Header("策划要的角度")] |
| | | public Vector3 Vec3 = new Vector3(0f, 0f, 225f); |
| | | [SerializeField] Transform m_ImageRotation;//切换滚动 |
| | | |
| | | [SerializeField] GameObject m_TaskAndTeamTip; |
| | | [SerializeField] GameObject LeftImage; |
| | | [SerializeField] GameObject RightImg; |
| | | [SerializeField] Transform m_TaskAndTeamPanel; |
| | | [SerializeField] Transform TaskListTipAnchor1; |
| | | [SerializeField] Transform TaskListTipAnchor2; |
| | | |
| | | [SerializeField] Button m_TaskSwithButton;//关于功能预告 |
| | | [SerializeField] Transform FunctionForecastPanel; |
| | | [SerializeField] Transform unctionForecastPosition1; |
| | | [SerializeField] Transform unctionForecastPosition2; |
| | | |
| | | [SerializeField] Button m_CollectBtn; |
| | | [SerializeField] Image m_CollectIcon; |
| | | [SerializeField] Text m_CollectBtnText; |
| | | [SerializeField] Button m_RedBag;//红包入口按钮 |
| | | [SerializeField] UIEffect m_RedpackGetSfx; |
| | | [SerializeField] Button m_SendRedbagBtn; |
| | | |
| | | [SerializeField] Transform m_EffectTask;//任务完成特效播放位置 |
| | | private int m_CollectNPCID; |
| | | private uint m_CollectNPCSID; |
| | | private bool TaskSwithBool = true; |
| | | |
| | | [SerializeField] Button _SwitchShowBtn;//切换按钮 |
| | | [SerializeField] AnimationFadeOut m_AnimationFadeOut; |
| | | |
| | | [SerializeField] GameObject m_MailObj;//邮件显隐 |
| | | |
| | | [SerializeField] ClickScreenOtherSpace _MarkRay;//便捷切换按钮 |
| | | |
| | | [SerializeField] TeamInvitationEntrance m_TeamInvitationEntrance; |
| | | #region |
| | | private float switcherTime = 0;//主界面自动切换时间 |
| | | private int mapId = 0; |
| | | public delegate void OnChatCallback();//聊天回调 |
| | | public static event OnChatCallback Event_ChatCallback; |
| | | public delegate void OnDuplicates(bool _bool, float _speed); |
| | | public static event OnDuplicates Event_Duplicates; |
| | | public static event Action<bool> SitEvent;//关于打坐的回调 |
| | | #endregion |
| | | private List<int> ListBossMapId = new List<int>();//用于boss区域地图id |
| | | |
| | | public static event Action<bool> IsCopyOfThePanel; |
| | | public static event Action IsOpenMaininterface; |
| | | public static bool CopyOfThePositionBool = true; |
| | | |
| | | RealmModel m_RealmModel; |
| | | RealmModel realmModel { get { return m_RealmModel ?? (m_RealmModel = ModelCenter.Instance.GetModel<RealmModel>()); } } |
| | | FairyModel m_FairyModel; |
| | | FairyModel fairyModel { get { return m_FairyModel ?? (m_FairyModel = ModelCenter.Instance.GetModel<FairyModel>()); } } |
| | | FriendsModel _friendsModel; |
| | | FriendsModel friendsModel { get { return _friendsModel ?? (_friendsModel = ModelCenter.Instance.GetModel<FriendsModel>()); } } |
| | | PlayerMountDatas m_HorseModel; |
| | | PlayerMountDatas horsemodel { get { return m_HorseModel ?? (m_HorseModel = ModelCenter.Instance.GetModel<PlayerMountDatas>()); } } |
| | | PlayerMainDate m_MainModel; |
| | | PlayerMainDate onMainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } } |
| | | PlayerTaskDatas m_PlayerTask; |
| | | PlayerTaskDatas onPlayerTask { get { return m_PlayerTask ?? (m_PlayerTask = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } } |
| | | PlayerRedPacketDatas m_RedPacket; |
| | | PlayerRedPacketDatas redPacket { get { return m_RedPacket ?? (m_RedPacket = ModelCenter.Instance.GetModel<PlayerRedPacketDatas>()); } } |
| | | PlayerBuffDatas m_BuffModel; |
| | | PlayerBuffDatas Buffmodel { get { return m_BuffModel ?? (m_BuffModel = ModelCenter.Instance.GetModel<PlayerBuffDatas>()); } } |
| | | PKModel m_PKModel; |
| | | PKModel pKModel { get { return m_PKModel ?? (m_PKModel = ModelCenter.Instance.GetModel<PKModel>()); } } |
| | | OSRedEnvelopeModel OSEnvelopeModel { get { return ModelCenter.Instance.GetModel<OSRedEnvelopeModel>(); } } |
| | | RuneTowerModel runeTowerModel { get { return ModelCenter.Instance.GetModel<RuneTowerModel>(); } } |
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } } |
| | | DemonJarModel demonJarModel { get { return ModelCenter.Instance.GetModel<DemonJarModel>(); } } |
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | switcherTime = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("AutomaticSwitch").Numerical1); |
| | | recordPositionBool = true; |
| | | m_TaskAndTeamPanel.localPosition = TaskListTipAnchor1.localPosition; |
| | | // m_LowSettingTipGroup.localPosition = m_position2_L.localPosition; |
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition; |
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0); |
| | | m_MailObj.SetActive(true); |
| | | var inst = BossShowModel.Instance; |
| | | TaskSwithBool = true; |
| | | FunctionForecastPanel.localPosition = unctionForecastPosition1.localPosition; |
| | | LeftImage.SetActive(true); |
| | | RightImg.SetActive(false); |
| | | ListBossMapId.Clear(); |
| | | string strBoss = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("TaskRetract").Numerical1; |
| | | string[] bossList = ConfigParse.GetMultipleStr(strBoss);//解析出数组| |
| | | for (int i = 0; i < bossList.Length; i++) |
| | | { |
| | | ListBossMapId.Add(int.Parse(bossList[i])); |
| | | } |
| | | |
| | | _MarkRay.gameObject.SetActive(false); |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | UIEventTrigger.Get(_DownButton.gameObject).OnDown = DownButton; |
| | | UIEventTrigger.Get(_DownButton.gameObject).OnUp = UpButton; |
| | | _MarkRay.AddListener(MarkRayButton); |
| | | _SwitchShowBtn.AddListener(SwitchShowButton); |
| | | m_TaskSwithButton.AddListener(TaskSwithButton); |
| | | fairyRequestBtn.onClick.AddListener(OnFairyRequestClick); |
| | | m_RedBag.AddListener(RedPacketButton); |
| | | m_SendRedbagBtn.AddListener(SendRedpacketBtn); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | if (IsOpenMaininterface != null) |
| | | { |
| | | IsOpenMaininterface(); |
| | | } |
| | | SliderOpen = true; |
| | | horseRidBool = false; |
| | | friendsModel.askAddFriendEvent = FriendQuestBtn; |
| | | m_InGamePusher.Init(); |
| | | m_SkillContainer.Init(); |
| | | m_FunctionForecastTip.Init(); |
| | | m_HeadPortraitTip.Init(); |
| | | m_LowSettingTip.Init(); |
| | | m_ChatTip.Init(); |
| | | m_HighSettingTip.Init(); |
| | | m_TaskListTip.Init(); |
| | | m_IsShowXp.Init(); |
| | | m_TopRightTip.Init(); |
| | | m_SkillButtonEffects.Init(); |
| | | m_AnimationFadeOut.Init(); |
| | | m_TeamInvitationEntrance.Init(); |
| | | m_BossBriefInfos.gameObject.SetActive(false); |
| | | |
| | | ArticleExperience();//关于经验条 |
| | | FriendQuestBtn(); |
| | | UpdateFairyRequest(); |
| | | OnRedBagGet();//关于红包入口 |
| | | CheckSendRedpackBtn(); |
| | | CheckChatTipOpen(); |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting; |
| | | FunctionUnlockFlyObject.functionUnLockShowBeginEvent += UnFlodFunctionArea; |
| | | CoroutineMgr.Instance.MaininterCDTimeEvent += OnMaininterCDTime; |
| | | fairyModel.UpdateFairyRequestEvent += UpdateFairyRequest; |
| | | GA_Hero.OnEnterOrExitArea += OnEnterOrExitArea; |
| | | NewBieCenter.Instance.guideBeginEvent += OnGuideBegin; |
| | | NewBieCenter.Instance.guideCompletedEvent += OnGuideCompleted; |
| | | m_CollectBtn.AddListener(OnCollectBtnClick); |
| | | GA_NpcCollect.OnArrive += OnArriveCollectNPC; |
| | | GA_NpcCollect.OnLeave += OnLeaveCollectNpc; |
| | | PlayerRedPacketDatas.OnRedBagGetEvent += OnRedBagGet; |
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterEvent; |
| | | WindowCenter.Instance.windowAfterCloseEvent += WindowAfterEvent; |
| | | OSEnvelopeModel.OSRedEnvelopeUpdateEvent += OnRedBagGet; |
| | | OSEnvelopeModel.OSRedEnvelopeInfoEnvent += OnRedBagGet; |
| | | PlayerTaskDatas.CompletionOfTaskEvent += CompletionOfTaskEvent; |
| | | RedpointCenter.Instance.redpointValueChangeEvent += RedpointValueChangeEvent; |
| | | NewBieCenter.Instance.guideBeginEvent += GuideBeginEvent; |
| | | |
| | | } |
| | | |
| | | private void CompletionOfTaskEvent(int obj) |
| | | { |
| | | EffectMgr.Instance.PlayUIEffect(1100, 1100, m_EffectTask, false); |
| | | |
| | | } |
| | | |
| | | protected override void OnActived() |
| | | { |
| | | m_HighSettingTip.OnActived(); |
| | | } |
| | | |
| | | IEnumerator Co_Load() |
| | | { |
| | | yield return null; |
| | | WindowCenter.Instance.Open<OffLineOnHookWin>(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | bool IsSitBool = PlayerDatas.Instance.hero != null && MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Dazuo);//是否在打坐区域 |
| | | bool IsBossBool = PlayerDatas.Instance.hero != null && MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域 |
| | | if (onMainModel.IsDead || (onMainModel.IsBossAreaTask && !IsBossBool)) |
| | | { |
| | | |
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) > 3) |
| | | { |
| | | TaskSwithButton(); |
| | | } |
| | | onMainModel.IsBossAreaTask = false; |
| | | onMainModel.IsDead = false; |
| | | } |
| | | if (m_AnimationFadeOut.GetIsFadeIn()) |
| | | { |
| | | _MarkRay.gameObject.SetActive(true); |
| | | } |
| | | var inDungeon = IsDungeon(); |
| | | if (inDungeon) |
| | | { |
| | | m_TaskAndTeamTip.SetActive(!inDungeon); |
| | | m_FunctionForecastTip.gameObject.SetActive(false); |
| | | if (WindowCenter.Instance.CheckOpen<FunctionForecastWin>()) |
| | | { |
| | | WindowCenter.Instance.Close<FunctionForecastWin>(); |
| | | } |
| | | m_TaskSwithButton.gameObject.SetActive(false); |
| | | if (mapId != PlayerDatas.Instance.baseData.MapID) |
| | | { |
| | | CopyOfThePanel.localPosition = CopyOfThePosition2.localPosition; |
| | | CopyOfThePositionBool = false; |
| | | m_ContainerBossList.localPosition = CopyOfThePosition1.localPosition; |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (Event_Duplicates != null) |
| | | { |
| | | Event_Duplicates(false, CopyOfThePanelSpeed); |
| | | } |
| | | } |
| | | if (m_AnimationFadeOut.GetIsFadeIn() && mapId != PlayerDatas.Instance.baseData.MapID) |
| | | { |
| | | m_AnimationFadeOut.FadeAtOnce(); |
| | | m_MailObj.SetActive(true); |
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition; |
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0); |
| | | recordPositionBool = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID); |
| | | |
| | | if (isNeutralMap) |
| | | { |
| | | m_BossBriefInfos.gameObject.SetActive(true); |
| | | m_BossBriefInfos.Display(ModelCenter.Instance.GetModel<WorldBossModel>().GetWorldBosses(PlayerDatas.Instance.baseData.MapID)); |
| | | } |
| | | else |
| | | { |
| | | m_BossBriefInfos.gameObject.SetActive(false); |
| | | } |
| | | |
| | | if (isNeutralMap) |
| | | { |
| | | if (mapId != PlayerDatas.Instance.baseData.MapID) |
| | | { |
| | | CopyOfThePanel.localPosition = CopyOfThePosition2.localPosition; |
| | | CopyOfThePositionBool = false; |
| | | m_ContainerBossList.localPosition = CopyOfThePosition1.localPosition; |
| | | m_BossBriefInfos.Unfold(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (!IsSitBool && !IsBossBool) |
| | | { |
| | | CopyOfThePanel.localPosition = CopyOfThePosition1.localPosition; |
| | | CopyOfThePositionBool = true; |
| | | m_ContainerBossList.localPosition = CopyOfThePosition2.localPosition; |
| | | m_BossBriefInfos.Unfold(false); |
| | | } |
| | | } |
| | | |
| | | if (Event_Duplicates != null && (inDungeon || isNeutralMap)) |
| | | { |
| | | Event_Duplicates(true, CopyOfThePanelSpeed); |
| | | } |
| | | |
| | | m_TaskAndTeamTip.SetActive(true); |
| | | m_FunctionForecastTip.gameObject.SetActive(true); |
| | | m_TaskSwithButton.gameObject.SetActive(true); |
| | | } |
| | | mapId = PlayerDatas.Instance.baseData.MapID; |
| | | m_HighSettingTip.AfterOpen(); |
| | | m_ChatTip.OnAfterOpen(); |
| | | HandleAchievement(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | m_IsShowXp.Unit(); |
| | | m_InGamePusher.UnInit(); |
| | | m_SkillContainer.UnInit(); |
| | | m_HeadPortraitTip.UnInit(); |
| | | m_LowSettingTip.UnInit(); |
| | | m_ChatTip.UnInit(); |
| | | m_HighSettingTip.UnInit(); |
| | | m_TaskListTip.UnInit(); |
| | | m_TopRightTip.UnInit(); |
| | | m_SkillButtonEffects.UnInit(); |
| | | m_FunctionForecastTip.Unit(); |
| | | m_AnimationFadeOut.Unit(); |
| | | m_TeamInvitationEntrance.UnInit(); |
| | | horseRidBool = false; |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting; |
| | | FunctionUnlockFlyObject.functionUnLockShowBeginEvent -= UnFlodFunctionArea; |
| | | CoroutineMgr.Instance.MaininterCDTimeEvent -= OnMaininterCDTime; |
| | | fairyModel.UpdateFairyRequestEvent -= UpdateFairyRequest; |
| | | GA_Hero.OnEnterOrExitArea -= OnEnterOrExitArea; |
| | | NewBieCenter.Instance.guideBeginEvent -= OnGuideBegin; |
| | | NewBieCenter.Instance.guideCompletedEvent -= OnGuideCompleted; |
| | | PlayerRedPacketDatas.OnRedBagGetEvent -= OnRedBagGet; |
| | | WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterEvent; |
| | | WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterEvent; |
| | | OSEnvelopeModel.OSRedEnvelopeUpdateEvent -= OnRedBagGet; |
| | | OSEnvelopeModel.OSRedEnvelopeInfoEnvent -= OnRedBagGet; |
| | | PlayerTaskDatas.CompletionOfTaskEvent -= CompletionOfTaskEvent; |
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent; |
| | | NewBieCenter.Instance.guideBeginEvent -= GuideBeginEvent; |
| | | if (WindowCenter.Instance.CheckOpen<FunctionForecastWin>()) |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<FunctionForecastWin>(); |
| | | } |
| | | m_CollectBtn.RemoveAllListeners(); |
| | | GA_NpcCollect.OnArrive -= OnArriveCollectNPC; |
| | | GA_NpcCollect.OnLeave -= OnLeaveCollectNpc; |
| | | m_CollectBtn.gameObject.SetActive(false); |
| | | } |
| | | |
| | | private void GuideBeginEvent() |
| | | { |
| | | if (NewBieCenter.Instance.inGuiding && NewBieCenter.Instance.currentGuide == 89) |
| | | { |
| | | UnFlodFunctionArea(true, 0); |
| | | } |
| | | } |
| | | |
| | | private void RedpointValueChangeEvent(int _id) |
| | | { |
| | | if (_id == OSEnvelopeModel.m_RedAchieveRedpoint.id) |
| | | { |
| | | CheckSendRedpackBtn(); |
| | | } |
| | | } |
| | | |
| | | private void OnRedBagGet()//判断是否开启红包入口 |
| | | { |
| | | if (m_RedpackGetSfx.IsPlaying) |
| | | { |
| | | m_RedpackGetSfx.StopImediatly(); |
| | | } |
| | | if (OSEnvelopeModel.CanGetEnvelope()) |
| | | { |
| | | m_RedBag.gameObject.SetActive(true); |
| | | if (!m_RedpackGetSfx.IsPlaying) |
| | | { |
| | | m_RedpackGetSfx.Play(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (redPacket.IsRedBagGetBool) |
| | | { |
| | | m_RedBag.gameObject.SetActive(true); |
| | | if (!m_RedpackGetSfx.IsPlaying) |
| | | { |
| | | m_RedpackGetSfx.Play(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | m_RedBag.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | CheckSendRedpackBtn(); |
| | | } |
| | | |
| | | private void CheckSendRedpackBtn() |
| | | { |
| | | m_SendRedbagBtn.gameObject.SetActive(!m_RedBag.gameObject.activeSelf && OSEnvelopeModel.m_RedAchieveRedpoint.state == RedPointState.Simple); |
| | | } |
| | | |
| | | private void OnGuideBegin()//引导开始 |
| | | { |
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) > 5) |
| | | { |
| | | TaskSwithButton(); |
| | | } |
| | | } |
| | | |
| | | private void OnGuideCompleted(int obj)//引导结束 |
| | | { |
| | | if (m_AnimationFadeOut.GetIsFadeIn()) |
| | | { |
| | | _MarkRay.gameObject.SetActive(true); |
| | | } |
| | | } |
| | | |
| | | private void OnEnterOrExitArea(MapArea.E_Type _areaType, bool _enter) |
| | | { |
| | | // DesignDebug.LogError(_areaType + ".." + _enter); |
| | | if (PlayerDatas.Instance.baseData.MapID == 10040 && _areaType != MapArea.E_Type.Boss && _enter) |
| | | { |
| | | if (Buffmodel.PkType != onMainModel.AreaState) |
| | | { |
| | | DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)onMainModel.AreaState); |
| | | } |
| | | } |
| | | |
| | | if (_areaType == MapArea.E_Type.Neutral && _enter) |
| | | { |
| | | WindowCenter.Instance.Open<NeutralMarkWin>(); |
| | | int mapID = PlayerDatas.Instance.baseData.MapID; |
| | | var config = ConfigManager.Instance.GetTemplate<MapConfig>(mapID); |
| | | int[] atkInt = pKModel.GetArea(config.AtkType).ToArray(); |
| | | if (atkInt.Length > 1 && Buffmodel.PkType != 5) |
| | | { |
| | | onMainModel.AreaState = Buffmodel.PkType; |
| | | DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)5); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (_areaType == MapArea.E_Type.Neutral && !_enter) |
| | | { |
| | | if (Buffmodel.PkType != onMainModel.AreaState) |
| | | { |
| | | DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)onMainModel.AreaState); |
| | | } |
| | | } |
| | | |
| | | if ((_areaType == MapArea.E_Type.Boss && _enter) || (_areaType == MapArea.E_Type.Dazuo && _enter)) |
| | | { |
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) < 2 && ListBossMapId.Contains(PlayerDatas.Instance.baseData.MapID)) |
| | | { |
| | | TaskSwithButton(); |
| | | onMainModel.IsBossAreaTask = true; |
| | | } |
| | | if (_areaType == MapArea.E_Type.Dazuo && _enter && SitEvent != null) |
| | | { |
| | | SitEvent(true); |
| | | } |
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) < 5) |
| | | { |
| | | if (NewBieCenter.Instance.inGuiding) |
| | | { |
| | | return; |
| | | } |
| | | recordPositionBool = false; |
| | | SwitchShowButton(); |
| | | } |
| | | } |
| | | if ((_areaType == MapArea.E_Type.Boss && !_enter) || (_areaType != MapArea.E_Type.Normal && (_areaType != MapArea.E_Type.Boss && _enter))) |
| | | { |
| | | if (onMainModel.IsBossAreaTask) |
| | | { |
| | | TaskSwithButton(); |
| | | onMainModel.IsBossAreaTask = false; |
| | | } |
| | | } |
| | | var inDungeon = IsDungeon(); |
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID); |
| | | |
| | | if ((_areaType == MapArea.E_Type.Boss && !_enter) || (_areaType == MapArea.E_Type.Dazuo && !_enter)) |
| | | { |
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon && !isNeutralMap) |
| | | { |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(true); |
| | | } |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (SitEvent != null) |
| | | { |
| | | SitEvent(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OnMaininterCDTime() |
| | | { |
| | | MarkRayButton(); |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | private Vector2 startPosition; |
| | | private Vector2 endPosition; |
| | | private bool horseRidBool = false; |
| | | protected override void LateUpdate() |
| | | { |
| | | base.LateUpdate(); |
| | | if (PlayerDatas.Instance.hero != null |
| | | && PlayerDatas.Instance.hero.State == E_ActorState.AutoRun |
| | | && onMainModel.MoveBool) |
| | | { |
| | | if (!WindowCenter.Instance.CheckOpen("PathfindingIconWin")) |
| | | { |
| | | WindowCenter.Instance.Open<PathfindingIconWin>(true); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | onMainModel.MoveBool = false; |
| | | if (WindowCenter.Instance.CheckOpen("PathfindingIconWin")) |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<PathfindingIconWin>(); |
| | | } |
| | | } |
| | | |
| | | if (runeTowerModel.newPassFloor > 0 && !IsDungeon()) |
| | | { |
| | | if (!WindowCenter.Instance.CheckOpen("NewBieWin") && !WindowCenter.Instance.CheckOpen("TreasureNewGotWin")) |
| | | { |
| | | if (!WindowCenter.Instance.CheckOpen("RuneNewGotWin")) |
| | | { |
| | | WindowCenter.Instance.Open<RuneNewGotWin>(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public void FriendQuestBtn() |
| | | { |
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Friend)) |
| | | { |
| | | friendQuestBtn.onClick.RemoveAllListeners(); |
| | | if (friendsModel.GetFriendQuestDict().Count > 0) |
| | | { |
| | | friendQuestBtn.gameObject.SetActive(true); |
| | | friendQuestBtn.onClick.AddListener(OnClickFriendQuest); |
| | | } |
| | | else |
| | | { |
| | | friendQuestBtn.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | friendQuestBtn.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | private void OnFairyRequestClick() |
| | | { |
| | | WindowCenter.Instance.Open<FairyInviteWin>(); |
| | | } |
| | | private void RedPacketButton()//关于红包的功能 入口 |
| | | { |
| | | RedEnvelopeModel envelopeModel = ModelCenter.Instance.GetModel<RedEnvelopeModel>(); |
| | | RedEnvelopeModel.RedEnvelope _envelope; |
| | | if (envelopeModel.TryGetLatestEnvelope(out _envelope)) |
| | | { |
| | | if (OSEnvelopeModel.m_OpenServerGetRedpin.state == RedPointState.Simple) |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>(); |
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().JumpType = 2; |
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().autoOpen = true; |
| | | WindowCenter.Instance.Open<OpenServerActivityWin>(false, 2); |
| | | } |
| | | else |
| | | { |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RedPacket); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void SendRedpacketBtn() |
| | | { |
| | | if (OSEnvelopeModel.m_RedAchieveRedpoint.state == RedPointState.Simple) |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>(); |
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().JumpType = 1; |
| | | WindowCenter.Instance.Open<OpenServerActivityWin>(false, 2); |
| | | } |
| | | } |
| | | |
| | | private void UpdateFairyRequest() |
| | | { |
| | | fairyRequestBtn.gameObject.SetActive(fairyModel.FairyRequestRedPoint.count > 0); |
| | | } |
| | | |
| | | private void OnClickFriendQuest() |
| | | { |
| | | WindowCenter.Instance.Open<FriendQuestWin>(); |
| | | } |
| | | |
| | | public void MarkRayButton() |
| | | { |
| | | if (NewBieCenter.Instance.inGuiding) |
| | | { |
| | | return; |
| | | } |
| | | var _treasureModel = ModelCenter.Instance.GetModel<TreasureModel>(); |
| | | if (_treasureModel.treasureStageUpShow || _treasureModel.newGotShowing) |
| | | { |
| | | return; |
| | | } |
| | | var inDungeon = IsDungeon(); |
| | | |
| | | bool IsBossBool = PlayerDatas.Instance.hero == null ? false : MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域 |
| | | bool IsSitBool = PlayerDatas.Instance.hero == null ? false : MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Dazuo);//是否在打坐区域 |
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID); |
| | | |
| | | if (!recordPositionBool) |
| | | { |
| | | if (inDungeon || IsBossBool || IsSitBool || isNeutralMap) |
| | | { |
| | | if (IsSitBool && SitEvent != null) |
| | | { |
| | | SitEvent(true); |
| | | } |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(false); |
| | | } |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (Event_Duplicates != null && inDungeon) |
| | | { |
| | | Event_Duplicates(false, CopyOfThePanelSpeed); |
| | | } |
| | | |
| | | } |
| | | if (!IsBossBool && !IsSitBool) |
| | | { |
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon) |
| | | { |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(true); |
| | | } |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (SitEvent != null) |
| | | { |
| | | SitEvent(false); |
| | | } |
| | | } |
| | | } |
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed); |
| | | m_CastSkillTip.DOLocalMoveX(m_position1_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed); |
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, DoFade); |
| | | m_MailObj.SetActive(true); |
| | | m_AnimationFadeOut.FadeOut(); |
| | | recordPositionBool = true; |
| | | } |
| | | } |
| | | void DownButton(GameObject go) |
| | | { |
| | | _ExpRate.gameObject.SetActive(true); |
| | | WindowCenter.Instance.Open<LimitedTimePackageWin>(); |
| | | |
| | | } |
| | | void UpButton(GameObject go) |
| | | { |
| | | _ExpRate.gameObject.SetActive(false); |
| | | } |
| | | |
| | | void TaskSwithButton() |
| | | { |
| | | if (onMainModel.IsBossAreaTask) |
| | | { |
| | | onMainModel.IsBossAreaTask = false; |
| | | } |
| | | if (TaskSwithBool)//隐藏 |
| | | { |
| | | m_TaskAndTeamPanel.DOLocalMoveX(TaskListTipAnchor2.localPosition.x, Speed); |
| | | if (m_FunctionForecastTip.gameObject.activeSelf) |
| | | { |
| | | FunctionForecastPanel.DOLocalMoveX(unctionForecastPosition2.localPosition.x, Speed); |
| | | |
| | | } |
| | | LeftImage.SetActive(false); |
| | | RightImg.SetActive(true); |
| | | if (WindowCenter.Instance.CheckOpen<FunctionForecastWin>()) |
| | | { |
| | | WindowCenter.Instance.Close<FunctionForecastWin>(); |
| | | } |
| | | } |
| | | else//显示 |
| | | { |
| | | m_TaskAndTeamPanel.DOLocalMoveX(TaskListTipAnchor1.localPosition.x, Speed); |
| | | if (m_FunctionForecastTip.gameObject.activeSelf) |
| | | { |
| | | FunctionForecastPanel.DOLocalMoveX(unctionForecastPosition1.localPosition.x, Speed); |
| | | } |
| | | LeftImage.SetActive(true); |
| | | RightImg.SetActive(false); |
| | | } |
| | | TaskSwithBool = !TaskSwithBool; |
| | | } |
| | | |
| | | void SwitchShowButton() |
| | | { |
| | | var inDungeon = IsDungeon(); |
| | | bool IsBossBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss); |
| | | bool IsSitBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Dazuo); |
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID); |
| | | |
| | | if (recordPositionBool)//显示功能入口 |
| | | { |
| | | if (inDungeon || IsBossBool || IsSitBool || isNeutralMap) |
| | | { |
| | | if (IsSitBool && SitEvent != null) |
| | | { |
| | | SitEvent(false); |
| | | } |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(true); |
| | | } |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (Event_Duplicates != null && inDungeon) |
| | | { |
| | | Event_Duplicates(true, CopyOfThePanelSpeed); |
| | | } |
| | | } |
| | | if (!IsBossBool && !IsSitBool) |
| | | { |
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon) |
| | | { |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(true); |
| | | } |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (SitEvent != null) |
| | | { |
| | | SitEvent(false); |
| | | } |
| | | } |
| | | } |
| | | m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed); |
| | | m_CastSkillTip.DOLocalMoveX(m_position2_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed); |
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(0, DoFade); |
| | | m_MailObj.SetActive(false); |
| | | m_AnimationFadeOut.FadeIn(); |
| | | _MarkRay.gameObject.SetActive(true); |
| | | } |
| | | else//显示默认 |
| | | { |
| | | if (inDungeon || IsBossBool || IsSitBool || isNeutralMap) |
| | | { |
| | | if (IsSitBool && SitEvent != null) |
| | | { |
| | | SitEvent(true); |
| | | } |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(false); |
| | | } |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (Event_Duplicates != null && inDungeon) |
| | | { |
| | | Event_Duplicates(false, CopyOfThePanelSpeed); |
| | | } |
| | | } |
| | | if (!IsBossBool && !IsSitBool) |
| | | { |
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon) |
| | | { |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(true); |
| | | } |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | |
| | | if (SitEvent != null) |
| | | { |
| | | SitEvent(false); |
| | | } |
| | | } |
| | | } |
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed); |
| | | m_CastSkillTip.DOLocalMoveX(m_position1_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed); |
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, DoFade); |
| | | m_MailObj.SetActive(true); |
| | | m_AnimationFadeOut.FadeOut(); |
| | | _MarkRay.gameObject.SetActive(false); |
| | | } |
| | | recordPositionBool = !recordPositionBool; |
| | | } |
| | | |
| | | void ArticleExperience()//关于经验条 |
| | | { |
| | | int NowLv = (int)PlayerDatas.Instance.baseData.LV; |
| | | if (ConfigManager.Instance.GetTemplate<PlayerLVConfig>(NowLv) != null) |
| | | { |
| | | ulong maxValue = (ulong)PlayerLVConfig.GetExpByPlayerLv(NowLv); |
| | | ulong nowVlaue = (ulong)PlayerDatas.Instance.baseData.TotalExp + (ulong)PlayerDatas.Instance.baseData.ExpPoint * 100000000; |
| | | if (SliderOpen) |
| | | { |
| | | _ExpSlider.delay = 0; |
| | | _ExpSlider.stage = NowLv; |
| | | _ExpSlider.ResetStage(); |
| | | ExpValueFloat = ((float)nowVlaue / (float)maxValue); |
| | | _ExpSlider.value = (float)ExpValueFloat; |
| | | SliderOpen = false; |
| | | } |
| | | else |
| | | { |
| | | if (NowLv - _ExpSlider.stage >= 15) |
| | | { |
| | | _ExpSlider.delay = 0; |
| | | } |
| | | else |
| | | { |
| | | _ExpSlider.delay = _Delaytime; |
| | | } |
| | | ExpValueFloat = ((float)nowVlaue / (float)maxValue); |
| | | if (ExpValueFloat != _ExpSlider.value) |
| | | { |
| | | m_UIEffect_A.Play(); |
| | | if (m_UIEffect_A.IsPlaying) |
| | | { |
| | | if (!m_UIEffect_B.IsPlaying) |
| | | { |
| | | m_UIEffect_B.Play(); |
| | | } |
| | | } |
| | | } |
| | | _ExpSlider.stage = NowLv; |
| | | _ExpSlider.value = (float)ExpValueFloat; |
| | | } |
| | | _ExpRate.text = (float)Math.Round((double)nowVlaue / maxValue, 2, MidpointRounding.AwayFromZero) * 100 + "%"; |
| | | } |
| | | } |
| | | |
| | | void Updatefighting(PlayerDataRefresh _tCDBPlayerRefresh)//数据的刷新 |
| | | { |
| | | ArticleExperience();//关于经验条 |
| | | } |
| | | |
| | | void OnCollectBtnClick() |
| | | { |
| | | if (m_CollectNPCID != 0 && m_CollectNPCSID != 0) |
| | | { |
| | | NPCInteractProcessor.InvokeEvent(E_NpcType.Collect, m_CollectNPCID, m_CollectNPCSID); |
| | | } |
| | | } |
| | | |
| | | void OnArriveCollectNPC(uint sid, int npcID) |
| | | { |
| | | m_CollectNPCID = npcID; |
| | | m_CollectNPCSID = sid; |
| | | m_CollectBtn.gameObject.SetActive(true); |
| | | var mapId = dungeonModel.GetDungeonDataIdByMapId(PlayerDatas.Instance.baseData.MapID); |
| | | m_CollectIcon.SetSprite(mapId == 31230 ? "TY_UI_8" : "TY_UI_6"); |
| | | m_CollectIcon.SetNativeSize(); |
| | | m_CollectBtnText.text = mapId == 31230 ? Language.Get("Collect_FairyFeast") : Language.Get("Collect_Normal"); |
| | | } |
| | | |
| | | void OnLeaveCollectNpc(uint sid, int npcID) |
| | | { |
| | | if (m_CollectNPCID == npcID && m_CollectNPCSID == sid) |
| | | { |
| | | m_CollectNPCID = 0; |
| | | m_CollectNPCSID = 0; |
| | | } |
| | | m_CollectBtn.gameObject.SetActive(false); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | private bool IsDungeon() |
| | | { |
| | | var mapId = PlayerDatas.Instance.baseData.MapID; |
| | | var mapConfig = ConfigManager.Instance.GetTemplate<MapConfig>(mapId); |
| | | return mapConfig != null && mapConfig.MapFBType != 0; |
| | | } |
| | | |
| | | private void UnFlodFunctionArea(bool _unflod, int _skillGroup) |
| | | { |
| | | if (_unflod) |
| | | { |
| | | if (Vector3.Distance(m_CastSkillTip.localPosition, m_position1_S.localPosition) <= 1) |
| | | { |
| | | m_AnimationFadeOut.ImmediatelyAppear(); |
| | | m_CastSkillTip.localPosition = m_position2_S.localPosition; |
| | | m_MailObj.SetActive(false); |
| | | m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed); |
| | | recordPositionBool = false; |
| | | _MarkRay.gameObject.SetActive(true); |
| | | } |
| | | |
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) > 5) |
| | | { |
| | | TaskSwithButton(); |
| | | onMainModel.IsBossAreaTask = false; |
| | | } |
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2) |
| | | { |
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed); |
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed); |
| | | m_BossBriefInfos.Unfold(false); |
| | | if (IsCopyOfThePanel != null) |
| | | { |
| | | IsCopyOfThePanel(true); |
| | | } |
| | | } |
| | | m_HighSettingTip.ShowButtonNow(); |
| | | } |
| | | else |
| | | { |
| | | if (Vector3.Distance(m_CastSkillTip.localPosition, m_position2_S.localPosition) <= 1) |
| | | { |
| | | m_AnimationFadeOut.FadeAtOnce(); |
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition; |
| | | m_MailObj.SetActive(true); |
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0); |
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed); |
| | | recordPositionBool = true; |
| | | _MarkRay.gameObject.SetActive(false); |
| | | } |
| | | m_HighSettingTip.ShowButtonNow(); |
| | | // m_HighSettingTip.ColseButtonNow(); |
| | | |
| | | if (_skillGroup != 0) |
| | | { |
| | | m_SkillContainer.skillTurnplate.SwitchGroup(_skillGroup); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void HandleAchievement() |
| | | { |
| | | if (AchievementGoto.achievementType == AchievementGoto.ExcuteSkill) |
| | | { |
| | | if (m_AnimationFadeOut.GetIsFadeIn()) |
| | | { |
| | | m_AnimationFadeOut.FadeAtOnce(); |
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition; |
| | | m_MailObj.SetActive(true); |
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0); |
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed); |
| | | recordPositionBool = true; |
| | | _MarkRay.gameObject.SetActive(false); |
| | | } |
| | | var _cfg = ConfigManager.Instance.GetTemplate<SuccessConfig>(AchievementGoto.guideAchievementId); |
| | | var _skillId = ModelCenter.Instance.GetModel<AchievementModel>().FindSkillByJob(_cfg.Condition, PlayerDatas.Instance.baseData.Job); |
| | | if (_skillId != 0) |
| | | { |
| | | if (ModelCenter.Instance.GetModel<SkillModel>().GetXpSkillID() != _skillId) |
| | | { |
| | | return; |
| | | } |
| | | if (PlayerDatas.Instance.hero.SkillMgr.Get(_skillId).cd > 0) |
| | | { |
| | | MessageWin.Inst.ShowFixedTip(Language.Get("SkillCooling_Z")); |
| | | } |
| | | else |
| | | { |
| | | var _effect = AchievementGuideEffectPool.Require(3); |
| | | _effect.transform.SetParentEx(m_IsShowXp.transform, Vector3.zero, Vector3.zero, Vector3.one); |
| | | } |
| | | AchievementGoto.achievementType = 0; |
| | | } |
| | | else |
| | | { |
| | | AchievementGoto.achievementType = 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CheckChatTipOpen() |
| | | { |
| | | bool _chatWinOpen = WindowCenter.Instance.CheckOpen<ChatWin>(); |
| | | m_ChatTip.gameObject.SetActive(!_chatWinOpen); |
| | | if (!_chatWinOpen) |
| | | { |
| | | m_ChatTip.CheckRealmSfx(); |
| | | } |
| | | } |
| | | |
| | | private void WindowAfterEvent(Window _win) |
| | | { |
| | | if (_win is ChatWin) |
| | | { |
| | | CheckChatTipOpen(); |
| | | } |
| | | } |
| | | |
| | | public void IsShowButtonGroup() |
| | | { |
| | | if (Vector3.Distance(m_CastSkillTip.localPosition, m_position1_S.localPosition) <= 1) |
| | | { |
| | | m_AnimationFadeOut.ImmediatelyAppear(); |
| | | m_CastSkillTip.localPosition = m_position2_S.localPosition; |
| | | m_MailObj.SetActive(false); |
| | | m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed); |
| | | recordPositionBool = false; |
| | | _MarkRay.gameObject.SetActive(true); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Saturday, October 14, 2017
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using DG.Tweening;
|
| | | using System;
|
| | | using TableConfig;
|
| | | using System.Collections;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class MainInterfaceWin : Window
|
| | | {
|
| | | [SerializeField] InGamePushContainer m_InGamePusher;
|
| | | [SerializeField] SkillContainer m_SkillContainer;
|
| | | [SerializeField] HeadPortraitTip m_HeadPortraitTip;
|
| | | [SerializeField] LowSettingTip m_LowSettingTip;
|
| | | [SerializeField] ChatFrame m_ChatTip;
|
| | | [SerializeField] HighSettingTip m_HighSettingTip;
|
| | | [SerializeField] TaskListTip m_TaskListTip;//任务
|
| | | [SerializeField] TopRightTip m_TopRightTip;
|
| | |
|
| | | [SerializeField] Button friendQuestBtn;
|
| | | [SerializeField] Button fairyRequestBtn;
|
| | | [SerializeField] FunctionForecastTip m_FunctionForecastTip;//功能预告
|
| | | [SerializeField] IsShowXpButton m_IsShowXp;//XP 技能常显 |
| | | // [SerializeField] XpSkill m_XpSkill;
|
| | | [SerializeField] SkillButtonEffects m_SkillButtonEffects;
|
| | |
|
| | | [Header("副本面板移动速度")]
|
| | | public float CopyOfThePanelSpeed = 1f;//副本面板移动速度
|
| | | [SerializeField] Transform CopyOfThePanel;
|
| | | [SerializeField] Transform m_ContainerBossList;
|
| | | [SerializeField] DungeonBossBriefInfoContainer m_BossBriefInfos;
|
| | | [SerializeField] Transform CopyOfThePosition1;
|
| | | [SerializeField] Transform CopyOfThePosition2;
|
| | |
|
| | | [SerializeField] IntensifySmoothSlider _ExpSlider;//经验条
|
| | | [SerializeField] Button _DownButton;//查看经验数值
|
| | | [SerializeField] Text _ExpRate;//数值
|
| | | [SerializeField] UIEffect m_UIEffect_A;//经验特效
|
| | | [SerializeField] UIEffect m_UIEffect_B;//经验特效
|
| | | private float ExpValueFloat = 0;
|
| | | private bool SliderOpen = true;
|
| | | public float _Delaytime = 0.1f;//延迟时间
|
| | |
|
| | |
|
| | | [Header("任务面板的移动速度")]
|
| | | public float Speed = 0.2f;
|
| | | [Header("技能面板和按钮面板的移动速度")]
|
| | | public float SwitchSkillTipAndButtonTipSpeed = 0.2f;
|
| | | public float DoFade = 0.2f;
|
| | | [SerializeField] Transform m_LowSettingTipGroup;//按钮面板
|
| | | [SerializeField] Transform m_CastSkillTip;//技能面板
|
| | | [SerializeField] Transform m_position1_S;
|
| | | [SerializeField] Transform m_position2_S;
|
| | | public static bool recordPositionBool = true;
|
| | |
|
| | | [Header("策划要的角度")]
|
| | | public Vector3 Vec3 = new Vector3(0f, 0f, 225f);
|
| | | [SerializeField] Transform m_ImageRotation;//切换滚动
|
| | |
|
| | | [SerializeField] GameObject m_TaskAndTeamTip;
|
| | | [SerializeField] GameObject LeftImage;
|
| | | [SerializeField] GameObject RightImg;
|
| | | [SerializeField] Transform m_TaskAndTeamPanel;
|
| | | [SerializeField] Transform TaskListTipAnchor1;
|
| | | [SerializeField] Transform TaskListTipAnchor2;
|
| | |
|
| | | [SerializeField] Button m_TaskSwithButton;//关于功能预告
|
| | | [SerializeField] Transform FunctionForecastPanel;
|
| | | [SerializeField] Transform unctionForecastPosition1;
|
| | | [SerializeField] Transform unctionForecastPosition2;
|
| | |
|
| | | [SerializeField] Button m_CollectBtn;
|
| | | [SerializeField] Image m_CollectIcon;
|
| | | [SerializeField] Text m_CollectBtnText;
|
| | | [SerializeField] Button m_RedBag;//红包入口按钮
|
| | | [SerializeField] UIEffect m_RedpackGetSfx;
|
| | | [SerializeField] Button m_SendRedbagBtn;
|
| | |
|
| | | [SerializeField] Transform m_EffectTask;//任务完成特效播放位置
|
| | | private int m_CollectNPCID;
|
| | | private uint m_CollectNPCSID;
|
| | | private bool TaskSwithBool = true;
|
| | |
|
| | | [SerializeField] Button _SwitchShowBtn;//切换按钮
|
| | | [SerializeField] AnimationFadeOut m_AnimationFadeOut;
|
| | |
|
| | | [SerializeField] GameObject m_MailObj;//邮件显隐
|
| | |
|
| | | [SerializeField] ClickScreenOtherSpace _MarkRay;//便捷切换按钮
|
| | |
|
| | | [SerializeField] TeamInvitationEntrance m_TeamInvitationEntrance;
|
| | | #region
|
| | | private float switcherTime = 0;//主界面自动切换时间
|
| | | private int mapId = 0;
|
| | | public delegate void OnChatCallback();//聊天回调
|
| | | public static event OnChatCallback Event_ChatCallback;
|
| | | public delegate void OnDuplicates(bool _bool, float _speed);
|
| | | public static event OnDuplicates Event_Duplicates;
|
| | | public static event Action<bool> SitEvent;//关于打坐的回调
|
| | | #endregion
|
| | | private List<int> ListBossMapId = new List<int>();//用于boss区域地图id
|
| | |
|
| | | public static event Action<bool> IsCopyOfThePanel;
|
| | | public static event Action IsOpenMaininterface;
|
| | | public static bool CopyOfThePositionBool = true;
|
| | |
|
| | | RealmModel m_RealmModel;
|
| | | RealmModel realmModel { get { return m_RealmModel ?? (m_RealmModel = ModelCenter.Instance.GetModel<RealmModel>()); } }
|
| | | FairyModel m_FairyModel;
|
| | | FairyModel fairyModel { get { return m_FairyModel ?? (m_FairyModel = ModelCenter.Instance.GetModel<FairyModel>()); } }
|
| | | FriendsModel _friendsModel;
|
| | | FriendsModel friendsModel { get { return _friendsModel ?? (_friendsModel = ModelCenter.Instance.GetModel<FriendsModel>()); } }
|
| | | PlayerMountDatas m_HorseModel;
|
| | | PlayerMountDatas horsemodel { get { return m_HorseModel ?? (m_HorseModel = ModelCenter.Instance.GetModel<PlayerMountDatas>()); } }
|
| | | PlayerMainDate m_MainModel;
|
| | | PlayerMainDate onMainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } }
|
| | | PlayerTaskDatas m_PlayerTask;
|
| | | PlayerTaskDatas onPlayerTask { get { return m_PlayerTask ?? (m_PlayerTask = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } }
|
| | | PlayerRedPacketDatas m_RedPacket;
|
| | | PlayerRedPacketDatas redPacket { get { return m_RedPacket ?? (m_RedPacket = ModelCenter.Instance.GetModel<PlayerRedPacketDatas>()); } }
|
| | | PlayerBuffDatas m_BuffModel;
|
| | | PlayerBuffDatas Buffmodel { get { return m_BuffModel ?? (m_BuffModel = ModelCenter.Instance.GetModel<PlayerBuffDatas>()); } }
|
| | | PKModel m_PKModel;
|
| | | PKModel pKModel { get { return m_PKModel ?? (m_PKModel = ModelCenter.Instance.GetModel<PKModel>()); } }
|
| | | OSRedEnvelopeModel OSEnvelopeModel { get { return ModelCenter.Instance.GetModel<OSRedEnvelopeModel>(); } }
|
| | | RuneTowerModel runeTowerModel { get { return ModelCenter.Instance.GetModel<RuneTowerModel>(); } }
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | | DemonJarModel demonJarModel { get { return ModelCenter.Instance.GetModel<DemonJarModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | switcherTime = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("AutomaticSwitch").Numerical1);
|
| | | recordPositionBool = true;
|
| | | m_TaskAndTeamPanel.localPosition = TaskListTipAnchor1.localPosition;
|
| | | // m_LowSettingTipGroup.localPosition = m_position2_L.localPosition;
|
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition;
|
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0);
|
| | | m_MailObj.SetActive(true);
|
| | | var inst = BossShowModel.Instance;
|
| | | TaskSwithBool = true;
|
| | | FunctionForecastPanel.localPosition = unctionForecastPosition1.localPosition;
|
| | | LeftImage.SetActive(true);
|
| | | RightImg.SetActive(false);
|
| | | ListBossMapId.Clear();
|
| | | string strBoss = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("TaskRetract").Numerical1;
|
| | | string[] bossList = ConfigParse.GetMultipleStr(strBoss);//解析出数组|
|
| | | for (int i = 0; i < bossList.Length; i++)
|
| | | {
|
| | | ListBossMapId.Add(int.Parse(bossList[i]));
|
| | | }
|
| | |
|
| | | _MarkRay.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | UIEventTrigger.Get(_DownButton.gameObject).OnDown = DownButton;
|
| | | UIEventTrigger.Get(_DownButton.gameObject).OnUp = UpButton;
|
| | | _MarkRay.AddListener(MarkRayButton);
|
| | | _SwitchShowBtn.AddListener(SwitchShowButton);
|
| | | m_TaskSwithButton.AddListener(TaskSwithButton);
|
| | | fairyRequestBtn.onClick.AddListener(OnFairyRequestClick);
|
| | | m_RedBag.AddListener(RedPacketButton);
|
| | | m_SendRedbagBtn.AddListener(SendRedpacketBtn);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | if (IsOpenMaininterface != null)
|
| | | {
|
| | | IsOpenMaininterface();
|
| | | }
|
| | | SliderOpen = true;
|
| | | horseRidBool = false;
|
| | | friendsModel.askAddFriendEvent = FriendQuestBtn;
|
| | | m_InGamePusher.Init();
|
| | | m_SkillContainer.Init();
|
| | | m_FunctionForecastTip.Init();
|
| | | m_HeadPortraitTip.Init();
|
| | | m_LowSettingTip.Init();
|
| | | m_ChatTip.Init();
|
| | | m_HighSettingTip.Init();
|
| | | m_TaskListTip.Init();
|
| | | m_IsShowXp.Init();
|
| | | m_TopRightTip.Init();
|
| | | m_SkillButtonEffects.Init();
|
| | | m_AnimationFadeOut.Init();
|
| | | m_TeamInvitationEntrance.Init();
|
| | | m_BossBriefInfos.gameObject.SetActive(false);
|
| | |
|
| | | ArticleExperience();//关于经验条
|
| | | FriendQuestBtn();
|
| | | UpdateFairyRequest();
|
| | | OnRedBagGet();//关于红包入口
|
| | | CheckSendRedpackBtn();
|
| | | CheckChatTipOpen();
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;
|
| | | FunctionUnlockFlyObject.functionUnLockShowBeginEvent += UnFlodFunctionArea;
|
| | | CoroutineMgr.Instance.MaininterCDTimeEvent += OnMaininterCDTime;
|
| | | fairyModel.UpdateFairyRequestEvent += UpdateFairyRequest;
|
| | | GA_Hero.OnEnterOrExitArea += OnEnterOrExitArea;
|
| | | NewBieCenter.Instance.guideBeginEvent += OnGuideBegin;
|
| | | NewBieCenter.Instance.guideCompletedEvent += OnGuideCompleted;
|
| | | m_CollectBtn.AddListener(OnCollectBtnClick);
|
| | | GA_NpcCollect.OnArrive += OnArriveCollectNPC;
|
| | | GA_NpcCollect.OnLeave += OnLeaveCollectNpc;
|
| | | PlayerRedPacketDatas.OnRedBagGetEvent += OnRedBagGet;
|
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += WindowAfterEvent;
|
| | | OSEnvelopeModel.OSRedEnvelopeUpdateEvent += OnRedBagGet;
|
| | | OSEnvelopeModel.OSRedEnvelopeInfoEnvent += OnRedBagGet;
|
| | | PlayerTaskDatas.CompletionOfTaskEvent += CompletionOfTaskEvent;
|
| | | RedpointCenter.Instance.redpointValueChangeEvent += RedpointValueChangeEvent;
|
| | | NewBieCenter.Instance.guideBeginEvent += GuideBeginEvent;
|
| | |
|
| | | }
|
| | |
|
| | | private void CompletionOfTaskEvent(int obj)
|
| | | {
|
| | | EffectMgr.Instance.PlayUIEffect(1100, 1100, m_EffectTask, false);
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | m_HighSettingTip.OnActived();
|
| | | }
|
| | |
|
| | | IEnumerator Co_Load()
|
| | | {
|
| | | yield return null;
|
| | | WindowCenter.Instance.Open<OffLineOnHookWin>();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | bool IsSitBool = PlayerDatas.Instance.hero != null && MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Dazuo);//是否在打坐区域
|
| | | bool IsBossBool = PlayerDatas.Instance.hero != null && MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域
|
| | | if (onMainModel.IsDead || (onMainModel.IsBossAreaTask && !IsBossBool))
|
| | | {
|
| | |
|
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) > 3)
|
| | | {
|
| | | TaskSwithButton();
|
| | | }
|
| | | onMainModel.IsBossAreaTask = false;
|
| | | onMainModel.IsDead = false;
|
| | | }
|
| | | if (m_AnimationFadeOut.GetIsFadeIn())
|
| | | {
|
| | | _MarkRay.gameObject.SetActive(true);
|
| | | }
|
| | | var inDungeon = IsDungeon();
|
| | | if (inDungeon)
|
| | | {
|
| | | m_TaskAndTeamTip.SetActive(!inDungeon);
|
| | | m_FunctionForecastTip.gameObject.SetActive(false);
|
| | | if (WindowCenter.Instance.CheckOpen<FunctionForecastWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<FunctionForecastWin>();
|
| | | }
|
| | | m_TaskSwithButton.gameObject.SetActive(false);
|
| | | if (mapId != PlayerDatas.Instance.baseData.MapID)
|
| | | {
|
| | | CopyOfThePanel.localPosition = CopyOfThePosition2.localPosition;
|
| | | CopyOfThePositionBool = false;
|
| | | m_ContainerBossList.localPosition = CopyOfThePosition1.localPosition;
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (Event_Duplicates != null)
|
| | | {
|
| | | Event_Duplicates(false, CopyOfThePanelSpeed);
|
| | | }
|
| | | }
|
| | | if (m_AnimationFadeOut.GetIsFadeIn() && mapId != PlayerDatas.Instance.baseData.MapID)
|
| | | {
|
| | | m_AnimationFadeOut.FadeAtOnce();
|
| | | m_MailObj.SetActive(true);
|
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition;
|
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0);
|
| | | recordPositionBool = true;
|
| | | }
|
| | | }
|
| | | else
|
| | | { |
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if (isNeutralMap)
|
| | | {
|
| | | m_BossBriefInfos.gameObject.SetActive(true);
|
| | | m_BossBriefInfos.Display(ModelCenter.Instance.GetModel<WorldBossModel>().GetWorldBosses(PlayerDatas.Instance.baseData.MapID));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BossBriefInfos.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | if (isNeutralMap)
|
| | | {
|
| | | if (mapId != PlayerDatas.Instance.baseData.MapID)
|
| | | {
|
| | | CopyOfThePanel.localPosition = CopyOfThePosition2.localPosition;
|
| | | CopyOfThePositionBool = false;
|
| | | m_ContainerBossList.localPosition = CopyOfThePosition1.localPosition;
|
| | | m_BossBriefInfos.Unfold(false);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!IsSitBool && !IsBossBool)
|
| | | {
|
| | | CopyOfThePanel.localPosition = CopyOfThePosition1.localPosition;
|
| | | CopyOfThePositionBool = true;
|
| | | m_ContainerBossList.localPosition = CopyOfThePosition2.localPosition;
|
| | | m_BossBriefInfos.Unfold(false);
|
| | | }
|
| | | }
|
| | |
|
| | | if (Event_Duplicates != null && (inDungeon || isNeutralMap))
|
| | | {
|
| | | Event_Duplicates(true, CopyOfThePanelSpeed);
|
| | | }
|
| | |
|
| | | m_TaskAndTeamTip.SetActive(true);
|
| | | m_FunctionForecastTip.gameObject.SetActive(true);
|
| | | m_TaskSwithButton.gameObject.SetActive(true);
|
| | | }
|
| | | mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | m_HighSettingTip.AfterOpen();
|
| | | m_ChatTip.OnAfterOpen();
|
| | | HandleAchievement();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_IsShowXp.Unit();
|
| | | m_InGamePusher.UnInit();
|
| | | m_SkillContainer.UnInit();
|
| | | m_HeadPortraitTip.UnInit();
|
| | | m_LowSettingTip.UnInit();
|
| | | m_ChatTip.UnInit();
|
| | | m_HighSettingTip.UnInit();
|
| | | m_TaskListTip.UnInit();
|
| | | m_TopRightTip.UnInit();
|
| | | m_SkillButtonEffects.UnInit();
|
| | | m_FunctionForecastTip.Unit();
|
| | | m_AnimationFadeOut.Unit();
|
| | | m_TeamInvitationEntrance.UnInit();
|
| | | horseRidBool = false;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;
|
| | | FunctionUnlockFlyObject.functionUnLockShowBeginEvent -= UnFlodFunctionArea;
|
| | | CoroutineMgr.Instance.MaininterCDTimeEvent -= OnMaininterCDTime;
|
| | | fairyModel.UpdateFairyRequestEvent -= UpdateFairyRequest;
|
| | | GA_Hero.OnEnterOrExitArea -= OnEnterOrExitArea;
|
| | | NewBieCenter.Instance.guideBeginEvent -= OnGuideBegin;
|
| | | NewBieCenter.Instance.guideCompletedEvent -= OnGuideCompleted;
|
| | | PlayerRedPacketDatas.OnRedBagGetEvent -= OnRedBagGet;
|
| | | WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterEvent;
|
| | | OSEnvelopeModel.OSRedEnvelopeUpdateEvent -= OnRedBagGet;
|
| | | OSEnvelopeModel.OSRedEnvelopeInfoEnvent -= OnRedBagGet;
|
| | | PlayerTaskDatas.CompletionOfTaskEvent -= CompletionOfTaskEvent;
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
|
| | | NewBieCenter.Instance.guideBeginEvent -= GuideBeginEvent;
|
| | | if (WindowCenter.Instance.CheckOpen<FunctionForecastWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<FunctionForecastWin>();
|
| | | }
|
| | | m_CollectBtn.RemoveAllListeners();
|
| | | GA_NpcCollect.OnArrive -= OnArriveCollectNPC;
|
| | | GA_NpcCollect.OnLeave -= OnLeaveCollectNpc;
|
| | | m_CollectBtn.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | private void GuideBeginEvent()
|
| | | {
|
| | | if (NewBieCenter.Instance.inGuiding
|
| | | && (NewBieCenter.Instance.currentGuide == 89
|
| | | || NewBieCenter.Instance.currentGuide == TrialDungeonModel.TRIALEXCHANGE_GUIDE))
|
| | | {
|
| | | UnFlodFunctionArea(true, 0);
|
| | | }
|
| | | }
|
| | |
|
| | | private void RedpointValueChangeEvent(int _id)
|
| | | {
|
| | | if (_id == OSEnvelopeModel.m_RedAchieveRedpoint.id)
|
| | | {
|
| | | CheckSendRedpackBtn();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnRedBagGet()//判断是否开启红包入口
|
| | | {
|
| | | if (m_RedpackGetSfx.IsPlaying)
|
| | | {
|
| | | m_RedpackGetSfx.StopImediatly();
|
| | | }
|
| | | if (OSEnvelopeModel.CanGetEnvelope())
|
| | | {
|
| | | m_RedBag.gameObject.SetActive(true);
|
| | | if (!m_RedpackGetSfx.IsPlaying)
|
| | | {
|
| | | m_RedpackGetSfx.Play();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (redPacket.IsRedBagGetBool)
|
| | | {
|
| | | m_RedBag.gameObject.SetActive(true);
|
| | | if (!m_RedpackGetSfx.IsPlaying)
|
| | | {
|
| | | m_RedpackGetSfx.Play();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RedBag.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | CheckSendRedpackBtn();
|
| | | }
|
| | |
|
| | | private void CheckSendRedpackBtn()
|
| | | {
|
| | | m_SendRedbagBtn.gameObject.SetActive(!m_RedBag.gameObject.activeSelf && OSEnvelopeModel.m_RedAchieveRedpoint.state == RedPointState.Simple);
|
| | | }
|
| | |
|
| | | private void OnGuideBegin()//引导开始
|
| | | {
|
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) > 5)
|
| | | {
|
| | | TaskSwithButton();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnGuideCompleted(int obj)//引导结束
|
| | | {
|
| | | if (m_AnimationFadeOut.GetIsFadeIn())
|
| | | {
|
| | | _MarkRay.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnEnterOrExitArea(MapArea.E_Type _areaType, bool _enter)
|
| | | {
|
| | | // DesignDebug.LogError(_areaType + ".." + _enter);
|
| | | if (PlayerDatas.Instance.baseData.MapID == 10040 && _areaType != MapArea.E_Type.Boss && _enter)
|
| | | {
|
| | | if (Buffmodel.PkType != onMainModel.AreaState)
|
| | | {
|
| | | DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)onMainModel.AreaState);
|
| | | }
|
| | | }
|
| | |
|
| | | if (_areaType == MapArea.E_Type.Neutral && _enter)
|
| | | {
|
| | | WindowCenter.Instance.Open<NeutralMarkWin>();
|
| | | int mapID = PlayerDatas.Instance.baseData.MapID;
|
| | | var config = ConfigManager.Instance.GetTemplate<MapConfig>(mapID);
|
| | | int[] atkInt = pKModel.GetArea(config.AtkType).ToArray();
|
| | | if (atkInt.Length > 1 && Buffmodel.PkType != 5)
|
| | | {
|
| | | onMainModel.AreaState = Buffmodel.PkType;
|
| | | DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)5);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | if (_areaType == MapArea.E_Type.Neutral && !_enter)
|
| | | {
|
| | | if (Buffmodel.PkType != onMainModel.AreaState)
|
| | | {
|
| | | DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)onMainModel.AreaState);
|
| | | }
|
| | | }
|
| | |
|
| | | if ((_areaType == MapArea.E_Type.Boss && _enter) || (_areaType == MapArea.E_Type.Dazuo && _enter))
|
| | | {
|
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) < 2 && ListBossMapId.Contains(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | TaskSwithButton();
|
| | | onMainModel.IsBossAreaTask = true;
|
| | | }
|
| | | if (_areaType == MapArea.E_Type.Dazuo && _enter && SitEvent != null)
|
| | | {
|
| | | SitEvent(true);
|
| | | }
|
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) < 5)
|
| | | {
|
| | | if (NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | return;
|
| | | }
|
| | | recordPositionBool = false;
|
| | | SwitchShowButton();
|
| | | }
|
| | | }
|
| | | if ((_areaType == MapArea.E_Type.Boss && !_enter) || (_areaType != MapArea.E_Type.Normal && (_areaType != MapArea.E_Type.Boss && _enter)))
|
| | | {
|
| | | if (onMainModel.IsBossAreaTask)
|
| | | {
|
| | | TaskSwithButton();
|
| | | onMainModel.IsBossAreaTask = false;
|
| | | }
|
| | | }
|
| | | var inDungeon = IsDungeon();
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if ((_areaType == MapArea.E_Type.Boss && !_enter) || (_areaType == MapArea.E_Type.Dazuo && !_enter))
|
| | | {
|
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon && !isNeutralMap)
|
| | | {
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(true);
|
| | | }
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (SitEvent != null)
|
| | | {
|
| | | SitEvent(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnMaininterCDTime()
|
| | | {
|
| | | MarkRayButton();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | private Vector2 startPosition;
|
| | | private Vector2 endPosition;
|
| | | private bool horseRidBool = false;
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | if (PlayerDatas.Instance.hero != null
|
| | | && PlayerDatas.Instance.hero.State == E_ActorState.AutoRun
|
| | | && onMainModel.MoveBool)
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen("PathfindingIconWin"))
|
| | | {
|
| | | WindowCenter.Instance.Open<PathfindingIconWin>(true);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | onMainModel.MoveBool = false;
|
| | | if (WindowCenter.Instance.CheckOpen("PathfindingIconWin"))
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<PathfindingIconWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | if (runeTowerModel.newPassFloor > 0 && !IsDungeon())
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen("NewBieWin") && !WindowCenter.Instance.CheckOpen("TreasureNewGotWin"))
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen("RuneNewGotWin"))
|
| | | {
|
| | | WindowCenter.Instance.Open<RuneNewGotWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | public void FriendQuestBtn()
|
| | | {
|
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Friend))
|
| | | {
|
| | | friendQuestBtn.onClick.RemoveAllListeners();
|
| | | if (friendsModel.GetFriendQuestDict().Count > 0)
|
| | | {
|
| | | friendQuestBtn.gameObject.SetActive(true);
|
| | | friendQuestBtn.onClick.AddListener(OnClickFriendQuest);
|
| | | }
|
| | | else
|
| | | {
|
| | | friendQuestBtn.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | friendQuestBtn.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFairyRequestClick()
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyInviteWin>();
|
| | | }
|
| | | private void RedPacketButton()//关于红包的功能 入口
|
| | | {
|
| | | RedEnvelopeModel envelopeModel = ModelCenter.Instance.GetModel<RedEnvelopeModel>();
|
| | | RedEnvelopeModel.RedEnvelope _envelope;
|
| | | if (envelopeModel.TryGetLatestEnvelope(out _envelope))
|
| | | {
|
| | | if (OSEnvelopeModel.m_OpenServerGetRedpin.state == RedPointState.GetReward)
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>();
|
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().JumpType = 2;
|
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().autoOpen = true;
|
| | | WindowCenter.Instance.Open<OpenServerActivityWin>(false, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RedPacket);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void SendRedpacketBtn()
|
| | | {
|
| | | if (OSEnvelopeModel.m_RedAchieveRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>();
|
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().JumpType = 1;
|
| | | WindowCenter.Instance.Open<OpenServerActivityWin>(false, 2);
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateFairyRequest()
|
| | | {
|
| | | fairyRequestBtn.gameObject.SetActive(fairyModel.FairyRequestRedPoint.count > 0);
|
| | | }
|
| | |
|
| | | private void OnClickFriendQuest()
|
| | | {
|
| | | WindowCenter.Instance.Open<FriendQuestWin>();
|
| | | }
|
| | |
|
| | | public void MarkRayButton()
|
| | | {
|
| | | if (NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var _treasureModel = ModelCenter.Instance.GetModel<TreasureModel>();
|
| | | if (_treasureModel.treasureStageUpShow || _treasureModel.newGotShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var inDungeon = IsDungeon();
|
| | |
|
| | | bool IsBossBool = PlayerDatas.Instance.hero == null ? false : MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域
|
| | | bool IsSitBool = PlayerDatas.Instance.hero == null ? false : MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Dazuo);//是否在打坐区域
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if (!recordPositionBool)
|
| | | {
|
| | | if (inDungeon || IsBossBool || IsSitBool || isNeutralMap)
|
| | | {
|
| | | if (IsSitBool && SitEvent != null)
|
| | | {
|
| | | SitEvent(true);
|
| | | }
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(false);
|
| | | }
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (Event_Duplicates != null && inDungeon)
|
| | | {
|
| | | Event_Duplicates(false, CopyOfThePanelSpeed);
|
| | | }
|
| | |
|
| | | }
|
| | | if (!IsBossBool && !IsSitBool)
|
| | | {
|
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon)
|
| | | {
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(true);
|
| | | }
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (SitEvent != null)
|
| | | {
|
| | | SitEvent(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
|
| | | m_CastSkillTip.DOLocalMoveX(m_position1_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed);
|
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, DoFade);
|
| | | m_MailObj.SetActive(true);
|
| | | m_AnimationFadeOut.FadeOut();
|
| | | recordPositionBool = true;
|
| | | }
|
| | | }
|
| | | void DownButton(GameObject go)
|
| | | {
|
| | | _ExpRate.gameObject.SetActive(true);
|
| | |
|
| | | }
|
| | | void UpButton(GameObject go)
|
| | | {
|
| | | _ExpRate.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | void TaskSwithButton()
|
| | | {
|
| | | if (onMainModel.IsBossAreaTask)
|
| | | {
|
| | | onMainModel.IsBossAreaTask = false;
|
| | | }
|
| | | if (TaskSwithBool)//隐藏
|
| | | {
|
| | | m_TaskAndTeamPanel.DOLocalMoveX(TaskListTipAnchor2.localPosition.x, Speed);
|
| | | if (m_FunctionForecastTip.gameObject.activeSelf)
|
| | | {
|
| | | FunctionForecastPanel.DOLocalMoveX(unctionForecastPosition2.localPosition.x, Speed);
|
| | |
|
| | | }
|
| | | LeftImage.SetActive(false);
|
| | | RightImg.SetActive(true);
|
| | | if (WindowCenter.Instance.CheckOpen<FunctionForecastWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<FunctionForecastWin>();
|
| | | }
|
| | | }
|
| | | else//显示
|
| | | {
|
| | | m_TaskAndTeamPanel.DOLocalMoveX(TaskListTipAnchor1.localPosition.x, Speed);
|
| | | if (m_FunctionForecastTip.gameObject.activeSelf)
|
| | | {
|
| | | FunctionForecastPanel.DOLocalMoveX(unctionForecastPosition1.localPosition.x, Speed);
|
| | | }
|
| | | LeftImage.SetActive(true);
|
| | | RightImg.SetActive(false);
|
| | | }
|
| | | TaskSwithBool = !TaskSwithBool;
|
| | | }
|
| | |
|
| | | void SwitchShowButton()
|
| | | {
|
| | | var inDungeon = IsDungeon();
|
| | | bool IsBossBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);
|
| | | bool IsSitBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Dazuo);
|
| | | var isNeutralMap = GeneralConfig.Instance.neutralMaps.Contains(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | if (recordPositionBool)//显示功能入口
|
| | | {
|
| | | if (inDungeon || IsBossBool || IsSitBool || isNeutralMap)
|
| | | {
|
| | | if (IsSitBool && SitEvent != null)
|
| | | {
|
| | | SitEvent(false);
|
| | | }
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(true);
|
| | | }
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (Event_Duplicates != null && inDungeon)
|
| | | {
|
| | | Event_Duplicates(true, CopyOfThePanelSpeed);
|
| | | }
|
| | | }
|
| | | if (!IsBossBool && !IsSitBool)
|
| | | {
|
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon)
|
| | | {
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(true);
|
| | | }
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (SitEvent != null)
|
| | | {
|
| | | SitEvent(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed);
|
| | | m_CastSkillTip.DOLocalMoveX(m_position2_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed);
|
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(0, DoFade);
|
| | | m_MailObj.SetActive(false);
|
| | | m_AnimationFadeOut.FadeIn();
|
| | | _MarkRay.gameObject.SetActive(true);
|
| | | }
|
| | | else//显示默认
|
| | | {
|
| | | if (inDungeon || IsBossBool || IsSitBool || isNeutralMap)
|
| | | {
|
| | | if (IsSitBool && SitEvent != null)
|
| | | {
|
| | | SitEvent(true);
|
| | | }
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(false);
|
| | | }
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (Event_Duplicates != null && inDungeon)
|
| | | {
|
| | | Event_Duplicates(false, CopyOfThePanelSpeed);
|
| | | }
|
| | | }
|
| | | if (!IsBossBool && !IsSitBool)
|
| | | {
|
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2 && !inDungeon)
|
| | | {
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(true);
|
| | | }
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | |
|
| | | if (SitEvent != null)
|
| | | {
|
| | | SitEvent(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
|
| | | m_CastSkillTip.DOLocalMoveX(m_position1_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed);
|
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, DoFade);
|
| | | m_MailObj.SetActive(true);
|
| | | m_AnimationFadeOut.FadeOut();
|
| | | _MarkRay.gameObject.SetActive(false);
|
| | | }
|
| | | recordPositionBool = !recordPositionBool;
|
| | | }
|
| | |
|
| | | void ArticleExperience()//关于经验条
|
| | | {
|
| | | int NowLv = (int)PlayerDatas.Instance.baseData.LV;
|
| | | if (ConfigManager.Instance.GetTemplate<PlayerLVConfig>(NowLv) != null)
|
| | | {
|
| | | ulong maxValue = (ulong)PlayerLVConfig.GetExpByPlayerLv(NowLv);
|
| | | ulong nowVlaue = (ulong)PlayerDatas.Instance.baseData.TotalExp + (ulong)PlayerDatas.Instance.baseData.ExpPoint * 100000000;
|
| | | if (SliderOpen)
|
| | | {
|
| | | _ExpSlider.delay = 0;
|
| | | _ExpSlider.stage = NowLv;
|
| | | _ExpSlider.ResetStage();
|
| | | ExpValueFloat = ((float)nowVlaue / (float)maxValue);
|
| | | _ExpSlider.value = (float)ExpValueFloat;
|
| | | SliderOpen = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (NowLv - _ExpSlider.stage >= 15)
|
| | | {
|
| | | _ExpSlider.delay = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | _ExpSlider.delay = _Delaytime;
|
| | | }
|
| | | ExpValueFloat = ((float)nowVlaue / (float)maxValue);
|
| | | if (ExpValueFloat != _ExpSlider.value)
|
| | | {
|
| | | m_UIEffect_A.Play();
|
| | | if (m_UIEffect_A.IsPlaying)
|
| | | {
|
| | | if (!m_UIEffect_B.IsPlaying)
|
| | | {
|
| | | m_UIEffect_B.Play();
|
| | | }
|
| | | }
|
| | | }
|
| | | _ExpSlider.stage = NowLv;
|
| | | _ExpSlider.value = (float)ExpValueFloat;
|
| | | }
|
| | | _ExpRate.text = (float)Math.Round((double)nowVlaue / maxValue, 2, MidpointRounding.AwayFromZero) * 100 + "%";
|
| | | }
|
| | | }
|
| | |
|
| | | void Updatefighting(PlayerDataRefresh _tCDBPlayerRefresh)//数据的刷新
|
| | | {
|
| | | ArticleExperience();//关于经验条
|
| | | }
|
| | |
|
| | | void OnCollectBtnClick()
|
| | | {
|
| | | if (m_CollectNPCID != 0 && m_CollectNPCSID != 0)
|
| | | {
|
| | | NPCInteractProcessor.InvokeEvent(E_NpcType.Collect, m_CollectNPCID, m_CollectNPCSID);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnArriveCollectNPC(uint sid, int npcID)
|
| | | {
|
| | | m_CollectNPCID = npcID;
|
| | | m_CollectNPCSID = sid;
|
| | | m_CollectBtn.gameObject.SetActive(true);
|
| | | var mapId = dungeonModel.GetDungeonDataIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | m_CollectIcon.SetSprite(mapId == 31230 ? "TY_UI_8" : "TY_UI_6");
|
| | | m_CollectIcon.SetNativeSize();
|
| | | m_CollectBtnText.text = mapId == 31230 ? Language.Get("Collect_FairyFeast") : Language.Get("Collect_Normal");
|
| | | }
|
| | |
|
| | | void OnLeaveCollectNpc(uint sid, int npcID)
|
| | | {
|
| | | if (m_CollectNPCID == npcID && m_CollectNPCSID == sid)
|
| | | {
|
| | | m_CollectNPCID = 0;
|
| | | m_CollectNPCSID = 0;
|
| | | }
|
| | | m_CollectBtn.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | private bool IsDungeon()
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = ConfigManager.Instance.GetTemplate<MapConfig>(mapId);
|
| | | return mapConfig != null && mapConfig.MapFBType != 0;
|
| | | }
|
| | |
|
| | | private void UnFlodFunctionArea(bool _unflod, int _skillGroup)
|
| | | {
|
| | | if (_unflod)
|
| | | {
|
| | | if (Vector3.Distance(m_CastSkillTip.localPosition, m_position1_S.localPosition) <= 1)
|
| | | {
|
| | | m_AnimationFadeOut.ImmediatelyAppear();
|
| | | m_CastSkillTip.localPosition = m_position2_S.localPosition;
|
| | | m_MailObj.SetActive(false);
|
| | | m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed);
|
| | | recordPositionBool = false;
|
| | | _MarkRay.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (Vector3.Distance(m_TaskAndTeamPanel.localPosition, TaskListTipAnchor1.localPosition) > 5)
|
| | | {
|
| | | TaskSwithButton();
|
| | | onMainModel.IsBossAreaTask = false;
|
| | | }
|
| | | if (Vector3.Distance(CopyOfThePanel.position, CopyOfThePosition1.position) > 2)
|
| | | {
|
| | | CopyOfThePanel.DOLocalMoveY(CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_ContainerBossList.DOLocalMoveY(CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
|
| | | m_BossBriefInfos.Unfold(false);
|
| | | if (IsCopyOfThePanel != null)
|
| | | {
|
| | | IsCopyOfThePanel(true);
|
| | | }
|
| | | }
|
| | | m_HighSettingTip.ShowButtonNow();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (Vector3.Distance(m_CastSkillTip.localPosition, m_position2_S.localPosition) <= 1)
|
| | | {
|
| | | m_AnimationFadeOut.FadeAtOnce();
|
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition;
|
| | | m_MailObj.SetActive(true);
|
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0);
|
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
|
| | | recordPositionBool = true;
|
| | | _MarkRay.gameObject.SetActive(false);
|
| | | }
|
| | | m_HighSettingTip.ShowButtonNow();
|
| | | // m_HighSettingTip.ColseButtonNow();
|
| | |
|
| | | if (_skillGroup != 0)
|
| | | {
|
| | | m_SkillContainer.skillTurnplate.SwitchGroup(_skillGroup);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void HandleAchievement()
|
| | | {
|
| | | if (AchievementGoto.achievementType == AchievementGoto.ExcuteSkill)
|
| | | {
|
| | | if (m_AnimationFadeOut.GetIsFadeIn())
|
| | | {
|
| | | m_AnimationFadeOut.FadeAtOnce();
|
| | | m_CastSkillTip.localPosition = m_position1_S.localPosition;
|
| | | m_MailObj.SetActive(true);
|
| | | m_CastSkillTip.GetComponent<CanvasGroup>().DOFade(1, 0);
|
| | | m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
|
| | | recordPositionBool = true;
|
| | | _MarkRay.gameObject.SetActive(false);
|
| | | }
|
| | | var _cfg = ConfigManager.Instance.GetTemplate<SuccessConfig>(AchievementGoto.guideAchievementId);
|
| | | var _skillId = ModelCenter.Instance.GetModel<AchievementModel>().FindSkillByJob(_cfg.Condition, PlayerDatas.Instance.baseData.Job);
|
| | | if (_skillId != 0)
|
| | | {
|
| | | if (ModelCenter.Instance.GetModel<SkillModel>().GetXpSkillID() != _skillId)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.hero.SkillMgr.Get(_skillId).cd > 0)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("SkillCooling_Z"));
|
| | | }
|
| | | else
|
| | | {
|
| | | var _effect = AchievementGuideEffectPool.Require(3);
|
| | | _effect.transform.SetParentEx(m_IsShowXp.transform, Vector3.zero, Vector3.zero, Vector3.one);
|
| | | }
|
| | | AchievementGoto.achievementType = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | AchievementGoto.achievementType = 0;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void CheckChatTipOpen()
|
| | | {
|
| | | bool _chatWinOpen = WindowCenter.Instance.CheckOpen<ChatWin>();
|
| | | m_ChatTip.gameObject.SetActive(!_chatWinOpen);
|
| | | if (!_chatWinOpen)
|
| | | {
|
| | | m_ChatTip.CheckRealmSfx();
|
| | | }
|
| | | }
|
| | |
|
| | | private void WindowAfterEvent(Window _win)
|
| | | {
|
| | | if (_win is ChatWin)
|
| | | {
|
| | | CheckChatTipOpen();
|
| | | }
|
| | | }
|
| | |
|
| | | public void IsShowButtonGroup()
|
| | | {
|
| | | if (Vector3.Distance(m_CastSkillTip.localPosition, m_position1_S.localPosition) <= 1)
|
| | | {
|
| | | m_AnimationFadeOut.ImmediatelyAppear();
|
| | | m_CastSkillTip.localPosition = m_position2_S.localPosition;
|
| | | m_MailObj.SetActive(false);
|
| | | m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed);
|
| | | recordPositionBool = false;
|
| | | _MarkRay.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|