protected virtual void OnHit(SceneObject receiver) { var _battleScene = LogicCore.SP.SceneManager.CurrentScene as BattleScene; EventManager.TriggerEvent(ProjectileAction.hitEvent, new RuntimeData(Sender, receiver, Data)); EventGroup.FireEvent((int)ProjectileEvent.OnHit, this, null); _battleScene.RemoveSceneObject(this.Id); }
public void SwitchScene(IScene battleScene) { if (CurrentScene != null) { CurrentScene.Destroy(); } CurrentScene = battleScene; CurrentScene.Init(); var arg = EventGroup.NewArg <EventSingleArgs <IScene> >(); arg.value = battleScene; EventGroup.FireEvent((int)SceneManagerEvent.OnSwitchScene, this, arg); }
public void Add(AttributeType at, Operation op, long value) { if (_attributes.ContainsKey((int)at)) { var attr = _attributes[(int)at]; var oldValue = attr.FinalValue; attr.Add(op, value); EventGroup.FireEvent((int)Event.OnAttributechange, this, EventGroup.NewArg <EventSingleArgs <AttributeMsg>, AttributeMsg>(new AttributeMsg() { At = at, NewValue = attr.FinalValue, OldValue = oldValue })); } else { Debug.LogError(at + " Key not exsit"); } }
public void SetBase(AttributeType at, long value) { CharacterAttribute attr; if (_attributes.TryGetValue((int)at, out attr)) { var oldValue = attr.FinalValue; _attributes[(int)at].SetBase(value); EventGroup.FireEvent((int)Event.OnAttributechange, this, EventGroup.NewArg <EventSingleArgs <AttributeMsg>, AttributeMsg>(new AttributeMsg() { At = at, NewValue = attr.FinalValue, OldValue = oldValue })); } else { attr = New(at, value); } }
public void FireEvent(int id, object sender, EventMsg m) { EventGroup.FireEvent(id, sender, m); }