private ParticleSystem GetSmallEffect()
 {
     Transform transform = base.view.transform.Find("ItemPanel/Effects/Small/" + this._effectIndex);
     transform.gameObject.SetActive(true);
     if (this._effectIndex == (this._materialList.Count - 1))
     {
         transform.localPosition = this._effectPosition[this._effectPosition.Count - 1];
     }
     else
     {
         transform.localPosition = this._effectPosition[this._effectIndex];
     }
     this._effectIndex++;
     foreach (ParticleSystem system in transform.GetComponentsInChildren<ParticleSystem>())
     {
         system.Play();
     }
     if (this._flashStartTimer != null)
     {
         this._flashStartTimer.Destroy();
     }
     this._flashStartTimer = Singleton<MainUIManager>.Instance.SceneCanvas.CreateTimer(0.01666667f, 0f);
     this._flashStartTimer.timeUpCallback = new Action(this.StartImageColorScaler);
     return transform.GetComponent<ParticleSystem>();
 }
Exemple #2
0
        public override void StartUp(Transform canvasTrans, Transform viewParent = null)
        {
            base.StartUp(canvasTrans, viewParent);
            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateInfiniteTimer(1f);

            this._timer.timeTriggerCallback = new Action(this.SetupStaminaInfo);
        }
Exemple #3
0
        public CanvasTimer CreateInfiniteTimer(float m_triggerCD = 0)
        {
            CanvasTimer item = new CanvasTimer {
                infiniteTimeSpan = true,
                triggerCD        = m_triggerCD
            };

            this._newTimersDuringUpdate.Add(item);
            return(item);
        }
 private void SetEquipImageFlash(float scaler, float timeSpan)
 {
     if (this._flashResetTimer != null)
     {
         this._flashResetTimer.Destroy();
     }
     this._flashResetTimer = Singleton<MainUIManager>.Instance.SceneCanvas.CreateTimer(timeSpan, 0f);
     this._flashResetTimer.timeUpCallback = new Action(this.ResetImageColorScaler);
     this.SetImageColorScaler(scaler);
 }
Exemple #5
0
        public CanvasTimer CreateTimer(float m_timespan, float m_triggerCD = 0)
        {
            CanvasTimer item = new CanvasTimer {
                timespan  = m_timespan,
                triggerCD = m_triggerCD
            };

            this._newTimersDuringUpdate.Add(item);
            return(item);
        }
Exemple #6
0
        private bool DoEnterCabin()
        {
            if (this._pageFadeOutTimer != null)
            {
                this._pageFadeOutTimer.Destroy();
            }
            this._pageFadeOutTimer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(0.5f, 0f);

            this._pageFadeOutTimer.timeUpCallback = new Action(this.EnterCabin);
            base.view.transform.GetComponent <Animator>().SetTrigger(this.PAGE_FADE_OUT_TRIGGER_ID);
            return(false);
        }
        public void StartShow(float startDelay = 0f)
        {
            if (Mathf.Approximately(startDelay, 0f))
            {
                this.DoStartShow();
            }
            else if (Singleton <MainUIManager> .Instance.SceneCanvas != null)
            {
                this._startDelayTimer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(startDelay, 0f);

                this._startDelayTimer.timeUpCallback = new Action(this.DoStartShow);
            }
        }
Exemple #8
0
        public void StartPlay(float startDelay = 0f, bool lockUI = true)
        {
            this._lockUI = lockUI;
            if (Mathf.Approximately(startDelay, 0f))
            {
                this.DoStarPlay();
            }
            else
            {
                this._startDelayTimer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(startDelay, 0f);

                this._startDelayTimer.timeUpCallback = new Action(this.DoStarPlay);
            }
        }
Exemple #9
0
        protected override bool SetupView()
        {
            if (this._timer != null)
            {
                this._timer.Destroy();
            }
            if (!this.ignoreMaxWaitTime)
            {
                this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(this.MAX_WAIT_TIME, 0f);

                this._timer.timeUpCallback = new Action(this.OnTimeOut);
            }
            return(false);
        }
Exemple #10
0
        public AchieveUnlockInLevelContext()
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "AchieveUnlockInLevelDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/AchieveUnlockInLevelDialog"
            };

            base.config = pattern;
            base.uiType = UIType.SuspendBar;
            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(2.5f, 0f);

            this._timer.timeUpCallback = new Action(this.OnTimeout);
            this._timer.StopRun();
        }
Exemple #11
0
        public AvatarLevelUpDialogContext(uint level, uint levelBefore)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "AvatarLevelUpDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/AvatarLevelUpDialog"
            };

            base.config = pattern;
            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(2f, 0f);

            this._timer.timeUpCallback = new Action(this.Destroy);
            this._timer.StopRun();
            this._level       = level;
            this._levelBefore = levelBefore;
        }
Exemple #12
0
        public AchieveUnlockContext(int missionId)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "AchieveUnlockDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/AchieveUnlockDialog"
            };

            base.config       = pattern;
            this._missionData = Singleton <MissionModule> .Instance.GetMissionDataItem(missionId);

            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(2f, 0f);

            this._timer.timeUpCallback = new Action(this.OnBGClick);
            this._timer.StopRun();
        }
        public AvatarNewSkillCanUnlockDialogContext(string avatarFullName, string skillName, bool isSubSkill)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "AvatarNewSkillCanUnlockDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/AvatarNewSkillCanUnlockDialog"
            };

            base.config         = pattern;
            this.avatarFullName = avatarFullName;
            this.skillName      = skillName;
            this.isSubSkill     = isSubSkill;
            this._timer         = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(2f, 0f);

            this._timer.timeUpCallback = new Action(this.OnTimerUp);
            this._timer.StopRun();
        }
        public GeneralHintDialogContext(string desc, float timerSpan = 2f)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "GeneralHintDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/GeneralHintDialog"
            };

            base.config = pattern;
            this.desc   = desc;
            if (this._timer != null)
            {
                this._timer.Destroy();
            }
            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(timerSpan, 0f);

            this._timer.timeUpCallback = new Action(this.OnTimerUp);
        }
Exemple #15
0
        public PlayerLevelUpDialogContext()
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "PlayerLevelUpDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/PlayerLevelUpDialog"
            };

            base.config = pattern;
            if (this._timer != null)
            {
                this._timer.Destroy();
            }
            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(2f, 0f);

            this._timer.timeUpCallback = new Action(this.OnBGClick);
            this._timer.StopRun();
            this._avatarData = null;
        }
Exemple #16
0
        public AvatarUnlockDialogContext(int avatarID, bool enableClipZone = false)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "AvatarUnlockDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/AvatarUnlockDialog",
                cacheType      = ViewCacheType.DontCache
            };

            base.config      = pattern;
            this._avatarID   = avatarID;
            this._avatarData = Singleton <AvatarModule> .Instance.GetAvatarByID(this._avatarID);

            this._enableClipZone = enableClipZone;
            this._timer          = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(1f, 0f);

            this._timer.timeUpCallback = new Action(this.OnBGClick);
            this._timer.StopRun();
        }
        public DropNewItemDialogContext(StorageDataItemBase itemData, bool useTimer = true, bool onlyShow = false)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "DropNewItemDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/NewDropItemGotDialog",
                cacheType      = ViewCacheType.DontCache
            };

            base.config       = pattern;
            this._storageItem = itemData;
            this._onlyShow    = onlyShow;
            if (useTimer)
            {
                this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(this.TimerSpan, 0f);

                this._timer.timeUpCallback = new Action(this.DialogEnd);
                this._timer.StopRun();
            }
        }
        protected override bool SetupView()
        {
            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(1f, 0f);

            this._timer.timeUpCallback = new Action(this.Close);
            this._timer.StopRun();
            Transform      transform    = base.view.transform.Find("Dialog/Content/");
            AvatarDataItem leaderAvatar = this._friendDetailData.leaderAvatar;

            transform.Find("Portrait/Icon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(leaderAvatar.IconPath);
            Color color = UIUtil.SetupColor(MiscData.Config.AvatarAttributeColorList[leaderAvatar.Attribute]);

            transform.Find("Portrait/BG").GetComponent <Image>().color = color;
            transform.Find("Stars/AvatarStar").GetComponent <MonoAvatarStar>().SetupView(leaderAvatar.star);
            transform.Find("NickName/Text").GetComponent <Text>().text    = this._friendDetailData.nickName;
            transform.Find("Level/Text").GetComponent <Text>().text       = string.Format("LV.{0}", this._friendDetailData.level);
            transform.Find("CombatValue/Text").GetComponent <Text>().text = Mathf.FloorToInt(leaderAvatar.CombatNum).ToString();
            transform.Find("SelfDesc/Text").GetComponent <Text>().text    = this._friendDetailData.Desc;
            return(false);
        }
 private void PlayEffectWithDelay(float delay)
 {
     this._effectDelayTimer = Singleton<MainUIManager>.Instance.SceneCanvas.CreateTimer(delay, 0f);
     this._effectDelayTimer.timeUpCallback = new Action(this.PlayPowerUpEffect);
 }