protected override bool OnDecoratorCanChildExecute(Arguments args) { if (this.cooldown == null) { this.cooldown = new Stratus.StratusCountdown(this.duration); StratusUpdateSystem.Add(this.cooldown); } if (this.cooldown.isFinished) { this.cooldown.Reset(); return(true); } //Trace.Script($"Timer @ {cooldown.progress}"); return(false); }
private void SetGroundDetection() { if (groundDetection != GroundDetection.Collision) { groundCastTimer = new StratusCountdown(groundCastFrequency); } switch (groundDetection) { case GroundDetection.Raycast: break; case GroundDetection.CheckSphere: sphereOffset = Vector3.up * (groundCollider.radius * 0.9f); break; case GroundDetection.Collision: if (groundCollider.isTrigger) { collisionProxy = StratusCollisionProxy.Construct(groundCollider, StratusCollisionProxy.CollisionMessage.TriggerEnter, OnCollider); } else { collisionProxy = StratusCollisionProxy.Construct(new StratusCollisionProxy.Arguments(groundCollider, StratusCollisionProxy.CollisionMessage.CollisionEnter, OnCollision)); } break; } switch (locomotion) { case LocomotionMode.Velocity: case LocomotionMode.Force: break; case LocomotionMode.CharacterController: characterController.Move(-Vector3.up); break; case LocomotionMode.NavMeshAgent: break; } }
//------------------------------------------------------------------------/ // Interface //------------------------------------------------------------------------/ protected override void OnTaskStart(StratusAgent agent) { this.timer = new StratusCountdown(this.duration); }
//--------------------------------------------------------------------------------------------/ // Messages //--------------------------------------------------------------------------------------------/ public override void OnModuleAwake() { this.jumpTimer = new StratusCountdown(this.jumpApex); this.fallTimer = new StratusCountdown(this.jumpApex); //characterMovement.gameObject.Connect<JumpEvent>(this.OnJumpEvent); }