private void Update() { if (mType != FireworkController.LaunchType.None) { FireworkController.Launch(mType); mType = FireworkController.LaunchType.None; } }
private void Listen() { while (Thread.CurrentThread.IsAlive) { try { if (mClient != null && mEndPoint != null) { byte[] data = mClient.Receive(ref mEndPoint); string text = Encoding.ASCII.GetString(data); int t = 0; if (int.TryParse(text, out t)) { mType = (FireworkController.LaunchType)t; } } } catch (Exception e) { Debug.Log(e.ToString()); } } }