示例#1
0
    void OnTriggerStay2D(Collider2D c)
    {
        PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> ();

        if (p)
        {
            p.bonusState = PlanePhysics.BonusState.DOWNCLOUD;
        }
    }
示例#2
0
    void OnTriggerExit2D(Collider2D c)
    {
        PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> ();

        if (p)
        {
            p.bonusState = PlanePhysics.BonusState.NONE;
        }
    }
示例#3
0
    void OnTriggerEnter2D(Collider2D c)
    {
        PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> ();

        if (p)
        {
            p.handleMongolfiere();
        }
    }
示例#4
0
    void OnTriggerEnter2D(Collider2D c)
    {
        PlanePhysics p = c.gameObject.GetComponent <PlanePhysics> ();

        if (p)
        {
            p.GetComponentInParent <MainGame>().state = MainGame.State.END_LOOSE;
        }
    }
示例#5
0
    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();
        }
    }
示例#6
0
    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();
        }
    }
示例#7
0
    // 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();
        }
    }
示例#8
0
    // 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();
        }
    }
示例#9
0
 // Use this for initialization
 void Start()
 {
     PlanePhysics physics = (PlanePhysics)GetComponent("PlanePhysics");
 }