コード例 #1
0
        /// <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);
            }
        }
コード例 #2
0
        private void Awake()
        {
            _controller = GetComponent <ThirdPersonController>();
            _motor      = GetComponent <CharacterMotor>();
            _inventory  = GetComponent <CharacterInventory>();

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