Ejemplo n.º 1
0
    private void SetupStateSystem2()
    {
        PlayerControlTutorial whiteControl = null;
        State          state = State.System2;
        Action <State> enter = (prev) =>
        {
            StartCoroutine("System2Anim");
        };
        Action update = () =>
        {
            if (continueState)
            {
                continueState = false;
                MoveOut(systemCanvas2);
                nextButton.SetActive(false);

                GameObject white = Instantiate(whitePrefab, new Vector3(0, 5, 0), Quaternion.identity);
                whiteControl            = white.GetComponent <PlayerControlTutorial>();
                whiteControl.EnableMove = true;

                blackControl.gameObject.SetActive(true);
                Destroy(blackControl);

                record.StartPlayRecord();
                scroll.ScrollToBottom();
            }

            if (whiteControl != null && whiteControl.HasDie)
            {
                Invoke("OnReturn", 2f);
            }
        };
        Action <State> exit = (next) =>
        {
        };

        stateMachine.Add(state, enter, update, exit);
    }
Ejemplo n.º 2
0
    private void SetupStateSystem1()
    {
        PlayerControlTutorial whiteControl = null;
        State          state = State.System1;
        Action <State> enter = (prev) =>
        {
            canChangeState = false;
            MoveIn(systemCanvas1);
            nextButton.SetActive(true);
            //blackControl.GetPlayerInput().DisableInput();
        };
        Action update = () =>
        {
            if (continueState)
            {
                continueState = false;
                MoveOut(systemCanvas1);
                nextButton.SetActive(false);

                GameObject white = Instantiate(whitePrefab, new Vector3(0, 5, 0), Quaternion.identity);
                whiteControl = white.GetComponent <PlayerControlTutorial>();
                //blackControl.GetPlayerInput().EnableInput();
                record.StartRecord();
            }
            if (whiteControl != null && whiteControl.HasDie)
            {
                record.StopRecord();
                blackControl.GetPlayerInput().DisableInput();
                Camera.main.GetComponent <CameraRotateTutorial>().CameraRotate();
                stateMachine.ChangeState(State.System2);
            }
        };
        Action <State> exit = (next) =>
        {
        };

        stateMachine.Add(state, enter, update, exit);
    }