Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

GUISkin from example code not working

Discussion in 'Scripting' started by Ogen, Jan 5, 2015.

  1. Ogen

    Ogen

    Joined:
    Sep 2, 2014
    Posts:
    11
    I am looking at this example code: https://github.com/fbsamples/friendsmash-unity

    There is a GUISkin in there called MenuSkin.guiskin which is supposed to emulate a facebook themed dialog.

    I copied that file into my project, assigned it to a GUISkin variable then in my OnGUI I made a simple button like so:

    if (GUI.Button (new Rect(), "hi", MenuSkin.GetStyle("menu_button"))) {

    }

    But the text is just fully white with no facebook themed stuff. Why doesn't it work?
     
  2. starsky135

    starsky135

    Joined:
    Jan 5, 2015
    Posts:
    9
    Try applying the GUISkin globally and see what happens, like this:

    Code (CSharp):
    1. GUI.Skin = skin;
     
    Ogen likes this.
  3. Ogen

    Ogen

    Joined:
    Sep 2, 2014
    Posts:
    11
    That worked, thanks a lot