/// <summary>
        /// Convenient way to get the controller.
        /// </summary>
        private ThirdPersonController getCurrentController()
        {
            if (Controller != null)
            {
                return(Controller);
            }
            else
            {
                if (_cachedMotor != Target)
                {
                    _cachedMotor = Target;

                    if (_cachedMotor == null)
                    {
                        _controller = null;
                    }
                    else
                    {
                        _controller = _cachedMotor.GetComponent <ThirdPersonController>();
                    }
                }

                return(_controller);
            }
        }
        private void Awake()
        {
            _controller = GetComponent <ThirdPersonController>();
            _motor      = GetComponent <CharacterMotor>();
            _inventory  = GetComponent <CharacterInventory>();

            _controller.WaitForUpdateCall = true;
        }
Beispiel #3
0
 private void Awake()
 {
     _controller = GetComponent <ThirdPersonController>();
     _motor      = GetComponent <CharacterMotor>();
 }