Passing in scripts

Hello, i was wanting to know if there was any way to allow passing in scripts to custom editors?

Thanks for clarifying!

I believe you may be able to achieve this by using a combination of 2 classes.

In the EditorGUI class you can use an ObjectField, which will take any UnityEngine.Object (Everything should derive from this class)

Also, the class which represents a Script asset is MonoScript.

Let me know if you need a code snippet to lay this out.

[Edit] Added some snippets:

Editor:

using UnityEngine;
using UnityEditor;
using System.Collections;

public class PewPew : EditorWindow 
{

Attack attack;
MonoScript monoScript;

[MenuItem ("==/TestEditor")]
static void Init()
{
    // Get existing open window or if none, make a new one:
    PewPew window = (PewPew)EditorWindow.GetWindow (typeof (PewPew));
}

void OnGUI()
{
	
	monoScript = (MonoScript) EditorGUILayout.ObjectField(monoScript,typeof(MonoScript),new GUILayoutOption[0]{});
	
	attack = (Attack) System.Activator.CreateInstance(monoScript.GetClass());
	attack.SayHi();
}
}

Stubbed Attack:

using UnityEngine;
using System.Collections;

public class Attack : ScriptableObject
{
    public void SayHi()
    {
	    Debug.Log("Hello!");
    }
}

Hope this helps!

==