// Use this for initialization void Start() { Triggered = false; _sentTrigger = false; if (_toggleWall == null) { _toggleWall = transform.parent.GetComponent <ToggleWall>(); } }
// Start is called before the first frame update void Start() { gc = GameController.Instance; winTimer = 0; audioManager = GetComponent <AudioManager>(); moveCounter = 0; animationMode = false; // Get all boards GameObject[] boardList = GameObject.FindGameObjectsWithTag("Board"); boards = new BoardController[boardList.Length]; finishedStatus = new bool[boardList.Length]; for (int i = 0; i < boardList.Length; ++i) { BoardController tmp = boardList[i].GetComponent <BoardController>(); boards[tmp.boardNumber - 1] = tmp; tmp.ballIndicator.Initialize(boardList.Length, tmp.boardNumber - 1); } activateBoard(1); // Walls tWalls = new List <ToggleWall> [4]; for (int i = 0; i < 4; ++i) { tWalls[i] = new List <ToggleWall>(); } GameObject[] walls = GameObject.FindGameObjectsWithTag("ToggleWall"); foreach (GameObject o in walls) { ToggleWall tw = o.GetComponent <ToggleWall>(); tWalls[tw.type - 1].Add(tw); } // Buttons pressables = new List <Pressable>(); GameObject[] ps = GameObject.FindGameObjectsWithTag("Button"); foreach (GameObject p in ps) { Pressable prs = p.GetComponent <OneOffButton>(); if (!prs) { prs = p.GetComponent <PressurePlate>(); } pressables.Add(prs); } }
public Wall(ToggleWall wall) { this.wall = wall; }