private void HandleLifecycleChangeState([NotNull, ValidatedNotNull] IClientPluginContext context, [NotNull, ValidatedNotNull] LifecycleChangeStateArgs lifecycleChangeStateArgs) { Debug.Assert(mButtonTexture != null, nameof(mButtonTexture) + " != null"); var activeInterface = context.Lifecycle.Interface; if (activeInterface == null) { return; } switch (lifecycleChangeStateArgs.State) { case GameStates.Menu: AddButtonToMainMenu(context, activeInterface); break; } }
/// <inheritdoc /> public void OnLifecycleChangeState(GameStates state) { var lifecycleChangeStateArgs = new LifecycleChangeStateArgs(state); LifecycleChangeState?.Invoke(Context, lifecycleChangeStateArgs); }