コード例 #1
0
ファイル: MainMenu.cs プロジェクト: naistigd/PreludeToMadness
    //-------------------------------------------------------------------------
    //						  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);
    }