// Context for connecting the edges upon folding void Update() { string sceneName = SceneManager.GetActiveScene().name; if (sceneName == "Level1") { if (faces[0].IsFolded && faces[1].IsFolded) { EdgeWall.PairWalls(faces[0].Edges[0], faces[1].Edges[0]); } else { faces[0].Edges[0].Pair = null; faces[1].Edges[0].Pair = null; } } else if (sceneName == "Level2") { if (faces[0].IsFolded && faces[1].IsFolded && faces[2].IsFolded && faces[3].IsFolded && faces[4].IsFolded && faces[5].IsFolded && faces[6].IsFolded) { EdgeWall.PairWalls(faces[2].Edges[0], faces[6].Edges[0]); } else { EdgeWall.UnPairWalls(faces[2].Edges[0], faces[6].Edges[0]); } } }
protected override void AddEdgeWall(Point position) { var edgeWall = new EdgeWall(position); _edgeWallList.Add(edgeWall); base.AddEdgeWall(edgeWall); }
public static void UnPairWalls(EdgeWall wall1, EdgeWall wall2) { wall1.Pair = null; wall2.Pair = null; }
// Helper function to pair walls public static void PairWalls(EdgeWall wall1, EdgeWall wall2) { wall1.Pair = wall2; wall2.Pair = wall1; }