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); } }
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 }
////////////////////////////////////////////////////////////////////////////// #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(); } }
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; }); }
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")); }
internal void Add(CConsoleViewCellEntry entry) { if (CThreadUtils.IsUnityThread()) { Entries.Add(entry); Delegate.OnConsoleEntryAdded(this, ref entry); } else { CTimerManager.ScheduleTimer(() => { Add(entry); }); } }
public void SetUp() { File.Delete(kPreferencesPath); CTimerManager.CancelTimers(); }
protected override void Init() { CTimerManager.GetInstance(); }
protected override void Tick() { CTimerManager.GetInstance().Update(); }
protected override void UnInit() { CTimerManager.DestroyInstance(); }