public void InstantiatePair() { puyoPair = new GameObject[2]; direction = PuyoDirection.NORTH; if (isControlled == true) { puyoPair[0] = RandomPuyo(new Vector3(-9.5f, 6.5f, 0)); puyoPair[0].GetComponent <Puyo>().State = Puyo.PuyoState.IN_PLAY; puyoPair[1] = RandomPuyo(new Vector3(-9.5f, 5.5f, 0)); puyoPair[1].GetComponent <Puyo>().State = Puyo.PuyoState.IN_PLAY; } if (isControlled == false) { puyoPair[0] = RandomPuyo(new Vector2(-4.5f, 6.5f)); puyoPair[1] = RandomPuyo(new Vector3(-4.5f, 5.5f, 0)); } }
private void GetInput() { if (Input.GetKeyDown(KeyCode.Alpha2)) //Rotate counter-clockwise { if (direction == PuyoDirection.SOUTH) { direction = PuyoDirection.EAST; } else if (direction == PuyoDirection.WEST) { direction = PuyoDirection.NORTH; } else if (direction == PuyoDirection.NORTH) { direction = PuyoDirection.WEST; } else if (direction == PuyoDirection.EAST) { direction = PuyoDirection.NORTH; } } if (Input.GetKeyDown(KeyCode.Alpha1)) //Rotate clockwise { if (direction == PuyoDirection.SOUTH) { direction = PuyoDirection.WEST; } else if (direction == PuyoDirection.EAST) { direction = PuyoDirection.SOUTH; } else if (direction == PuyoDirection.NORTH) { direction = PuyoDirection.EAST; } else if (direction == PuyoDirection.WEST) { direction = PuyoDirection.NORTH; } } }