public static void UpdateIsModifiedPrefabInstance(Skill fsm)
 {
     if (fsm == null || fsm.OwnerName == null)
     {
         return;
     }
     fsm.IsModifiedPrefabInstance = SkillPrefabs.IsModifiedPrefabInstance(fsm);
 }
Exemple #2
0
        public static string GetFsmSavePath(Skill fsm)
        {
            if (fsm == null)
            {
                return("");
            }
            if (fsm.UsedInTemplate)
            {
                return("Template." + fsm.UsedInTemplate.Name);
            }
            string text = fsm.OwnerName + '.' + Labels.GetFsmLabel(fsm);

            if (SkillPrefabs.IsPrefab(fsm))
            {
                return("Prefab." + text);
            }
            return(text);
        }
 private static void BeginPrefabInstanceCheck()
 {
     if (FsmEditorSettings.ConfirmEditingPrefabInstances && InspectorPanel.editingPrefabInstance != null && InspectorPanel.editingPrefabInstance == SkillEditor.SelectedFsm)
     {
         EditorGUILayout.HelpBox(Strings.get_Label_Editing_Prefab_Instance(), 1);
         InspectorPanel.editingDisabledForPrefabInstance = false;
     }
     else
     {
         InspectorPanel.editingDisabledForPrefabInstance = (FsmEditorSettings.ConfirmEditingPrefabInstances && SkillPrefabs.IsPrefabInstance(SkillEditor.SelectedFsm));
         if (InspectorPanel.editingDisabledForPrefabInstance)
         {
             EditorGUILayout.HelpBox(Strings.get_Label_Confirm_Editing_of_Prefab_Instance(), 1);
             GUILayout.BeginHorizontal(new GUILayoutOption[0]);
             if (GUILayout.Button(Strings.get_Label_Edit_Prefab(), new GUILayoutOption[0]))
             {
                 SkillEditor.SelectPrefabParent();
             }
             if (GUILayout.Button(Strings.get_Label_Edit_Instance(), new GUILayoutOption[0]))
             {
                 InspectorPanel.editingPrefabInstance = SkillEditor.SelectedFsm;
             }
             GUILayout.EndHorizontal();
             SkillEditor.GraphView.DisableEditing(Strings.get_Label_Editing_of_Prefab_Instance_is_disabled());
         }
     }
     EditorGUI.BeginDisabledGroup(InspectorPanel.editingDisabledForPrefabInstance);
 }
 public static bool IsPersistent(Skill fsm)
 {
     return(fsm != null && (fsm.UsedInTemplate || SkillPrefabs.IsPrefab(fsm)));
 }