Exemple #1
0
    public override void Enter()
    {
        _controller.animator.gameObject.SetActive(false);
        _controller.rag = GameObject.Instantiate(_controller.ragdollPrefab, _controller.gameObject.transform.position, Quaternion.identity);
        CameraController cameraController = GameObject.FindObjectOfType <CameraController>();

        cameraController.enabled = true;
        HeadLookAt cameraLook = cameraController.gameObject.GetComponent <HeadLookAt>();

        cameraLook.lookAtObj = _controller.rag.transform.GetChild(0).transform.GetChild(0).transform;
        cameraLook.enabled   = true;
        //cameraController.target = rag.transform.GetChild(0).transform.GetChild(0).transform;
        FovController fovController = GameObject.FindObjectOfType <FovController>();

        fovController.activated    = true;
        fovController.isGoingToMin = true;

        _controller.characterController.enabled = false;

        _hadSwordUnlocked = _controller.scannerSword.SwordUnlocked();
        _sameScene        = GameManager.Instance.GetCurrentScene() == GameManager.Instance.checkpointSceneIndex && GameManager.Instance.GetCurrentScene() != 11;
        UIManager.Instance.DeathFade();
    }
Exemple #2
0
    public void Spawn()
    {
        _isDead = false;
        _movementController.Spawn();
        _movementController.SetState(new MoveState(_movementController));
        _combatController.SetState(new IdleState(_combatController));
        _combatController.animator.gameObject.SetActive(true);
        CameraController cameraController = GameObject.FindObjectOfType <CameraController>();

        //cameraController.target = _movementController.transform;
        cameraController.enabled = true;
        HeadLookAt cameraLook = cameraController.gameObject.GetComponent <HeadLookAt>();

        cameraLook.enabled = false;
        FovController fovController = GameObject.FindObjectOfType <FovController>();

        fovController.activated    = true;
        fovController.isGoingToMin = false;
        if (_movementController.rag != null)
        {
            Destroy(_movementController.rag);
        }
        RestoreHealth();
    }