Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace com.ootii.Actors.AnimationControllers {
- public class Crouch : MotionControllerMotion {
- public const int PHASE_UNKNOWN = 0;
- public const int PHASE_START_IDLE = 4001;
- public const int PHASE_START_MOVING = 4002;
- public Crouch() : base() {
- _Priority = 1;
- _ActionAlias = "Fire3";
- _ReactivationDelay = 0.1f;
- #if UNITY_EDITOR
- if (_EditorAnimatorSMName.Length == 0) { _EditorAnimatorSMName = "Crouch-SM"; }
- #endif
- }
- public Crouch(MotionController rController) : base(rController) {
- _Priority = 1;
- _ActionAlias = "Fire3";
- _ReactivationDelay = 0.1f;
- #if UNITY_EDITOR
- if (_EditorAnimatorSMName.Length == 0) { _EditorAnimatorSMName = "Crouch-SM"; }
- #endif
- }
- public override bool TestActivate() {
- if (!mIsStartable) { return false; }
- if (!mMotionController.IsGrounded) { return false; }
- if (mMotionController._InputSource.IsJustPressed(_ActionAlias)) { return true; }
- return false;
- }
- public override bool TestUpdate() {
- if (mIsActivatedFrame) { return true; }
- if (mIsAnimatorActive) {
- if (!mMotionController.IsGrounded) { return false; }
- if (mMotionController._InputSource.IsJustPressed(_ActionAlias)) { return false; }
- }
- return true;
- }
- public override bool Activate(MotionControllerMotion rPrevMotion) {
- mMotionController.SetAnimatorMotionPhase(mMotionLayer._AnimatorLayerIndex, Crouch.PHASE_START_IDLE, true);
- return base.Activate(rPrevMotion);
- }
- public override void UpdateRootMotion(float rDeltaTime, int rUpdateIndex, ref Vector3 rMovement, ref Quaternion rRotation) {
- rRotation = Quaternion.identity;
- //base.UpdateRootMotion(rDeltaTime, rUpdateIndex, ref rMovement, ref rRotation);
- }
- public override void Update(float rDeltaTime, int rUpdateIndex) {
- //base.Update(rDeltaTime, rUpdateIndex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement