Пример #1
0
        /// <summary>
        /// Initializes the motor
        /// </summary>
        /// <param name="brain"><see cref="ThirdPersonBrain"/> calling the initialization</param>
        public void Init(ThirdPersonBrain brain)
        {
            m_MainCamera                     = Camera.main;
            m_GameObject                     = brain.gameObject;
            m_Transform                      = brain.transform;
            m_ThirdPersonBrain               = brain;
            m_CharacterInput                 = brain.thirdPersonInput;
            m_ControllerAdapter              = brain.controllerAdapter;
            m_Animator                       = m_GameObject.GetComponent <Animator>();
            m_AverageForwardVelocity         = new SlidingAverage(m_Configuration.jumpGroundVelocityWindowSize);
            m_ExplorationAverageForwardInput = new SlidingAverage(m_Configuration.forwardInputWindowSize);
            m_StrafeAverageForwardInput      = new SlidingAverage(m_Configuration.strafeInputWindowSize);
            m_StrafeAverageLateralInput      = new SlidingAverage(m_Configuration.strafeInputWindowSize);
            m_PreviousInputs                 = new SizedQueue <Vector2>(m_Configuration.bufferSizeInput);
            movementMode                     = ThirdPersonMotorMovementMode.Exploration;

            EndStrafe();
        }
Пример #2
0
 private void Start()
 {
     LogMessages = new SizedQueue <string>(LineCount);
     LogText     = new StringBuilder();
     Log.text    = LogText.ToString();
 }