private void HandleChangeSwitchStatus(string[] msg) { if (NotInClientScene()) { int groupId = Int32.Parse(msg[1]); int individualId = Int32.Parse(msg[2]); bool on = bool.Parse(msg[3]); SwitchManager manager = GameObject.FindObjectOfType <SwitchManager>(); Switch switchi = manager.GetSwitch(groupId, individualId); switchi.ReceiveDataFromServer(on); } }
private void HandleChangeSwitchStatus(string[] msg) { Scene currentScene = SceneManager.GetActiveScene(); if (currentScene.name == "ClientScene") { return; } int groupId = Int32.Parse(msg[1]); int individualId = Int32.Parse(msg[2]); bool on = bool.Parse(msg[3]); SwitchManager manager = GameObject.FindGameObjectWithTag("SwitchManager").GetComponent <SwitchManager>(); Switch switchi = manager.GetSwitch(groupId, individualId); switchi.ReceiveDataFromServer(on); }