22 private int textColorId;
27 private TextMesh textMesh;
32 private Material textMaterial;
44 textMesh = gameObject.GetComponentInChildren<TextMesh>();
45 textMaterial = textMesh.GetComponent<MeshRenderer>().material;
46 textColorId = Shader.PropertyToID(
"_Color");
48 if (scrollingUIController == null)
50 Debug.Log(
"without a scrolling UI control, this button can't work");
58 private void OnDestroy()
60 if (textMaterial != null)
62 Destroy(textMaterial);
73 SessionInfo = sessionInfo;
74 if (SessionInfo != null)
76 textMesh.text =
string.Format(
"{0}\n{1}", SessionInfo.SessionName, SessionInfo.SessionIp);
79 textMaterial.SetColor(textColorId, Color.blue);
81 textMesh.color = Color.blue;
85 textMaterial.SetColor(textColorId, Color.yellow);
86 textMesh.color = Color.yellow;