void Start() { if (ChatPanel == null) { this.ChatPanel = this.transform.Find("Scroll View/Viewport/Content").gameObject; } GameObject[] objs = GameObject.FindGameObjectsWithTag("room_connector"); foreach (var t in objs) { Debug.Log(t.name); this.connecter = t.GetComponent <RoomServiceConn>(); } if (this.ChatInput == null) { this.ChatInput = this.transform.Find("InputField").GetComponent <InputField>(); } }
void room_connector_load() { // room-connector Debug.Log("RoomWaitCtl"); GameObject[] objs = GameObject.FindGameObjectsWithTag("room_connector"); Debug.Log("objs:" + objs.Length); foreach (var t in objs) { Debug.Log(t.name); this.Connecter = t.GetComponent <RoomServiceConn>(); } Debug.Log("this.Connecter:" + this.Connecter == null); if (this.Connecter.IsWatcher) { ChangeDeckBtn.SetActive(false); ChangeSettingBtn.SetActive(false); } else { if (!this.Connecter.IsHost) { ChangeSettingBtn.SetActive(false); } } Debug.Log(this.Connecter.CurrentRoom.Key); Debug.Log(this.Connecter.CurrentRoom); if (this.Connecter.CurrentRoom.Host != null) { HostName.text = this.Connecter.CurrentRoom.Host.Name; HostLv.text = this.Connecter.CurrentRoom.Host.Level.ToString(); HostStatus.text = ""; } if (this.Connecter.CurrentRoom.Dueler != null) { DuelerName.text = this.Connecter.CurrentRoom.Dueler.Name; DuelerLv.text = this.Connecter.CurrentRoom.Dueler.Level.ToString(); DuelerStatus.text = ""; } updatePanel_init(this.Connecter.CurrentRoom); OnConnecterUpdate(); }
void Start() { if (this.Connecter == null) { GameObject[] objs = GameObject.FindGameObjectsWithTag("room_connector"); this.Connecter = objs[0].GetComponent <RoomServiceConn>(); } this.TotalCost.OnValueChanged.AddListener((float min, float max) => { TTCostMax.text = "(Current:" + (Mathf.RoundToInt(max) * 10).ToString() + ")"; TTCostMin.text = "(Current:" + (Mathf.RoundToInt(min) * 10).ToString() + ")"; }); this.CardCost.OnValueChanged.AddListener((float min, float max) => { CCMax.text = "(Current:" + (Mathf.RoundToInt(max)).ToString() + ")"; CCMin.text = "(Current:" + (Mathf.RoundToInt(min)).ToString() + ")"; }); setting = ConfigContainer.LoadCfFile(ConfigPath.StreamingAsset).remote; this.Connecter.InitSetup(setting); this.RefetchRoomList(); }