internal SlidingAverage GetSliding(string name, int value) { var cvs = GetCvs(name); var sa = new SlidingAverage(cvs, value); return(sa); }
/// <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(); }