Esempio n. 1
0
    //private float getMouse1DownTime = 0f;
    ////计数器
    //private int getDownCount = 0;
    //// Use this for initialization
    void Start()
    {
        //    Time.timeScale = 0;
        changecolor = GameObject.Find("points").GetComponent <ChangeColor>();
        LoadPaota();
        for (int i = 0; i < 5; i++)
        {
            paota[i]       = (Button)GameTools.FindGameObjectByParent("GameUI/paotaUI/paota" + (i + 1) + "/Button/").GetComponent <Button>();
            paota_image[i] = (GameObject)GameTools.FindGameObjectByParent("GameUI/paotaUI/paota" + (i + 1) + "/Image/");
            paota_image[i].SetActive(false);
        }
        for (int i = 0; i < 5; i++)
        {
            int temp = i;
            //   Debug.Log(i);
            paota[i].onClick.AddListener(() => {
                //   Debug.Log("添加炮塔Button点击事件");
                showPaotaData(temp);
            });
        }

        introduction     = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/introduction/").GetComponent <Text>();
        attack           = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/attack/").GetComponent <Text>();
        attdistance      = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/attdistance/").GetComponent <Text>();
        attackinterval   = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/attackinterval/").GetComponent <Text>();
        cost             = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/cost/").GetComponent <Text>();
        jineng_manager   = GameTools.FindGameObjectByParent("jinengManager/").GetComponent <jinengManager>();
        tip              = (Text)GameTools.FindGameObjectByParent("GameUI/tip/").GetComponent <Text>();
        remain_paota_num = (Text)GameTools.FindGameObjectByParent("GameUI/remain_paota_num/").GetComponent <Text>();
        tip.text         = "";
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     circle = (GameObject)GameTools.FindGameObjectByParent("jinengManager/jineng2/circle/");
     circle.SetActive(false);
     renderer               = GetComponent <LineRenderer>();
     renderer.enabled       = false;
     renderer.positionCount = 2;
     jineng_manager         = GameTools.FindGameObjectByParent("jinengManager/").GetComponent <jinengManager>();
 }