2023-09-13 05:07:40 +00:00
|
|
|
using System.Collections;
|
|
|
|
using UnityEngine;
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
using UnityEditor;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace DistantLands.Cozy
|
|
|
|
{
|
|
|
|
public class ExampleModule : CozyModule
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
[CustomEditor(typeof(ExampleModule))]
|
|
|
|
[CanEditMultipleObjects]
|
|
|
|
public class E_ExampleModule : E_CozyModule
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public override GUIContent GetGUIContent()
|
|
|
|
{
|
|
|
|
|
|
|
|
//Place your module's GUI content here.
|
|
|
|
return new GUIContent(" Example Module", (Texture)Resources.Load("MoreOptions"), "Empty module to be used as a base for custom modules.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-01-03 06:34:33 +00:00
|
|
|
|
|
|
|
public override void GetDebugInformation()
|
2023-09-13 05:07:40 +00:00
|
|
|
{
|
|
|
|
|
2024-01-03 06:34:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void GetReportsInformation()
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OpenContextMenu(Vector2 pos)
|
|
|
|
{
|
|
|
|
|
|
|
|
//Use this to add new actions to the editor's context menu if needed for your module
|
|
|
|
|
|
|
|
GenericMenu menu = new GenericMenu();
|
|
|
|
// menu.AddSeparator("");
|
|
|
|
menu.AddItem(new GUIContent("Remove Module"), false, RemoveModule);
|
|
|
|
menu.AddItem(new GUIContent("Reset"), false, ResetModule);
|
|
|
|
menu.AddItem(new GUIContent("Edit Script"), false, EditScript);
|
|
|
|
|
|
|
|
menu.ShowAsContext();
|
|
|
|
|
2023-09-13 05:07:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public override void DisplayInCozyWindow()
|
|
|
|
{
|
|
|
|
serializedObject.Update();
|
|
|
|
|
|
|
|
//Place custom inspector code here.
|
|
|
|
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|