// Use this for initialization void Start() { gameTime = 500; if (Time.timeScale != 1) { Time.timeScale = 1; } gameHealth_text.text = "" + gameHealth; gameover = GameTools.FindGameObjectByParent("GameUI/GameOver/"); returnMenu = (Button)GameTools.FindGameObjectByParent("GameUI/GameOver/returnMenu/").GetComponent <Button>(); continueGame = (Button)GameTools.FindGameObjectByParent("GameUI/GameOver/continueGame/").GetComponent <Button>(); returnMenu.onClick.AddListener(ReturnManu); continueGame.onClick.AddListener(ContionueGame); victory = (Text)GameTools.FindGameObjectByParent("GameUI/GameOver/victory/").GetComponent <Text>(); remainTime = (Text)GameTools.FindGameObjectByParent("GameUI/remainTime/").GetComponent <Text>(); gameTaskTips = GameTools.FindGameObjectByParent("GameUI/task_tips/"); pause = GameTools.FindGameObjectByParent("GameUI/GamePause/"); preturnMenu = (Button)GameTools.FindGameObjectByParent("GameUI/GamePause/returnMenu/").GetComponent <Button>(); pcontinueGame = (Button)GameTools.FindGameObjectByParent("GameUI/GamePause/continueGame/").GetComponent <Button>(); preturnMenu.onClick.AddListener(ReturnManu); pcontinueGame.onClick.AddListener(PContionueGame); pause.SetActive(false); gameover.SetActive(false); gameTaskTips.SetActive(false); }
// Use this for initialization void Start() { for (int i = 0; i < 5; i++) { jienng[i] = (Button)GameTools.FindGameObjectByParent("GameUI/jinengUI/jineng" + (i + 1) + "/").GetComponent <Button>(); iamge_time[i] = (Image)GameTools.FindGameObjectByParent("GameUI/jinengUI/jineng" + (i + 1) + "/").GetComponent <Image>(); int temp = i; // Debug.Log("添加响应事件" + temp); jienng[i].onClick.AddListener(() => { // Debug.Log("添加技能点击响应事件" + temp); onclickJineng(temp); }); lenque_time[i] = 20; total_lenque_time[i] = 20; jinengCom[i] = (base_jineng)GameTools.FindGameObjectByParent("jinengManager/jineng" + (i + 1) + "/").GetComponent <base_jineng>(); } changecolor = GameObject.Find("points").GetComponent <ChangeColor>(); circle = (GameObject)GameTools.FindGameObjectByParent("jinengManager/circle/"); circle.GetComponent <TrollDrawLine>().setRadius(10); circle.SetActive(false); wujiaoxing = (GameObject)GameTools.FindGameObjectByParent("jinengManager/wujiaoxing/"); wujiaoxing.GetComponent <wujiaoxing>().setRadius(10); wujiaoxing.SetActive(false); tips = (GameObject)GameTools.FindGameObjectByParent("GameUI/jineng_tips/"); putCom = GameTools.FindGameObjectByParent("GameManager/").GetComponent <put_paota>(); tips.SetActive(false); }
//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 = ""; }
// 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>(); }
// Use this for initialization void Start() { UI1 = GameTools.FindGameObjectByParent("MainUI/UI1/"); UI2 = GameTools.FindGameObjectByParent("MainUI/UI2/"); nextpage = (Button)GameTools.FindGameObjectByParent("MainUI/UI1/nextpage/").GetComponent <Button>(); lastpage = (Button)GameTools.FindGameObjectByParent("MainUI/UI2/lastpage/").GetComponent <Button>(); end = (Button)GameTools.FindGameObjectByParent("MainUI/UI2/end/").GetComponent <Button>(); UI2.SetActive(false); nextpage.onClick.AddListener(NextPage); lastpage.onClick.AddListener(LastPage); end.onClick.AddListener(End); }
// Use this for initialization void Start() { LoadEnemy(); attakcTime = (Text)GameTools.FindGameObjectByParent("GameUI/attackTime/").GetComponent <Text>(); }