void Awake() { aerodynamics = GetComponent <PlayerAerodynamicsController>(); sparkleController = GameObject.Find("SparkleRising").gameObject.GetComponent <SparkleController>(); turbineBoost = GetComponent <TurbineBoost>(); windBoost = GetComponent <WindBoost>(); }
void LoadLevel() { for (int i = 0; i < Levels.Length; i++) { Levels[i].LevelObject.SetActive(i == gameStatus.Level); } level = Levels[gameStatus.Level]; WindBoost windBoost = player.GetComponent <WindBoost>(); windBoost.infiniteBoost = DebugOn ? InfiniteBoost : level.InfiniteBoost; windBoost.boostDuration = level.BoostDuration; windBoost.StartBoost = level.StartBoost; PlayerAerodynamicsController dynamics = player.GetComponent <PlayerAerodynamicsController>(); if (level.OverrideDynamics) { if (level.Gravity != 0) { dynamics.Gravity = level.Gravity; } if (level.Mass != 0) { dynamics.Mass = level.Mass; } if (level.cdBottom != 0) { dynamics.cdBottom = level.cdBottom; } if (level.cdFront != 0) { dynamics.cdFront = level.cdFront; } if (level.cdRight != 0) { dynamics.cdRight = level.cdRight; } if (level.LiftCoefficient != 0) { dynamics.LiftCoefficient = level.LiftCoefficient; } } levelStats.Completed = false; levelStats.LevelName = LevelNames.Names[gameStatus.Level]; }
// Use this for initialization void Start() { Physics.gravity = new Vector3(0, -Gravity, 0); rigidbody.mass = Mass; float tmp = rigidbody.mass / 250; rigidbody.inertiaTensor = new Vector3(tmp, tmp, tmp); rigidbody.centerOfMass = new Vector3(0, 0, 0); redCube = Instantiate(redCubePrefab) as GameObject; greenCube = Instantiate(greenCubePrefab) as GameObject; yellowCube = Instantiate(yellowCubePrefab) as GameObject; blueCube = Instantiate(blueCubePrefab) as GameObject; windBoost = GetComponent <WindBoost>(); WindAudio.Play(); WindAudio.volume = 0; //rigidbody.velocity = new Vector3(0, -10f, 0); }
void Awake() { windBoost = GetComponent <WindBoost>(); }
void Awake() { windBoost = GameObject.FindGameObjectWithTag("Player").GetComponent <WindBoost>(); }
void Awake() { instance = this; player = GameObject.FindGameObjectWithTag("Player"); windBoost = player.GetComponent <WindBoost>(); }