void Start() { cgController = new GameLogicController(); cgController.Initialize(); cgController.OnLose(Lose); cgController.Player.OnHealthChanged(OnHealthChanged); cgController.Player.OnScoreChanged(OnScoreChanged); cgController.GenerateFirstSlabsStack(); viewSlabArray = new GameObject[cgController.MAX_SIZE, cgController.MAX_SIZE]; viewValueSlab = new int[cgController.MAX_SIZE, cgController.MAX_SIZE]; viewHealthList = new List <GameObject>(); for (int i = 0; i < cgController.MAX_SIZE; i++) { for (int j = 0; j < cgController.MAX_SIZE; j++) { viewSlabArray[i, j] = InitializeSlab(i, j); cgController.Slabs[i, j].OnKill(OnKill); cgController.Slabs[i, j].OnIndexChanged(OnIndexChanged); cgController.Slabs[i, j].OnTeleported(OnSlabTeleported); } } for (int i = 0; i < cgController.Player.HealthPoint; i++) { viewHealthList.Add(Instantiate(healthPrefab)); viewHealthList[i].transform.SetParent(parentHealth); viewHealthList[i].transform.localScale = Vector3.one; } }