public void Process(EntityParent theOwner, params object[] args) { GameMotor theMotor = theOwner.motor; if (theOwner is EntityBeast || (theOwner is EntityPlayer && !(theOwner is EntityMyself))) { theOwner.ApplyRootMotion(false); theOwner.SetSpeed(1); theMotor.SetSpeed(0.4f); if (theOwner.Speed == 0) { theMotor.SetExtraSpeed(6); } else { theMotor.SetExtraSpeed(theOwner.Speed); } return; } else { theOwner.ApplyRootMotion(true); theMotor.SetSpeed(0.4f); theMotor.SetExtraSpeed(0.4f); } theMotor.isMovable = true; }
public void Process(EntityParent theOwner, params object[] args) { int act = (int)ActionConstants.die; theOwner.ApplyRootMotion(true); string actName = theOwner.CurrActStateName();//当前动画的名称 if (actName.EndsWith(PlayerActionName.actionOfNames[(int)ActionConstants.hit_air]) || actName.EndsWith("getup")) { act = (int)ActionConstants.die_knock_down; theOwner.SetAction(act); } else if (actName.EndsWith(PlayerActionName.actionOfNames[(int)ActionConstants.hited_ground]) || actName.EndsWith("knockout")) { act = (int)ActionConstants.die; theOwner.SetAction(act); } else { } theOwner.SetSpeed(0); EventDispatch.TriggerEvent(Event.LogicSoundEvent.OnHitYelling, theOwner as EntityParent, act); if (theOwner is EntityMyself && theOwner.motor) { theOwner.motor.enableStick = false; } }
public void Exit(EntityParent theOwner, params object[] args) { theOwner.ApplyRootMotion(true); theOwner.SetSpeed(1); if (theOwner is EntityBeast) { theOwner.motor.SetExtraSpeed(0); theOwner.motor.isMovingToTarget = false; return; } if (theOwner is EntityMyself) { theOwner.animator.speed = 1; } }