public override void Init() { base.Init(); //GameObject canvas = UITool.GetCanvas(); //得到主画布 GameObject canvas = GameObject.Find("Double"); mRootUI = UnityTool.FindOneOfActiveChild(canvas, "Panel"); //得到Panel mPlayer1 = UnityTool.FindOneOfActiveChild(canvas, "Player1"); mPlayer2 = UnityTool.FindOneOfActiveChild(canvas, "Player2"); mToggleGroup1 = UITool.FindChild <ToggleGroup>(mRootUI, "Player1WhichTurret"); mToggleGroup2 = UITool.FindChild <ToggleGroup>(mRootUI, "Player2WhichTurret"); anyToggle1 = mToggleGroup1.ActiveToggles(); anyToggle2 = mToggleGroup2.ActiveToggles(); play1 = UnityTool.FindAllChild(mPlayer1); play2 = UnityTool.FindAllChild(mPlayer2); }
public override void Init() { base.Init(); //GameObject canvas = UITool.GetCanvas(); //得到主画布 canvas = GameObject.Find("DoubleCanvas"); mPanel = UITool.FindOneOfAllChild(canvas, "Panel"); mPlayer1 = UITool.FindOneOfAllChild(canvas, "Player1"); mPlayer2 = UITool.FindOneOfAllChild(canvas, "Player2"); mToggleGroup1 = UITool.FindChild <ToggleGroup>(mPanel, "Player1WhichTurret"); mToggleGroup2 = UITool.FindChild <ToggleGroup>(mPanel, "Player2WhichTurret"); anyToggle1 = mToggleGroup1.ActiveToggles(); anyToggle2 = mToggleGroup2.ActiveToggles(); play1 = UnityTool.FindAllChild(mPlayer1); //Debug.Log(play1); //Debug.Log(play1.Count); play2 = UnityTool.FindAllChild(mPlayer2); mButton_Exit = UITool.FindChild <Button>(canvas, "Button_Exit"); mButton_Exit.onClick.AddListener(OnExitButtonClickOn); mButton_Ready = UITool.FindChild <Button>(mPanel, "ReadyButton"); mButton_Ready.onClick.AddListener(OnReadyButtonClickOn); mImage = canvas.GetComponent <Image>(); canvas.SetActive(false); //canvas.GetComponent<Canvas>().sortingOrder = 0; }