Example #1
0
    //public bool showing = false;

    void Awake()
    {
        updateUI = GameObject.Find("TurretUpdateUI");

        controller = GameObject.Find("TurretSelectUI").GetComponent <TurretController>();

        GameObject s = GameObject.Find("Sale");

        sale     = s.GetComponent <Button>();
        saleText = s.GetComponentInChildren <Text>();

        sale.onClick.AddListener(delegate {
            if (selected != null)
            {
                controller.SaleTurret(selected);
                selected = null;
            }
        });

        GameObject u = GameObject.Find("Update");

        update     = u.GetComponent <Button>();
        updateText = u.GetComponentInChildren <Text>();

        update.onClick.AddListener(delegate {
            //Debug.Log("will update a turret");
            if (selected != null)

            {
                controller.UpdateTurret(selected);
                ShowTurretInfo(selected);
                //selected = null;
            }
        });

        levelText = GameObject.Find("Level").GetComponentInChildren <Text>();

        HideTurretInfo();

        selected = null;


        //fireRange = GameObject.Find("FireRange");
    }