Beispiel #1
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();
        }
    }
Beispiel #2
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();
        }
    }
    private void displayMessages(string[] messages, GenericTutoScript.StateChangeDelegate outCallback)
    {
        tutoScript.setBubbleVisibility(false);

        tutoScript.readyCallback = delegate() {
            tutoScript.setBubbleVisibility(true);

            tutoScript.say(messages);
        };

        tutoScript.dialogueEndCallback = delegate() {
            tutoScript.setBubbleVisibility(false);
            tutoScript.getOut();
        };

        tutoScript.outCallback = outCallback;

        tutoScript.getIn();
    }