// Use this for initialization void Start() { NUL_jug = 0; chs = Chose.FirstC; obj_All[(int)Chose.FirstC].SetActive(true); obj_All[(int)Chose.Setting].SetActive(false); DontDestroyOnLoad(obj_config); }
public void UpdateChose(Chose tep) { if (chs != tep && NUL_jug == 0) { NUL_jug = 1; int temp = (int)chs; chs = tep; //此时temp为以前选择,chs为改变选择 //temp绕 y 轴顺时针旋转90度后设置为false后设置为-90,chs绕y轴顺时针90度后rotate设置为0 StartCoroutine(Rotate(temp, (int)chs)); //obj_All[(int)chs] 设为true 后旋转90度 //allobj.transform. } }
public bool GetTurn(Chose chose, int xPos, int yPos) { if (xPos > field.GetLength(0) || xPos < 0 || yPos > field.GetLength(1) || yPos < 0) { Console.WriteLine("Ход вне поля"); return(false); } if (field[xPos, yPos] == 0) { field[xPos, yPos] = chose; CheckWinner(); return(true); } else { Console.WriteLine("Эта клетка занята"); } return(false); }