private void HandleToastEvent(EventCenter.Result result, string locMsg) { bool displayed = false; if (locMsg == "##") { locMsg = null; } if (result == EventCenter.Result.Error) { displayed = HandleError(locMsg); } else if (result == EventCenter.Result.Started) { displayed = HandleStarted(locMsg); } else if (result == EventCenter.Result.Stopped) { displayed = HandleStopped(locMsg); } else if (result == EventCenter.Result.Success) { displayed = HandleSuccess(locMsg); } if (displayed && System.Array.Exists(deactivateAfterPopupTypesDisplayed, t => t == result)) { gameObject.SetActive(false); } }
protected virtual void HandleEvent(EventCenter.Result result, string locMsg) { switch (result) { case EventCenter.Result.Started: HandleStarted(locMsg); break; case EventCenter.Result.Stopped: HandleStopped(locMsg); break; case EventCenter.Result.Success: HandleSuccess(locMsg); break; case EventCenter.Result.Error: HandleError(locMsg); break; } }