//选择改变颜色的片 public void selectPiece(Vector3 pos) { Ray ray = Camera.main.ScreenPointToRay(pos); RaycastHit hit; if (Physics.Raycast(ray, out hit) && hit.collider.gameObject.tag == "Piece" && is_slt_color) { PieceFactory pf = Singleton <PieceFactory> .Instance; used_step += pf.SetPieceColor(hit.collider.gameObject, slt_color); if (pf.isOneColor()) { if (used_step > max_step) { maintext.text = "Pass But Overstep"; } else { maintext.text = "Perfect!"; } } } }