Exemplo n.º 1
0
 public void SelectTrapToBuild(TrapBlueprint _trap)
 {
     build_trap    = _trap;
     selected_node = null;
     build_turret  = null;
     DeselectNode();
 }
Exemplo n.º 2
0
 public void SelectTurretToBuild(TurretBlueprint _turret)
 {
     build_turret  = _turret;
     selected_node = null;
     build_trap    = null;
     DeselectNode();
 }
Exemplo n.º 3
0
    public void SelectNode(spots _spot)
    {
        if (selected_node == _spot)
        {
            DeselectNode();
            return;
        }

        selected_node = _spot;
        build_turret  = null;
        build_trap    = null;
        turretUI.SetTarget(_spot);
        shop.archer_selected    = false;
        shop.slauncher_selected = false;
        shop.flame_selected     = false;
        shop.mortar_selected    = false;
    }
Exemplo n.º 4
0
    void BuildTrap(TrapBlueprint _blueprint)
    {
        //check if the player has enough money to build. otherwise nothing happens and an error message happens.
        if (PlayerStats.money < _blueprint.cost)
        {
            Debug.Log("Not enough money to build.");
            return;
        }

        //otherwise, remove their money from the cost and build them the tower.
        PlayerStats.money -= _blueprint.cost;
        GameObject _trap = (GameObject)Instantiate(_blueprint.prefab, GetBuildPosition(), Quaternion.identity);

        _trap.transform.parent = GameObject.Find("BuildList").transform;
        trap = _trap;
        Destroy(_trap, trap_destroy_time);

        trap_blueprint = _blueprint;
    }
Exemplo n.º 5
0
 public void ResetSelection()
 {
     build_turret = null;
     build_trap   = null;
 }