Search Unity

Resources.Load GUIStyles?

Discussion in 'Immediate Mode GUI (IMGUI)' started by Faestus, Jul 28, 2015.

  1. Faestus

    Faestus

    Joined:
    Jul 23, 2014
    Posts:
    68
    So I tried doing this:
    Resources.Load<GUIStyle>("myGUI");
    and it says that GUIStyle cannot be loaded.

    Is there a way to load GUIStyles from the Resources folder?
     
  2. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    I think you want to load a GUISkin instead, right?
    var mySkin = Resources.Load("MyGuiSkin") as GUISkin
    And to get your GUIStyle from that, use mySkin.GetStyle(), or one of the premade ones like .button or .box