Exemple #1
0
 /// <summary>
 /// Load the first Section
 /// </summary>
 private void LoadFirstSection()
 {
     level1.SetPosition(new Vector2(172.695f, 134.698f));
     level2.SetPosition(new Vector2(203.083f, 299.845f));
     level3.SetPosition(new Vector2(426.098f, 377));
     level4.SetPosition(new Vector2(671.973f, 261.267f));
     level5.SetPosition(new Vector2(755, 465.191f));
 }
    //-------------------------------------------------------------------------
    //						  METHOD DEFINITIONS
    //-------------------------------------------------------------------------
    void Awake()
    {
        // scale and position start and exit button

        StartButton.SetScale(0.5f);

        float w = StartButton.GetWidth();
        float x = (Screen.width - w - 120);
        float y = Screen.height / 3.0f;

        StartButton.SetPosition(new Vector2(x, y));

        ExitButton.SetScale(0.5f);
        w = ExitButton.GetWidth();
        float h = ExitButton.GetHeight();

        x  = (Screen.width - w - 120);
        y += h;

        ExitButton.SetPosition(new Vector2(x, y));

        // set the fader for the buttons
        buttonFader_ = new Fader(0.0f, 2.0f, 0.5f);
        backgFader_  = new Fader(0.0f, 5.0f, 5.0f);
        musicFader_  = new Fader(0.0f, 3.0f, 3.0f);

        // set buttons unclickable in the beginning
        StartButton.SetIsClickable(false);
        ExitButton.SetIsClickable(false);
    }
    //-------------------------------------------------------------------------
    //						CLASS METHOD DEFINITIONS
    //-------------------------------------------------------------------------
    void Awake()
    {
        // position the again button
        AgainButton.SetScale(0.25f);
        ExitButton.SetScale(0.25f);

        float off = 50;

        Vector2 pos = new Vector2();

        pos.x = Screen.width / 2.0f - (AgainButton.GetWidth() + ExitButton.GetWidth() + 50) / 2.0f;
        pos.y = 40.0f;

        AgainButton.SetPosition(pos);

        // position the exit button

        pos.x = Screen.width / 2.0f + (ExitButton.GetWidth()) / 2.0f;
        pos.y = 40.0f;

        ExitButton.SetPosition(pos);

        // set the fading parameters for the beginning fade in of the game
        // over screen
        fader_ = new Fader(0.0f, 3.0f, 3.0f);
        fader_.FadeIn();

        // set the initial update state to fade in
        update_ = fadeIn;
    }
    //-------------------------------------------------------------------------
    void Awake()
    {
        fader = new Fader(0.0f, 3.0f, 0.0f);
        AgainButton.SetScale(0.30f);
        ExitButton.SetScale(0.30f);
        float x = Screen.width - ExitButton.GetWidth();

        AgainButton.SetPosition(new Vector2(x - 405, 655.0f));
        ExitButton.SetPosition(new Vector2(x - 100, 655.0f));
    }