Exemplo n.º 1
0
        private void Init()
        {
            // Find references
            charController = gameObject.GetComponent <CharacterController>();
            gameLogic      = FindObjectOfType <GameLogicManager>();
            playerAnimator = GetComponentInChildren <Animator>();

            if (playerAnimator != null)
            {
                playerAnimator.speed = 0.5f;
            }

            // Load settings
            currentHpMax     = baseHP;
            PlayerLife       = baseHP;
            CurrentDmg       = baseDmg;
            CurrentSpeed     = baseSpeed;
            CurrentStage     = PlayerStage.crawlingOneWay;
            CurrentJumpPower = baseJumpPower;
            CurrentDirection = PlayerDirection.right;

            // Set Alive
            isAlive = true;

            if (!SanityCheck())
            {
                Debug.LogError("Player failed SanityCheck!");
            }
        }
Exemplo n.º 2
0
 private void Start()
 {
     CloseDoor();
     gameLogicManager = GameObject.Find("ManagerContainer").GetComponent <GameLogicManager>();
 }