public void ExecuteCommand() //执行命令 { print(CommandList.GetChild(selectIndex).name); if (CommandList.GetChild(selectIndex).GetComponent <UILabel>().text.Equals("待命")) { commander.AwaitOrders(); } if (CommandList.GetChild(selectIndex).GetComponent <UILabel>().text.Equals("攻击")) { //Attack Command here } if (CommandList.GetChild(selectIndex).GetComponent <UILabel>().text.Equals("结束")) { //End Command here } selectIndex = 0; }