public override void Awake() { base.Awake(); gameOver = false; points = player.GetComponent <Points>(); steps = player.GetComponent <Steps>(); walls = wallMgr.GetComponent <WallsRemaining>(); sceneSwitch = GetComponent <UIGoToScene>(); }
public int GetLevelChunkIndex() { if (WallsRemaining.Count == 0) { return(11); } if (WallsRemaining.Count == 1) { switch (WallsRemaining[0]) { case WallDirection.NORTH: return(1); case WallDirection.EAST: return(2); case WallDirection.SOUTH: return(3); case WallDirection.WEST: return(4); default: throw new KeyNotFoundException("Illegal wall direction: " + WallsRemaining[0]); } } if (WallsRemaining.Count == 2) { if (WallsRemaining.Contains(WallDirection.NORTH) && WallsRemaining.Contains(WallDirection.EAST)) { return(5); } if (WallsRemaining.Contains(WallDirection.NORTH) && WallsRemaining.Contains(WallDirection.SOUTH)) { return(6); } if (WallsRemaining.Contains(WallDirection.NORTH) && WallsRemaining.Contains(WallDirection.WEST)) { return(7); } if (WallsRemaining.Contains(WallDirection.EAST) && WallsRemaining.Contains(WallDirection.SOUTH)) { return(8); } if (WallsRemaining.Contains(WallDirection.EAST) && WallsRemaining.Contains(WallDirection.WEST)) { return(9); } if (WallsRemaining.Contains(WallDirection.SOUTH) && WallsRemaining.Contains(WallDirection.WEST)) { return(10); } } throw new KeyNotFoundException("I can't decide which wall index I am: " + WallsRemaining.Count); }
// Start is called before the first frame update void Start() { walls = wallManager.GetComponent <WallsRemaining>(); walls.addWall(); }
private void Start() { materialCubo = GetComponent <MeshRenderer>(); playerPoints = GetComponentInParent <Points>(); walls = wallManager.GetComponent <WallsRemaining>(); }
private void Start() { walls = wallManager.GetComponent <WallsRemaining>(); }