void OnTriggerStay2D(Collider2D c) { PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> (); if (p) { p.bonusState = PlanePhysics.BonusState.DOWNCLOUD; } }
void OnTriggerExit2D(Collider2D c) { PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> (); if (p) { p.bonusState = PlanePhysics.BonusState.NONE; } }
void OnTriggerEnter2D(Collider2D c) { PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> (); if (p) { p.handleMongolfiere(); } }
void OnTriggerEnter2D(Collider2D c) { PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> (); if (p) { p.GetComponentInParent <MainGame>().state = MainGame.State.END_LOOSE; } }
void Start() { planePhysic = plane.GetComponent<PlanePhysics>(); int maxSucces = PlayerPrefs.GetInt (Constants.PROPULSION_GAME_MAX_WON); state = State.INACTIVE; foreach (GameObject behavior in fuelBars) { fuelBarBehaviors.Add(behavior.GetComponent<FuelBarScript>()); } for (int i=0; i<(3-maxSucces); i++) { fuelBarBehaviors.RemoveAt(fuelBarBehaviors.Count -1); } foreach (FuelBarScript fuelBar in fuelBarBehaviors) { fuelBar.show(); } }
void Start() { planePhysic = plane.GetComponent <PlanePhysics>(); int maxSucces = PlayerPrefs.GetInt(Constants.PROPULSION_GAME_MAX_WON); state = State.INACTIVE; foreach (GameObject behavior in fuelBars) { fuelBarBehaviors.Add(behavior.GetComponent <FuelBarScript>()); } for (int i = 0; i < (3 - maxSucces); i++) { fuelBarBehaviors.RemoveAt(fuelBarBehaviors.Count - 1); } foreach (FuelBarScript fuelBar in fuelBarBehaviors) { fuelBar.show(); } }
// Use this for initialization void Start() { scenario = new Scenario(); objectif = scenario.getObjectif(); Time.timeScale = 1; scriptIntroControl = this.GetComponent <IntroControl> (); scriptIntroControl.enabled = true; scriptIntroState = plane.GetComponent <IntroState> (); scriptIntroState.enabled = true; //intro script activation state = State.INTRO; scriptPlanePhysics = plane.GetComponent <PlanePhysics> (); scriptPlanePhysics.enabled = false; scriptSlidingBackground = backgrounds.GetComponent <SlidingBackground>(); scriptRandomObject = this.GetComponent <RandomObject> (); scriptRandomObject.enabled = false; scriptFuelControl = GetComponent <FuelControl>(); scriptFuelControl.enabled = true; prevY = scriptPlanePhysics.transform.position.y; isPause = false; guiBestScore.value = PlayerPrefs.GetInt(Constants.MAIN_GAME_HIGH_SCORE); tutoScript = tutoPref.GetComponent <GenericTutoScript>(); if (PlayerPrefs.GetInt(Constants.MAIN_GAME_ALREADY_PLAYED) == 0) { bouttonPause.GetComponent <Image> ().enabled = false; firstPlayTuto(); PlayerPrefs.SetInt(Constants.MAIN_GAME_ALREADY_PLAYED, 1); } else if (!scenario.isFinished()) { displayObjectif(); } }
// Use this for initialization void Start() { scenario = new Scenario (); objectif = scenario.getObjectif(); Time.timeScale = 1; scriptIntroControl = this.GetComponent<IntroControl> (); scriptIntroControl.enabled = true; scriptIntroState = plane.GetComponent<IntroState> (); scriptIntroState.enabled = true; //intro script activation state = State.INTRO; scriptPlanePhysics = plane.GetComponent<PlanePhysics> (); scriptPlanePhysics.enabled = false; scriptSlidingBackground = backgrounds.GetComponent<SlidingBackground>(); scriptRandomObject = this.GetComponent<RandomObject> (); scriptRandomObject.enabled = false; scriptFuelControl = GetComponent<FuelControl>(); scriptFuelControl.enabled = true; prevY = scriptPlanePhysics.transform.position.y; isPause = false; guiBestScore.value = PlayerPrefs.GetInt (Constants.MAIN_GAME_HIGH_SCORE); tutoScript = tutoPref.GetComponent<GenericTutoScript>(); if (PlayerPrefs.GetInt (Constants.MAIN_GAME_ALREADY_PLAYED) == 0) { bouttonPause.GetComponent<Image> ().enabled = false; firstPlayTuto (); PlayerPrefs.SetInt (Constants.MAIN_GAME_ALREADY_PLAYED, 1); } else if (! scenario.isFinished()){ displayObjectif(); } }
// Use this for initialization void Start() { PlanePhysics physics = (PlanePhysics)GetComponent("PlanePhysics"); }