public override void Execute(object data)
    {
        UpgradeTowerArgs e     = data as UpgradeTowerArgs;
        Tower            tower = e.tower;

        tower.Level++;
    }
    public override void Execute(object data)
    {
        UpgradeTowerArgs e     = data as UpgradeTowerArgs;
        Tower            tower = e.tower;

        tower.Tile.Data = null;
        Game.Instance.ObjectPool.Unspawn(e.tower.gameObject);
        //tower.Level++;
    }
Exemplo n.º 3
0
    public override void Execute(object data)
    {
        UpgradeTowerArgs e     = data as UpgradeTowerArgs;
        Tower            tower = e.tower;
        GameModel        gm    = GetModel <GameModel>();

        gm.Gold -= tower.Level * tower.BasePrice;
        tower.Level++;
    }
Exemplo n.º 4
0
    void OnMouseDown()
    {
        if (m_Tower.IsTopLevel)
        {
            return;
        }

        UpgradeTowerArgs e = new UpgradeTowerArgs()
        {
            tower = m_Tower
        };

        SendMessageUpwards("UpgradeTower", e, SendMessageOptions.DontRequireReceiver);
    }
Exemplo n.º 5
0
    void OnMouseDown()
    {
        if (m_Tower.IsTopLevel)
        {
            return;
        }
        GameModel gm = MVC.GetModel <GameModel>();

        if (gm.Gold >= m_Tower.Level * m_Tower.BasePrice)
        {
            UpgradeTowerArgs e = new UpgradeTowerArgs()
            {
                tower = m_Tower
            };
            SendMessageUpwards("UpgradeTower", e, SendMessageOptions.DontRequireReceiver);
        }
    }
Exemplo n.º 6
0
    void OnMouseDown()
    {
        if (m_Tower.name >= 3 || gm.Score < m_Tower.BasePrice)
        {
            return;
        }
        gm.Score -= m_Tower.BasePrice;
        UpgradeTowerArgs e = new UpgradeTowerArgs()
        {
            tower = m_Tower
        };

        SendMessageUpwards("UpgradeTower", e, SendMessageOptions.DontRequireReceiver);
        SpawnTowerArgs e2 = new SpawnTowerArgs()
        {
            Position = m_Tower.transform.position,
            TowerID  = m_Tower.name + 3
        };

        SendMessageUpwards("SpawnTower", e2, SendMessageOptions.DontRequireReceiver);
    }
Exemplo n.º 7
0
 void UpgradeTower(UpgradeTowerArgs e)
 {
     //HideAllPanels();
     SendEvent(Consts.E_UpgradeTower, e);
 }