public void RpcResetWalls() { Debug.Log("reset walls rpc"); NextWallToBuild = 0; //foreach deactivate int c = 0; foreach (wallLevels wallLevel in wallLevelGroup) { if (wallLevel.Level.activeInHierarchy) { Debug.Log(wallLevel.Level.transform.childCount); for (int i = 0; i < wallLevel.walls.Count; i++) { Debug.Log("Working on Wall " + i); WallHealth wallScript = wallLevel.walls[i].GetComponent <WallHealth>(); wallScript.CmdTakeDamage1(wallScript.maxHealth); //Why no blob spawn? wallScript.ResetWall(); } BuilderModel[c].SetActive(false); c++; wallLevel.Level.SetActive(false); Debug.Log("Walls turned off"); } } }
public void RpcDeactivateWallLevels() { int c = 0; foreach (wallLevels wallLevel in wallLevelGroup) { if (wallLevel.Level.activeInHierarchy) { Debug.Log(wallLevel.Level.transform.childCount); for (int i = 0; i < wallLevel.walls.Count; i++) { Debug.Log("Working on Wall " + i); WallHealth wallScript = wallLevel.walls[i].GetComponent <WallHealth>(); //Why no blob spawn? wallScript.ResetWall(); } c++; wallLevel.Level.SetActive(false); Debug.Log("Walls turned off"); } } }