//Set up the position of the new car, its speed, etc. private void setupNewTerrain(GameObject terrain) { MiscObjectMover mover = terrain.AddComponent <MiscObjectMover> (); mover.levelSceneController = levelSceneController; mover.setVelocity(SceneConstants.BASE_OBJECT_VELOCITY); }
//A new bridge object gets a MiscObjectMover component attached to it to move it through the scene private void setupNewBridge(GameObject bridge) { MiscObjectMover mover = bridge.GetComponent <MiscObjectMover> (); mover.setVelocity(SceneConstants.BASE_OBJECT_VELOCITY); float width = Random.Range(1.0f, 4f); bridge.transform.localScale = new Vector3(1, 1, width); }
//Might not actually be anim public void anim_triggerPlanetWarp() { MiscObjectMover mover = currentPlanet.AddComponent <MiscObjectMover> (); isWarpingToPlanet = true; }