- Home /
Customize Vector3 Inspector
I would want all the Vector3 had and horizontal view way into the inspector:
I was trying with this:
[CustomEditor(typeof(Vector3))]
public class Vector3Editor : Editor
{
void OnInspectorGUI()
{
target = EditorGUILayout.Vector3Field(target .name, target );
if (GUI.changed)
EditorUtility.SetDirty(target);
}
}
But the compiler doesn't let me to do it , Any idea?
I don't think you can do this. Vector3 is a variable type not a Component. The Customer Editor only works on components.
According to this, Unity 4 will have an inspector GUI for custom classes. So, wait for Unity 4.
Answer by asafsitner · Jun 25, 2012 at 05:13 PM
CustomEditor
works with components, i.e. MonoBehaviour
scripts. Vector3
is not a MonoBehaviour
.
Your answer
Follow this Question
Related Questions
How can I use the Mesh Inspector preview in an Editor Window? 0 Answers
Invoke inspector update (from editorwindow) 0 Answers
Custom Inspector for ScriptableObject 1 Answer
Set the Rect of PopupWindowContent 1 Answer
Inspector view changed! Looks totally different. Apply, Revert, ... prefab buttons gone. Help! 1 Answer