[SerializeField]
private Text warning;
Color color ;warningOpen("注册成功", closeTime: 1.5f);warningOpen("登录成功", "green", 1.5f);public void warningOpen( string warn, string tmp="red", float closeTime=5f ){warning.text = warn;warning.color = getColor(tmp);warningPanel.SetActive(true);Invoke("warningClose", closeTime);}public Color getColor(string tmp){if (tmp == "green"){color = Color.green;}else {color = Color.red;}return color;}