Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        pos = Camera.main.WorldToScreenPoint(this.game.transform.position);
        this.menu.transform.position = new Vector3(pos.x, pos.y, pos.z);

        if (StaticClasses.getTower(towerNum))
        {
            if (StaticClasses.getActive(this.towerNum) == false)
            {
                this.menu.SetActive(true);
            }
            else
            {
                this.isActiveView.SetActive(true);
                this.menu.SetActive(false);
            }
        }
        else
        {
            if (StaticClasses.getActive(this.towerNum) == false)
            {
                this.menu.SetActive(false);
            }
            else
            {
                this.isActiveView.SetActive(false);
                this.menu.SetActive(false);
            }
        }
    }
Esempio n. 2
0
    void onTower1()
    {
        if (!StaticClasses.getActive(towerNum) && StaticClasses.Score >= 100)
        {
            Debug.Log("Click 1");
            StaticClasses.towers[towerNum - 1] = GameObject.Instantiate(tower1Pre);
            StaticClasses.towers[towerNum - 1].transform.position = new Vector3(this.cube.transform.position.x, this.cube.transform.position.y, this.cube.transform.position.z);
            StaticClasses.toggleActive(this.towerNum);
            StaticClasses.toggleTower(towerNum);
            StaticClasses.Score -= 100;

            TowerHealth.towerHealth[towerNum - 1].gameObject.SetActive(true);
        }
    }