void OnTimerTick(object sender, EventArgs e) { NView view = GetView(); if (view == null || view.Document == null) { return; } bool alphaChanged = false; foreach (NSeries series in m_SeriesToPercents.Keys) { if ((m_SelectedSeries == null) || (series == m_SelectedSeries)) { //selected series or no selection. alphaChanged = UpdateAlpha(series, -m_TransparencyStep) || alphaChanged; } else { //not selected series when there is a selected series. alphaChanged = UpdateAlpha(series, m_TransparencyStep) || alphaChanged; } } if (alphaChanged) { this.Repaint(); } }
public MobAIBase(BaseAI instance, string initState, MobAIBaseConfig config) { m_instance = instance; Config = config; Brain = new StateMachine <string, string>(() => CurrentAIState, s => CurrentAIState = s); Brain.OnUnhandledTrigger((state, trigger) => { }); CurrentAIState = initState; if (NView.IsValid()) { NView.Register <ZDOID, string>(Constants.Z_MobCommand, RPC_MobCommand); } }
public string UpdateAiStatus(string newStatus) { newStatus = Localization.instance.Localize(newStatus); string currentAiStatus = NView?.GetZDO()?.GetString(Constants.Z_AiStatus); if (currentAiStatus != newStatus) { NView.GetZDO().Set(Constants.Z_AiStatus, newStatus); if (PrintAIStateToDebug) { string name = Character.GetHoverName(); Debug.Log($"{name}: {newStatus}"); } } return(newStatus); }
private NView PostProcessView(NView view) { view.TextFont = textFont; return(view); }