Ejemplo n.º 1
0
        private bool flag = true;    //true:将要缩小	false:将要放大

        void Awake()
        {
            if (battlefieldUI != null)
            {
                Destroy(gameObject);
                return;
            }
            battlefieldUI = this;
            buttonText    = GameObject.Find("buttonText").GetComponent <Text>();
            connectButton = GameObject.Find("connectButton");
            text_Pretext  = GameObject.Find("PreText").GetComponent <Text>();
        }
Ejemplo n.º 2
0
 public void click_connect()
 {
     if (text_Button_Connect.text == "连接")
     {
         manager.networkAddress = text_IpAddress.text;
         manager.StartClient();
         text_Station.text = "连接中";
     }
     else if (text_Button_Connect.text == "退出房间")
     {
         manager.StopClient();
         manager.StopHost();
         SceneManager.LoadScene(SceneManager.GetActiveScene().name);
         BattlefieldUI.initializeAll();
         Destroy(GameObject.Find("AudioManager").gameObject);
         Transform temp_Transform = Instantiate(AudioManagerTransform);
         temp_Transform.name = "AudioManager";
         GameObject.Find("BGM").GetComponent <AudioSource>().Play();
         //manager = GameObject.Find("NetworkManager").GetComponent<NetworkManager>();
     }
 }