示例#1
0
 public FsmActionInfoAttribute(string name, string toName, Type type)
 {
     this.name   = name;
     this.toName = toName;
     this.chance = FsmActiveChance.OnLeave;
     mark        = true;
     this.type   = type;
 }
示例#2
0
 public FsmActionInfoAttribute(string name, FsmActiveChance chance, Type type)
 {
     this.name   = name;
     this.chance = chance;
     this.toName = null;
     mark        = false;
     this.type   = type;
 }
示例#3
0
        internal void Subscribe(FsmActiveChance fsmActiveChance, FsmEventHandler <T> fsmEvent)
        {
            int id = (int)fsmActiveChance;

            if (fsmEvents[id] == null)
            {
                fsmEvents[id] = fsmEvent;
            }
            else
            {
                fsmEvents[id] += fsmEvent;
            }
        }
示例#4
0
        public void Active(FsmActiveChance fsmActiveChance, T owner)
        {
            int id = (int)fsmActiveChance;

            fsmEvents[id]?.Invoke(owner);
        }
示例#5
0
        internal void UnSubscribe(FsmActiveChance fsmActiveChance, FsmEventHandler <T> fsmEvent)
        {
            int id = (int)fsmActiveChance;

            fsmEvents[id] -= fsmEvent;
        }