#pragma warning restore 0649 #endregion // Serialized Fields #endregion // Fields #region Properties #endregion // Properties #region Methods public override void DoUpdate() { var inputMan = InputManager.instance; Unit.State.Momentary momentary = unit.state.momentary; InputSource input = unit.manState.owner.inputSource; momentary.moveInput = inputMan.GetAction(input, inputData.move).axis2D; momentary.aimInput = inputMan.GetAction(input, inputData.aim).axis2D; momentary.jumpInput = inputMan.GetAction(input, inputData.jump).buttonDown; momentary.fireInput = inputMan.GetAction(input, inputData.fire).buttonHeld; momentary.weaponChangeInput = inputMan.GetAction(input, inputData.changeWeapon).buttonDown; }
#pragma warning restore 0649 #endregion // Serialized Fields #endregion // Fields #region Properties #endregion // Properties #region Methods public override void DoUpdate() { Unit.State.Persistent persistent = unit.state.persistent; Unit.State.Momentary momentary = unit.state.momentary; Unit.ManagerState manState = unit.manState; Unit.ManagerState.AiData aiData = manState.aiData; switch (aiData.state) { case Unit.AiState.Idle: persistent.navTarget = manState.homePoint; break; case Unit.AiState.Chasing: persistent.navTarget = aiData.closestTarget.transform.position; break; } }