public override void ExposeAsAttacker(COM_PLAYERCAMP attackeeCamp, int inResetTime)
        {
            int           num      = HorizonMarkerByFow.TranslateCampToIndex(attackeeCamp);
            CTimerManager instance = Singleton <CTimerManager> .instance;

            if (this.SetExposeMark(true, attackeeCamp, this.actor.ActorControl.DoesIgnoreAlreadyLit()))
            {
                if (this.IsDuringExposing(attackeeCamp))
                {
                    if (inResetTime <= 0)
                    {
                        instance.ResetTimer(this.m_exposeTimerSeq[num]);
                    }
                    else if (instance.GetLeftTime(this.m_exposeTimerSeq[num]) < inResetTime)
                    {
                        instance.ResetTimerTotalTime(this.m_exposeTimerSeq[num], inResetTime);
                    }
                }
                else if (num == 0)
                {
                    this.m_exposeTimerSeq[num] = instance.AddTimer(this.actor.ActorControl.QueryExposeDuration(), 1, new CTimer.OnTimeUpHandler(this.OnExposeOverCampOne), true);
                }
                else
                {
                    this.m_exposeTimerSeq[num] = instance.AddTimer(this.actor.ActorControl.QueryExposeDuration(), 1, new CTimer.OnTimeUpHandler(this.OnExposeOverCampTwo), true);
                }
            }
        }
        private void ShowAsAttacker(COM_PLAYERCAMP attackeeCamp, int inResetTime)
        {
            int           num      = HorizonMarkerByFow.TranslateCampToIndex(attackeeCamp);
            CTimerManager instance = Singleton <CTimerManager> .instance;

            if (this.IsDuringShowMark(attackeeCamp))
            {
                if (inResetTime <= 0)
                {
                    instance.ResetTimer(this.m_showmarkTimerSeq[num]);
                }
                else if (instance.GetLeftTime(this.m_showmarkTimerSeq[num]) < inResetTime)
                {
                    instance.ResetTimerTotalTime(this.m_showmarkTimerSeq[num], inResetTime);
                }
            }
            else
            {
                if (num == 0)
                {
                    this.m_showmarkTimerSeq[num] = instance.AddTimer(Horizon.QueryAttackShowMarkDuration(), 1, new CTimer.OnTimeUpHandler(this.OnShowMarkOverCampOne), true);
                }
                else
                {
                    this.m_showmarkTimerSeq[num] = instance.AddTimer(Horizon.QueryAttackShowMarkDuration(), 1, new CTimer.OnTimeUpHandler(this.OnShowMarkOverCampTwo), true);
                }
                this.AddShowMark(attackeeCamp, HorizonConfig.ShowMark.Jungle, 1);
            }
        }
Exemplo n.º 3
0
 public CWindow(string title)
 {
     #pragma warning disable 0618
     this.title = title;
     #pragma warning restore 0618
     CTimerManager.ScheduleTimer(Repaint, 1.0f); // hack: after script reloading windows are not repainted
 }
Exemplo n.º 4
0
        //////////////////////////////////////////////////////////////////////////////

        #region IDisposable

        public void Dispose()
        {
            CNotificationCenter.UnregisterNotifications(this);
            CTimerManager.CancelTimers(this);

            OnDispose();

            for (int i = 0; i < m_subviews.Count; ++i)
            {
                m_subviews[i].Dispose();
            }
        }
Exemplo n.º 5
0
        private CEditorApp()
        {
            m_lastUpdateTime = EditorApplication.timeSinceStartup;

            CTimerManager.ScheduleTimer(() =>
            {
                CThreadUtils.InitOnMainThread(); // we need to make sure this call is done on the main thread
                CLog.Initialize();               // it's safe to initialize logging

                CEditorSceneKeyHandler.keyDownHandler += SceneKeyDownHandler;
                CEditorSceneKeyHandler.keyUpHandler   += SceneUpDownHandler;
            });
        }
Exemplo n.º 6
0
        public void TestSaveDelayed()
        {
            CPreferences prefs = new CPreferences(kPreferencesPath);

            prefs.Set("key", "value");

            CPreferences otherPrefs = new CPreferences(kPreferencesPath);

            Assert.IsNull(otherPrefs.GetString("key"));

            CTimerManager.RunUpdate(0.5f);

            otherPrefs = new CPreferences(kPreferencesPath);
            Assert.AreEqual("value", otherPrefs.GetString("key"));
        }
Exemplo n.º 7
0
 internal void Add(CConsoleViewCellEntry entry)
 {
     if (CThreadUtils.IsUnityThread())
     {
         Entries.Add(entry);
         Delegate.OnConsoleEntryAdded(this, ref entry);
     }
     else
     {
         CTimerManager.ScheduleTimer(() =>
         {
             Add(entry);
         });
     }
 }
Exemplo n.º 8
0
 public void SetUp()
 {
     File.Delete(kPreferencesPath);
     CTimerManager.CancelTimers();
 }
Exemplo n.º 9
0
 protected override void Init()
 {
     CTimerManager.GetInstance();
 }
Exemplo n.º 10
0
 protected override void Tick()
 {
     CTimerManager.GetInstance().Update();
 }
Exemplo n.º 11
0
 protected override void UnInit()
 {
     CTimerManager.DestroyInstance();
 }