예제 #1
0
    void HandleUnitDied(object sender, EventArgs args)
    {
        UnitDiedEvent e     = args as UnitDiedEvent;
        BUnit         bUnit = GetBUnit(e.unit);

        bCameraMover.Focus(bUnit.transform.position);
        bUnit.Died();
    }
예제 #2
0
파일: Unit.cs 프로젝트: dbirtola/Clicker
    protected virtual void Awake()
    {
        unitDied         = new UnitDiedEvent();
        dealtDamageEvent = new DealtDamageEvent();
        health           = GetComponent <Health>();
        debuffs          = GetComponent <Debuffs>();

        currentSpeed = baseSpeed;
    }
예제 #3
0
        private void OnUnitDied(UnitDiedEvent customEvent)
        {
            UnitStackBase unit = customEvent.Unit;

            if (playerUnitsInBattle.Contains(unit))
            {
                playerUnitsInBattle.Remove(unit);
            }
            else if (enemyUnitsInBattle.Contains(unit))
            {
                enemyUnitsInBattle.Remove(unit);
            }
            else
            {
                return;
            }

            unit.gameObject.SetActive(false);
            deadUnits.Add(unit);
            battleUI.DeselectCurrentTarget();
        }