public void Frame(IEventArgs args, int interval) { if (_entity.isFlagDestroy) { return; } args.TempUse("entity", this); args.TempUse(name, this); FreeRuleEventArgs fr = (FreeRuleEventArgs)args; move.Frame(fr, _entity, interval); xPara.SetValue(_entity.position.Value.x); yPara.SetValue(_entity.position.Value.y); zPara.SetValue(_entity.position.Value.z); foreach (PlayerEntity player in follows) { Vector3 v = _entity.position.Value; //v.y = v.y + 20; player.position.Value = v; } if (gameObject != null) { gameObject.transform.position = _entity.position.Value; } if (skill != null) { skill.Frame((FreeRuleEventArgs)args); } if (frameAction != null) { frameAction.Act(args); } if (effect != null && args.Rule.ServerTime - lastEffectTime > 1000L) { foreach (PlayerEntity player in args.GameContext.player.GetInitializedPlayerEntities()) { if (!effect.GetPlayerIds().Contains(player.entityKey.Value.EntityId)) { effect.Act(args); effect.AddPlayerId(player.entityKey.Value.EntityId); lastEffectTime = args.Rule.ServerTime; break; } } } args.Resume(name); args.Resume("entity"); }
public void Update(EntityKey owner, IUserCmd cmd, Contexts contexts) { if (SharedConfig.IsServer) { if (!_unitSkill.IsEmtpy()) { _freeArgs.GetInput().SetUserCmd(cmd); _freeArgs.TempUse("current", owner.WeaponController().RelatedFreeData); _unitSkill.Frame(_freeArgs); _freeArgs.Resume("current"); } } }
public void Update(PlayerWeaponController controller, IUserCmd cmd) { if (SharedConfig.IsServer) { if (!_unitSkill.IsEmtpy()) { _freeArgs.GetInput().SetUserCmd(cmd); _freeArgs.TempUse("current", controller.RelatedFreeData); _unitSkill.Frame(_freeArgs); _freeArgs.Resume("current"); } } }
public void Update(IPlayerWeaponState playerWeapon, IUserCmd cmd) { if (SharedConfig.IsServer) { if (!_unitSkill.IsEmtpy()) { _freeArgs.GetInput().SetUserCmd(cmd); _freeArgs.TempUse("current", (FreeData)playerWeapon.FreeData); _unitSkill.Frame(_freeArgs); _freeArgs.Resume("current"); } } }
public void Frame(IEventArgs args, int interval) { if (_entity.isFlagDestroy) { return; } args.TempUse("entity", this); args.TempUse(name, this); FreeRuleEventArgs fr = (FreeRuleEventArgs)args; move.Frame(fr, _entity, interval); xPara.SetValue(_entity.position.Value.x); yPara.SetValue(_entity.position.Value.y); zPara.SetValue(_entity.position.Value.z); foreach (PlayerEntity player in follows) { Vector3 v = _entity.position.Value; //v.y = v.y + 20; player.position.Value = v; } if (gameObject != null) { gameObject.transform.position = _entity.position.Value; } if (skill != null) { skill.Frame((FreeRuleEventArgs)args); } if (frameAction != null) { frameAction.Act(args); } args.Resume(name); args.Resume("entity"); }