Ejemplo n.º 1
0
    void OnGUI()
    {
        Rect sida1 = new Rect(20, 320, 450, 300);
        Rect sida2 = new Rect(20, 470, 450, 300);
        Rect sida3 = new Rect(20, 620, 450, 300);
        Rect sida4 = new Rect(20, 770, 450, 300);

        GUIStyle style = new GUIStyle();

        style.font              = font;
        style.fontSize          = Size;
        style.normal.background = knapp;
        style.alignment         = TextAnchor.MiddleCenter;
        //GUI.Box(Rect(0, 0, 100, 100), "Sidor:");
        if (GUI.Button(sida1, "Sida 1", style))
        {
            sidan = VilkenSida.sida1;
        }
        if (GUI.Button(sida2, "Sida 2", style))
        {
            sidan = VilkenSida.sida2;
        }
        if (GUI.Button(sida3, "Sida 3", style))
        {
            sidan = VilkenSida.sida3;
        }
        if (GUI.Button(sida4, "Sida 4", style))
        {
            sidan = VilkenSida.sida4;
        }
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     sidan             = VilkenSida.sida1;
     textTitle1        = GameObject.FindGameObjectWithTag("titel1");
     textTitle2        = GameObject.FindGameObjectWithTag("titel2");
     textTitle3        = GameObject.FindGameObjectWithTag("titel3");
     textTitle4        = GameObject.FindGameObjectWithTag("titel4");
     textActualText1   = GameObject.FindGameObjectWithTag("text1");
     textActualText2   = GameObject.FindGameObjectWithTag("text2");
     textActualText3   = GameObject.FindGameObjectWithTag("text3");
     textActualText4   = GameObject.FindGameObjectWithTag("text4");
     textureScreenshot = GameObject.Find("Tutorial_GUITexture_Page2");
     textureGuard      = GameObject.Find("Tutorial_GUITexture_Page3");
     textureParticle   = GameObject.Find("Tutorial_GUITexture_Page4");
 }