Пример #1
0
    void Awake()
    {
        if (Checkpoint.startAvailable)
        {
            transform.position    = Checkpoint.startPosition;
            transform.eulerAngles = new Vector3(0f, 0f, Checkpoint.startRotation);

            Checkpoint.RemoveStart();
        }

        if (quitActiveGO)
        {
            quitActiveGO.SetActive(false);
        }

        var camFollowGO = GameObject.FindGameObjectWithTag(cameraTagFollow);

        mCameraFollow = camFollowGO.GetComponent <CameraFollow>();

        var cameraFollowTrans = mCameraFollow.transform;

        cameraFollowTrans.position = transform.position;
        cameraFollowTrans.rotation = transform.rotation;

        stateControl.stateChangedEvent.AddListener(OnStateChanged);

        signalGameReady.callback   += OnGameReady;
        signalInputLock.callback   += OnInputLock;
        signalInputUnlock.callback += OnInputUnlock;

        mTakeIndIdle      = animator.GetTakeIndex(takeIdle);
        mTakeIndMove      = animator.GetTakeIndex(takeMove);
        mTakeIndAir       = animator.GetTakeIndex(takeAir);
        mTakeIndWallSlide = animator.GetTakeIndex(takeWallSlide);
        mTakeIndSlide     = animator.GetTakeIndex(takeSlide);

        animator.ResetTake(takeSpawn);

        if (input)
        {
            input.ActionAddCallback(OnAct);
        }
    }