Esempio n. 1
0
    // Update state and launch apropriate functions
    public void Update_State(Boss_States state)
    {
        State = state;
        if (!Has_Died)
        {
            switch (State)
            {
            case Boss_States.Cinematic:
                break;

            case Boss_States.Attack:

                HUD.Start_Battle();
                break;

            case Boss_States.Wait:
                break;

            case Boss_States.Dead:
                HUD.End_Battle();
                Store_Janitor_HitBox.Is_Enabled = false;
                // Update other scripts
                Store_Janitor_Mo.Update_State(State);
                Store_Janitor_Att.Update_State(State);
                // Set variable
                Has_Died = true;
                // Load Next Level
                Boss_Load_Next_Le.Load_Next_Level();
                // Fade out boss music volume
                Audio_Mixer_Control.current.Fade_Boss(-80, 0.5f);
                break;

            default:
                break;
            }
            // Update movement
            Store_Janitor_Mo.Update_State(State);
            Store_Janitor_Att.Update_State(State);
            Store_Janitor_He.Update_State(State);
            Debug.Log("Updated state to " + State);
        }
    }