Skip to content

Instantly share code, notes, and snippets.

@arun02139
Created March 15, 2017 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun02139/0788b895165569ec5ab54a4998f23405 to your computer and use it in GitHub Desktop.
Save arun02139/0788b895165569ec5ab54a4998f23405 to your computer and use it in GitHub Desktop.
Custom inspector to look at the coordinate values (that should be getting serialized but aren't)
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(MyHexagon))]
public class MyHexagonInspector : Editor
{
public override void OnInspectorGUI()
{
var myHex = (MyHexagon)target;
base.OnInspectorGUI ();
EditorGUILayout.LabelField("offsetCoord:", myHex.offsetCoord.PrettyPrint());
EditorGUILayout.LabelField("cubeCoord:", myHex.cubeCoord.PrettyPrint());
EditorUtility.SetDirty( target );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment