public override void OnDrawGizmos(CerealBehaviour source, SerializedProperty property, GUIContent label) { switch (property.propertyType) { case SerializedPropertyType.Vector3: Gizmos.color = Color.blue; Gizmos.DrawSphere(property.vector3Value, .5f); break; default: throw new System.ArgumentException(string.Format("The visualization behavior of Type {0} is not implemented", property.propertyType)); //break; } }
public override void OnSceneGUI(CerealBehaviour source, SerializedProperty property, GUIContent label) { switch (property.propertyType) { case SerializedPropertyType.Vector3: property.vector3Value = Handles.PositionHandle(property.vector3Value, Quaternion.identity); property.serializedObject.ApplyModifiedProperties(); Handles.Label(property.vector3Value, label); break; default: throw new System.ArgumentException(string.Format("The visualization behavior of Type {0} is not implemented", property.propertyType)); //break; } }
private void OnSceneGUI() { CerealBehaviour cereal = (CerealBehaviour)target; cereal.BeforeScene(); cereal.BeforeSerialize(); so.Update(); foreach (SerializedProperty p in properties ()) { foreach (LSScenePropertyDrawer drawer in GetPropertyDrawers (p)) { if (drawer != null) drawer.OnSceneGUI(cereal, p, new GUIContent(p.displayName, p.tooltip)); } } so.ApplyModifiedProperties(); cereal.AfterSerialize(); cereal.AfterScene(); so.Update(); }
public virtual void OnDrawGizmos(CerealBehaviour source, SerializedProperty property, GUIContent label) { }
public virtual void OnSceneGUI(CerealBehaviour source, SerializedProperty property, GUIContent label) { }
public override void OnSceneGUI(CerealBehaviour source, UnityEditor.SerializedProperty property, GUIContent label) { base.OnSceneGUI(source, property, label); }