public void startLevel(GameObject f) { fpsconstroller.SetActive(true); cam.enabled = true; audio_this.enabled = true; room3_controller = GameObject.Find("Room3").GetComponent <Room3Controller>(); maze_block = GameObject.Find("Room2/MazeCube"); maze_block.SetActive(true); portalA = GameObject.Find("Room2/PortalA").GetComponent <Room2PortalA>(); portalB = GameObject.Find("Room2/PortalB").GetComponent <Room2PortalB>(); portalC = GameObject.Find("Room2/PortalC").GetComponent <Room2PortalC>(); portalD = GameObject.Find("Room2/PortalD").GetComponent <Room2PortalD>(); light_cube = GameObject.Find("Room2/LightCube").GetComponent <LightCubeController>(); light_cube.setMaterial(1); portalA.init(); portalB.init(); portalC.init(); portalD.init(); //Debug.Log(f.transform.localPosition.y); portalA.init_place(f); isbegin = false; ms = GameObject.Find("MainCanvas").GetComponent <MainCanvasSet2>(); delay_lim = ms.delay_lim; key = ms.key; }
public void checkChoice(int choice) { if (choice == steps[step]) { step += 1; if (step == steps.Length) { nextLevel(); return; } } else { step = 0; } Debug.Log("choice:" + choice.ToString() + " step:" + step.ToString() + " nextdir:" + steps[step].ToString()); if (step == 0) { maze_block.SetActive(true); light_cube.setMaterial(1); } else if (step == 6) { maze_block.SetActive(true); light_cube.setMaterial(2); } else { if (step == 14) { light_cube.setMaterial(3); } maze_block.SetActive(false); } }