Skip to content

Instantly share code, notes, and snippets.

@quizcanners
Last active April 15, 2021 08:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
// Article: https://medium.com/@quizcanners/unity-i-have-a-custom-editor-for-every-script-5eddf20fdacc
using System.Collections.Generic;
using QuizCanners.Inspector;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class SomeScript : MonoBehaviour: IPEGI {
public List<SomeData> list = new List<SomeData>();
private int inspecteedElement = -1;
public void Inspect()
{
"My Important list".edit_List(ref list, ref inspecteedElement);
}
}
#if UNITY_EDITOR
[CustomEditor(typeof(SomeScript))]
public class SomeScriptDrawer : PEGI_Inspector<SomeScript> { }
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment