Esempio n. 1
0
    public void InitTroopAs(TroopType type, int number)
    {
        HP         = number * 10;
        _troopType = type;

        AntInstance.InitAnts(number);
        MoveInstance.Init();
        FightInstance.Init();
    }
Esempio n. 2
0
    public void TakeDamage(int damage)
    {
        HP -= damage;

        Debug.Log(gameObject.name + "take damage" + damage + "left" + HP);

        if (HP <= 0)
        {
            HP = 0;
            FightInstance.StopAttack();
            PoolTotleMgr.Instance.Despawn(transform);
        }
        else
        {
            AntInstance.DespawnAntsWhenDamage();
        }
    }
Esempio n. 3
0
    private void Awake()
    {
        if (Main)
        {
            LogMsg("Game Manager Singleton already exists in scene. Destroying copy at " + gameObject.name);
            Destroy(this);
        }
        Main = this;

        _instance = FindObjectOfType <FightInstance>();

        if (_instance)
        {
            _player = _instance.Player;

            _currentBoss = _instance.InstanceBoss;

            FightInstance.OnBossDown += GameWin;
        }
    }