private static void CheckFsmGameObjectParameter(SkillGameObject fsmGameObject) { if (fsmGameObject == null) { fsmGameObject = new SkillGameObject(string.Empty); } if (fsmGameObject.get_UseVariable()) { if (FsmEditorSettings.CheckForRequiredField && string.IsNullOrEmpty(fsmGameObject.get_Name()) && FsmErrorChecker.IsRequiredField()) { FsmErrorChecker.AddRequiredFieldError(); return; } FsmErrorChecker.CheckBaseGameObject(fsmGameObject.get_Value()); return; } else { if (FsmEditorSettings.CheckForRequiredField && fsmGameObject.get_Value() == null && FsmErrorChecker.IsRequiredField()) { FsmErrorChecker.AddRequiredFieldError(); return; } FsmErrorChecker.CheckBaseGameObject(fsmGameObject.get_Value()); return; } }
private static void AddCreateObjectAction() { SkillStateAction fsmStateAction = ActionUtility.AddAction(SkillEditor.SelectedState, "HutongGames.PlayMaker.Actions.CreateObject", SkillEditorMacros.droppedOnAction); SkillStateAction arg_32_0 = fsmStateAction; string arg_32_1 = "gameObject"; SkillGameObject fsmGameObject = new SkillGameObject(); fsmGameObject.set_Value(SkillEditorMacros.droppedObject as GameObject); ActionUtility.SetActionFieldValue(arg_32_0, arg_32_1, fsmGameObject); SkillEditor.SetFsmDirty(SkillEditorMacros.droppedOnFsm, true, false, true); SkillEditor.SaveActions(SkillEditorMacros.droppedOnFsm); }
public static Skill GetGameObjectFSM(SkillGameObject go, SkillString fsmName) { return(null); }
public static SkillGameObject FsmGameObjectField(GUIContent label, Skill fsm, SkillGameObject fsmGameObject) { if (label == null) { label = GUIContent.none; } EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); if (fsmGameObject.get_UseVariable()) { fsmGameObject = VariableEditor.DoFsmGameObjectPopup(label, fsm, fsmGameObject); } else { fsmGameObject.set_Value((GameObject)EditorGUILayout.ObjectField(label, fsmGameObject.get_Value(), typeof(GameObject), !SkillEditor.SelectedFsmIsPersistent(), new GUILayoutOption[0])); } fsmGameObject = (SkillGameObject)VariableEditor.VariableToggle(fsmGameObject, label.get_text()); VariableEditor.EndVariableEditor(fsmGameObject); return(fsmGameObject); }
public static SkillGameObject FsmGameObjectPopup(GUIContent label, Skill fsm, SkillGameObject fsmGameObject) { EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); fsmGameObject = VariableEditor.DoFsmGameObjectPopup(label, fsm, fsmGameObject); VariableEditor.EndVariableEditor(fsmGameObject); return(fsmGameObject); }
private static SkillGameObject DoFsmGameObjectPopup(GUIContent label, Skill fsm, SkillGameObject fsmGameObject) { ActionEditor.DoVariableSelector(label, fsm, 3, fsmGameObject, -1, null); fsmGameObject.set_UseVariable(true); return(fsmGameObject); }