public FsmActionInfoAttribute(string name, string toName, Type type) { this.name = name; this.toName = toName; this.chance = FsmActiveChance.OnLeave; mark = true; this.type = type; }
public FsmActionInfoAttribute(string name, FsmActiveChance chance, Type type) { this.name = name; this.chance = chance; this.toName = null; mark = false; this.type = type; }
internal void Subscribe(FsmActiveChance fsmActiveChance, FsmEventHandler <T> fsmEvent) { int id = (int)fsmActiveChance; if (fsmEvents[id] == null) { fsmEvents[id] = fsmEvent; } else { fsmEvents[id] += fsmEvent; } }
public void Active(FsmActiveChance fsmActiveChance, T owner) { int id = (int)fsmActiveChance; fsmEvents[id]?.Invoke(owner); }
internal void UnSubscribe(FsmActiveChance fsmActiveChance, FsmEventHandler <T> fsmEvent) { int id = (int)fsmActiveChance; fsmEvents[id] -= fsmEvent; }