public void ChangeTipsText(TipBtn tip, string key) { switch (tip) { case TipBtn.app: { transform.Find("apptip/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.touchpad: { transform.Find("touchtip/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.home: { transform.Find("hometip/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.volup: { transform.Find("volup/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.voldown: { transform.Find("voldown/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.trigger: { transform.Find("triggertip/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.grip: { transform.Find("grip/btn/Text").GetComponent <Text>().text = key; } break; } }
public void ChangeTipsText(TipBtn tip, string key) { if (tips != null) { switch (tip) { case TipBtn.app: { tips.Find("apptip/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.touchpad: { tips.Find("touchtip/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.home: { tips.Find("hometip/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.volup: { tips.Find("volup/btn/Text").GetComponent <Text>().text = key; } break; case TipBtn.voldown: { tips.Find("voldown/btn/Text").GetComponent <Text>().text = key; } break; } } }