コード例 #1
0
        public static bool PackHasErrors(AssetObjectPack pack, EditorProp packProp)
        {
            //duplicate param names
            if (packProp[defaultParametersField].ContainsDuplicateNames(out _))
            {
                return(true);
            }


            if (!pack.isCustom)
            {
                //check variables
                Func <string, bool>[] validChecks = new Func <string, bool>[] { IsValidTypeString, IsValidDirectory, FileExtensionValid };
                string[] fieldChecks = new string[] { pack.assetType, pack.dir, pack.extensions };
                for (int x = 0; x < 3; x++)
                {
                    if (!validChecks[x](fieldChecks[x]))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #2
0
 void UpdateIDsForPack(AssetObjectPack pack)
 {
     string[] pathsWithoutIDs = EditorUtils.GetFilePathsInDirectory(pack.dir, true, pack.extensions, AssetObjectsEditor.sIDKey, false);
     if (pathsWithoutIDs.Length == 0)
     {
         Debug.Log("All assets in " + pack.name + " objects directory have IDs");
         return;
     }
     GenerateNewIDs(AssetObjectsEditor.GetAllAssetObjectPaths(pack.dir, pack.extensions, false), pathsWithoutIDs);
 }
コード例 #3
0
 void DrawGenIDsForPack(AssetObjectPack pack)
 {
     if (GUIUtils.Button(new GUIContent("Update IDs in Directory"), GUIStyles.button, Colors.selected, Colors.black))
     {
         string msg = "Generating IDs will rename assets without IDs, are you sure?";
         if (EditorUtility.DisplayDialog("Generate IDs", msg, "Generate IDs", "Cancel"))
         {
             UpdateIDsForPack(pack);
         }
     }
 }
コード例 #4
0
        void DrawUpdateIDsButton()
        {
            AssetObjectPack displayPack = packsManager.packs[displayPackIndex];

            if (!displayPack.isCustom)
            {
                GUIUtils.StartBox();
                DrawGenIDsForPack(displayPack);
                GUIUtils.EndBox();
            }
        }