GUISkin and CustomEditor

Hey there,

Is there something special I have to do to get a GUISkin working in a custom editor? I currently have the code:

using UnityEditor;
using UnityEngine;
using System.Collections;

[CustomEditor(typeof(TexturedObjectCS))]
public class TexturedObjectEditorCS : Editor
{
    public override void OnInspectorGUI()
    {		
		GUI.skin = new EditorSkin();

…but it’s not working. It’s giving me an error about converting EditorSkin to GUISkin. All of the documentation, however, indicates that this should work. I created a skin by going Assets > Create > GUI Skin and named it EditorSkin.

Okay, I got it sorted. You have to load the GUISkin resource for some reason. I might look into the details later.

Instead of

GUI.skin = new EditorSkin();

I had to use

GUI.skin = (GUISkin)(Resources.LoadAssetAtPath("Assets/EditorSkin.guiskin", typeof(GUISkin)));

Awesome.