void Awake() { instance = this; exitSide = (rnd.Next(2) % 2 == 0) ? ExitSide.E_LEFT : ExitSide.E_RIGHT; Debug.Log(exitSide.ToString()); MakeBlocks(); }
// current coordinate to check, whether to make cube. private bool CreateExitGate(ExitSide side, int i, int j) { bool isOk = false; int halfPos = width >> 1; switch (side) { case ExitSide.E_LEFT: if ((j == 0 && i == halfPos) || (j == (height - 2) && i == 0)) { isOk = true; } break; case ExitSide.E_RIGHT: if ((j == 0 && i == halfPos) || (j == (height - 2) && i == (width - 1))) { isOk = true; } break; default: Debug.LogError("exit type error"); break; } return(isOk); }