public void StartGeneration() { gamestarted = true; if (this.activeBottomPlatforms.Count == 0) { GameObject x = (GameObject)GameObject.Instantiate(this.PathBottomPlatforms[0], new Vector3(0, -3f, 0), Quaternion.identity); x.tag = bottomPlatformTag; // x.gameObject.tag = "BottomPlatform"; this.activeBottomPlatforms.Add(x); } if (this.activeLeftPlatforms.Count == 0) { Quaternion leftRotate = Quaternion.AngleAxis(90, Vector3.forward); GameObject x = (GameObject)GameObject.Instantiate(this.PathLeftPlatforms[0], new Vector3(-3f, 0f, 0), leftRotate); x.tag = leftPlatformTag; // x.gameObject.tag = "LeftPlatform"; this.activeLeftPlatforms.Add(x); } if (this.activeTopPlatforms.Count == 0) { Quaternion topRotate = Quaternion.AngleAxis(180, Vector3.forward); GameObject x = (GameObject)GameObject.Instantiate(this.PathTopPlatforms[0], new Vector3(0, 3f, 0), topRotate); //x.gameObject.tag = "TopPlatform"; x.tag = topPlatformTag; this.activeTopPlatforms.Add(x); } if (this.activeRightPlatforms.Count == 0) { Quaternion rightRotate = Quaternion.AngleAxis(-90, Vector3.forward); GameObject x = (GameObject)GameObject.Instantiate(this.PathRightPlatforms[0], new Vector3(3f, 0, 0), rightRotate); //x.gameObject.tag = "RightPlatform"; x.tag = rightPlatformTag; this.activeRightPlatforms.Add(x); } beginning = true; for (int i = 0; i < 2; i++) { GenerateSafePlatforms(); } beginning = false; startPlaneObject.SetActive(false); HandGestureTrigger bm = handgestureControloer.GetComponent <HandGestureTrigger>(); bm.StartGameHandTracking(); }
void Awake() { // Setup the UI GameObject stui = GameObject.Find("ScoreText"); scoreText = stui.GetComponent <Text>(); GameObject edui = GameObject.Find("FinalScoreText"); finalScoreText = edui.GetComponent <Text>(); GameObject kText = GameObject.Find("KinectText"); kinectConnectedText = kText.GetComponent <Text>(); GameObject oText = GameObject.Find("OculusText"); oculusConnectedText = oText.GetComponent <Text>(); GameObject ovrcanvas = GameObject.Find("UICanvas"); startAnim = ovrcanvas.GetComponent <Animator>(); score = 0; GameObject es = GameObject.Find("EventSystem"); lookInput = es.GetComponent <LookInputModule>(); //Disable Game over Button GameObject gameOverButton = GameObject.Find("RestartButton"); Button b = gameOverButton.GetComponent <Button>(); gameOverButton.SetActive(false); //Setup Player platformController = GameObject.Find("PlatformController"); testSpawner = platformController.GetComponent <TestSpawner>(); player = GameObject.Find("FPSPreFab"); infinitePlayerController = player.GetComponent <InfinitePlayerController>(); playerHealth = player.GetComponent <PlayerHealthController>(); //Setup Kinect bodyManagerComponent = bodyManager.GetComponent <BodySourceManager>(); handManagerComponent = handController.GetComponent <HandGestureTrigger>(); //Setup Oculus GameObject ovrCameraRig = GameObject.Find("OVRCameraRig"); oculusOVRManager = ovrCameraRig.GetComponent <OVRManager>(); problemSolverObject = GameObject.Find("ProblemSolver"); }
void Awake () { // Setup the UI GameObject stui = GameObject.Find("ScoreText"); scoreText = stui.GetComponent<Text>(); GameObject edui = GameObject.Find("FinalScoreText"); finalScoreText = edui.GetComponent<Text>(); GameObject kText = GameObject.Find("KinectText"); kinectConnectedText = kText.GetComponent<Text>(); GameObject oText = GameObject.Find("OculusText"); oculusConnectedText = oText.GetComponent<Text>(); GameObject ovrcanvas = GameObject.Find("UICanvas"); startAnim = ovrcanvas.GetComponent<Animator>(); score = 0; GameObject es = GameObject.Find("EventSystem"); lookInput = es.GetComponent<LookInputModule>(); //Disable Game over Button GameObject gameOverButton = GameObject.Find("RestartButton"); Button b = gameOverButton.GetComponent<Button>(); gameOverButton.SetActive(false); //Setup Player platformController = GameObject.Find("PlatformController"); testSpawner = platformController.GetComponent<TestSpawner>(); player = GameObject.Find("FPSPreFab"); infinitePlayerController = player.GetComponent<InfinitePlayerController>(); playerHealth = player.GetComponent<PlayerHealthController>(); //Setup Kinect bodyManagerComponent = bodyManager.GetComponent<BodySourceManager>(); handManagerComponent = handController.GetComponent<HandGestureTrigger>(); //Setup Oculus GameObject ovrCameraRig = GameObject.Find("OVRCameraRig"); oculusOVRManager = ovrCameraRig.GetComponent<OVRManager>(); problemSolverObject = GameObject.Find("ProblemSolver"); }