コード例 #1
0
 public static SkillObject FsmObjectPopup(GUIContent label, Skill fsm, SkillObject fsmObject, Type objectType)
 {
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     fsmObject = VariableEditor.DoFsmObjectPopup(label, fsm, fsmObject, objectType);
     VariableEditor.EndVariableEditor(fsmObject);
     return(fsmObject);
 }
コード例 #2
0
 public static SkillObject FsmObjectField(GUIContent label, Skill fsm, SkillObject fsmObject, Type objectTypeConstraint, object[] attributes)
 {
     if (label == null)
     {
         label = GUIContent.none;
     }
     if (fsmObject == null)
     {
         SkillObject fsmObject2 = new SkillObject();
         fsmObject2.set_ObjectType(objectTypeConstraint);
         fsmObject = fsmObject2;
     }
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (!objectTypeConstraint.IsAssignableFrom(fsmObject.get_ObjectType()))
     {
         fsmObject.set_ObjectType(objectTypeConstraint);
     }
     if (fsmObject.get_UseVariable())
     {
         fsmObject = VariableEditor.DoFsmObjectPopup(label, fsm, fsmObject, objectTypeConstraint);
     }
     else
     {
         ObjectPropertyDrawer objectPropertyDrawer = ObjectPropertyDrawers.GetObjectPropertyDrawer(fsmObject.get_ObjectType());
         if (objectPropertyDrawer != null)
         {
             fsmObject.set_Value(objectPropertyDrawer.OnGUI(label, fsmObject.get_Value(), !SkillEditor.SelectedFsmIsPersistent(), attributes));
         }
         else
         {
             fsmObject.set_Value(EditorGUILayout.ObjectField(label, fsmObject.get_Value(), fsmObject.get_ObjectType(), !SkillEditor.SelectedFsmIsPersistent(), new GUILayoutOption[0]));
         }
     }
     fsmObject = (SkillObject)VariableEditor.VariableToggle(fsmObject, label.get_text());
     VariableEditor.EndVariableEditor(fsmObject);
     return(fsmObject);
 }