Assets/Scripts/System/Level/LevelEventManager.cs
/// <summary>
/// Populate our delegates with the actions we want each event to take.
/// This method should only be called once.
/// </summary>
Populate our delegates with the actions we want each event to take.
This method should only be called once.
Populate our delegates with the actions we want each event to take . This method should only be called once .
private void InitializeLevelStateEvents()
    {
        hasBeenInitialized = true;
        LoadLevel = new UnityAction<object>((object o) => stateMachine.SetNextState(new LoadLevelState()));
        EnterIngameState = new UnityAction<object>((object o) => stateMachine.SetNextState(new PlayingState()));
        EnterCutsceneState = new UnityAction<object>((object o) => stateMachine.SetNextState(new CutsceneState()));
        CompleteLevel = new UnityAction<object>((object o) =>
        {
            if (!isLevelComplete)
            {
                stateMachine.SetNextState(new LevelCompleteState());
                isLevelComplete = true;
            }
        });
    }
private void InitializeLevelStateEvents ( ) { hasBeenInitialized = true ; LoadLevel = new UnityAction < object > ( ( object o ) => stateMachine . SetNextState ( new LoadLevelState ( ) ) ) ; EnterIngameState = new UnityAction < object > ( ( object o ) => stateMachine . SetNextState ( new PlayingState ( ) ) ) ; EnterCutsceneState = new UnityAction < object > ( ( object o ) => stateMachine . SetNextState ( new CutsceneState ( ) ) ) ; CompleteLevel = new UnityAction < object > ( ( object o ) => { if ( ! isLevelComplete ) { stateMachine . SetNextState ( new LevelCompleteState ( ) ) ; isLevelComplete = true ; } } ) ; }
Populate our delegates with the actions we want each event to take.
Populate our delegates with the actions we want each event to take .