Пример #1
0
    /// <summary>
    /// Awake this instance.
    /// </summary>
    void Awake()
    {
        //StartMenuReplay ();

        //Andere Menu teile laden
        _highscore = this.GetComponent <GuiHighscoreMenu> ();
        _credits = this.GetComponent <GuiCreditsMenu> ();

        //Texturen und Fonts laden
        _texMenuBackground = Resources.Load<Texture2D> ("GUI/Textures/TexGuiBackground");
        _texMenuButton = Resources.Load<Texture2D> ("GUI/Textures/TexGuiButton");
        _texMenuButtonHover = Resources.Load<Texture2D> ("GUI/Textures/TexGuiButtonHover");
        _texMenuTextfield = Resources.Load<Texture2D> ("GUI/Textures/TexGuiTextfield");
        _texMenuBackground2 = Resources.Load<Texture2D> ("GUI/Textures/TexGuiScoreBackground");
        _font = Resources.Load <Font> ("GUI/Fonts/FntDigitalNumbers");

        //Texture assigned?
        if (!_texMenuBackground)
        {
            Debug.LogError("Can't find Texture 'TexGuiBackground' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMenuButton)
        {
            Debug.LogError("Can't find Texture 'TexGuiButton' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMenuButtonHover)
        {
            Debug.LogError("Can't find Texture 'TexGuiButtonHover' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMenuTextfield)
        {
            Debug.LogError("Can't find Texture 'TexGuiTextfield' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMenuBackground2)
        {
            Debug.LogError("Can't find Texture 'TexGuiScoreBackground' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Font assigned?
        if (!_font)
        {
            Debug.LogError("Can't find Font 'FntDigitalNumbers' on path 'Resources/GUI/Textures'");
            return;
        }
    }
Пример #2
0
    // Use this for initialization
    private void Awake()
    {
        //Aktives Menu auf Standard einstellen
        _activeMenu = ActiveMenu.START;

        //Andere Menu teile laden
        _highscore = this.GetComponent <GuiHighscoreMenu> ();
        _credits = this.GetComponent <GuiCreditsMenu> ();

        //Texturen und Fonts laden
        _texMenuBackground = Resources.Load<Texture2D> ("GUI/Textures/TexGuiBackground");
        _texMenuButton = Resources.Load<Texture2D> ("GUI/Textures/TexGuiButton");
        _texMenuButtonHover = Resources.Load<Texture2D> ("GUI/Textures/TexGuiButtonHover");
        _texMetalDoorTop = Resources.Load<Texture2D> ("GUI/Textures/TexGuiMetalDoorTop");
        _texMetalDoorBottom = Resources.Load<Texture2D> ("GUI/Textures/TexGuiMetalDoorBottom");
        _font = Resources.Load <Font> ("GUI/Fonts/FntDigitalNumbers");
        _texGuiBackground = Resources.Load<Texture2D> ("GUI/Textures/TexGuiBackground2");
        _texMenuBackground2 = Resources.Load<Texture2D> ("GUI/Textures/TexGuiScoreBackground");

        //Texture assigned?
        if (!_texMenuBackground) {
            Debug.LogError("Can't find Texture 'TexGuiBackground' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMenuButton) {
            Debug.LogError("Can't find Texture 'TexGuiButton' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMenuButtonHover) {
            Debug.LogError("Can't find Texture 'TexGuiButtonHover' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMetalDoorTop) {
            Debug.LogError("Can't find Texture 'TexGuiMetalDoorTop' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMetalDoorBottom) {
            Debug.LogError("Can't find Texture 'TexGuiMetalDoorBottom' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texGuiBackground) {
            Debug.LogError("Can't find Texture 'TexGuiBackground2' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Texture assigned?
        if (!_texMenuBackground2) {
            Debug.LogError("Can't find Texture 'TexGuiScoreBackground' on path 'Resources/GUI/Textures' ");
            return;
        }

        //Font assigned?
        if (!_font) {
            Debug.LogError("Can't find Font 'FntDigitalNumbers' on path 'Resources/GUI/Textures'");
            return;
        }
    }