コード例 #1
0
    void Start()
    {
        // We copy the GUIAssets to prevent permenant changes to the assets.
        titleScreen_Splash = titleScreen_Splash.Copy();
        titleScreen_Menu   = titleScreen_Menu.Copy();

        // Get the GUIDrawTexture control using the Find<T> method.
        textureControl = titleScreen_Splash.Find <GUIDrawTexture>("Texture");
        // Set the first splash image.
        textureControl.image = splashes[0];

        // Get the buttons using Find<T>.
        buttonNew  = titleScreen_Menu.Find <GUIButton>("New Button");
        buttonLoad = titleScreen_Menu.Find <GUIButton>("Load Button");
        buttonQuit = titleScreen_Menu.Find <GUIButton>("Quit Button");

        // Prepare to display the splash screen.
        splashCounter = 0;
        splashID      = 0;
        showSplash    = true;

        // Prepare the menu to move from below the screen to the center.
        menuEndPosition             = titleScreen_Menu.position;
        titleScreen_Menu.position.x = menuEndPosition.x = (Screen.width - titleScreen_Menu.position.width) / 2;
        titleScreen_Menu.position.y = Screen.height;
        menuEndPosition.y           = (Screen.height - titleScreen_Menu.position.height) / 2;

        // Set the splash screen to the center.
        titleScreen_Splash.position.x = (Screen.width - titleScreen_Splash.position.width) / 2;
        titleScreen_Splash.position.y = (Screen.height - titleScreen_Splash.position.height) / 2;
    }
コード例 #2
0
    void Start()
    {
        // We copy the GUIAssets to prevent permenant changes to the assets.
        titleScreen_Splash = titleScreen_Splash.Copy();
        titleScreen_Menu = titleScreen_Menu.Copy();

        // Get the GUIDrawTexture control using the Find<T> method.
        textureControl = titleScreen_Splash.Find<GUIDrawTexture>("Texture");
        // Set the first splash image.
        textureControl.image = splashes[0];

        // Get the buttons using Find<T>.
        buttonNew = titleScreen_Menu.Find<GUIButton>("New Button");
        buttonLoad = titleScreen_Menu.Find<GUIButton>("Load Button");
        buttonQuit = titleScreen_Menu.Find<GUIButton>("Quit Button");

        // Prepare to display the splash screen.
        splashCounter = 0;
        splashID = 0;
        showSplash = true;

        // Prepare the menu to move from below the screen to the center.
        menuEndPosition = titleScreen_Menu.position;
        titleScreen_Menu.position.x = menuEndPosition.x = (Screen.width - titleScreen_Menu.position.width) / 2;
        titleScreen_Menu.position.y = Screen.height;
        menuEndPosition.y = (Screen.height - titleScreen_Menu.position.height) / 2;

        // Set the splash screen to the center.
        titleScreen_Splash.position.x = (Screen.width - titleScreen_Splash.position.width) / 2;
        titleScreen_Splash.position.y = (Screen.height - titleScreen_Splash.position.height) / 2;
    }