//二级旋钮
public void TwoStateClick(GameObject game) { CheckState = !CheckState; if (CheckState == false) { //左转,默认状态 game.GetComponent<Image>().transform.localEulerAngles = new Vector3(0, 0, 45); SockServer.SendMsg(SocketProtocol.V_Power_Off); Debug.Log("电源开关初始/关闭状态!" + SocketProtocol.V_Power_Off); } if (CheckState) { //右转,开启状态 game.GetComponent<Image>().transform.localEulerAngles = new Vector3(0, 0, -45); SockServer.SendMsg(SocketProtocol.V_Power_On); Debug.Log("电源开关开启状态!" + SocketProtocol.V_Power_On); } }