예제 #1
0
        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;
            }
        }
예제 #2
0
        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();
 }
예제 #4
0
 public virtual void OnDrawGizmos(CerealBehaviour source, SerializedProperty property, GUIContent label)
 {
 }
예제 #5
0
 public virtual void OnSceneGUI(CerealBehaviour source, SerializedProperty property, GUIContent label)
 {
 }
예제 #6
0
 public override void OnSceneGUI(CerealBehaviour source, UnityEditor.SerializedProperty property, GUIContent label)
 {
     base.OnSceneGUI(source, property, label);
 }