void Init()
    {
        _hasInit = true;

        if (eventDictionary == null)
        {
            eventDictionary = new Dictionary <string, UnityEvent>();
        }

        if (TurnStart == null)
        {
            turnStart = new TurnStartEvent();
        }

        if (unitDead == null)
        {
            unitDead = new UnitDeadEvent();
        }
    }
예제 #2
0
        private void OnUnitDead(object sender, DateTime dateTime)
        {
            BattleBase one = sender as BattleBase;

            if (one != null)
            {
                UnitDeadEvent?.Invoke(this, one);
                lock (_mutex)
                {
                    if (_battleUnits.Contains(one))
                    {
                        _battleUnits.Remove(one);
                        one.DeadEvent -= OnUnitDead;
                    }
                }
                if (!IsAlive())
                {
                    DeadEvent?.Invoke(this, dateTime);
                }
            }
        }
예제 #3
0
 protected internal override void OnBattleActorDead(ZoneActor actor, UnitDeadEvent e)
 {
     do_clear_current_seeking();
 }