public void MinMaxSliderUI(VisualElement ruleElement, Settings rules, int index, float min)
    {
        var slider = ruleElement.Q <MinMaxSlider>(className: "MinMax");

        slider.highLimit = index + 1 >= rules.RenderRules.Length ? rules.MaxTypeOfVoxel : rules.RenderRules[index + 1].Min - 1;
        slider.lowLimit  = min;
        slider.maxValue  = rules.RenderRules[index].Max;
        slider.value     = (new Vector2(rules.RenderRules[index].Min, rules.RenderRules[index].Max));

        var info = ruleElement.Q <Label>(className: "MinMaxInfo");

        info.text = "min :" + (uint)slider.minValue + "   max :" + (uint)slider.maxValue;
        slider.RegisterCallback <MouseCaptureOutEvent>(evt =>
        {
            var tmpSlider = evt.target as MinMaxSlider;
            info.text     = "min :" + (uint)tmpSlider.minValue + "   max :" + (uint)tmpSlider.maxValue;
            rules.RenderRules[index].Min = tmpSlider.minValue;
            rules.RenderRules[index].Max = tmpSlider.maxValue;

            if (index > 0)
            {
                tmpSlider.parent.parent.Q(className: "rule", name: (index - 1).ToString()).Q <MinMaxSlider>(className: "MinMax").
                highLimit = rules.RenderRules[index].Min - 1;
            }
            if (index + 1 < rules.RenderRules.Length)
            {
                tmpSlider.parent.parent.Q(className: "rule", name: (index + 1).ToString()).Q <MinMaxSlider>(className: "MinMax").
                lowLimit = rules.RenderRules[index].Max + 1;
            }
            AssetDatabase.ForceReserializeAssets(new List <string> {
                modulePath
            });
        });
    }
        private static void UpdateAllControllerMappingProfiles()
        {
            string[] guids      = AssetDatabase.FindAssets("t:MixedRealityControllerMappingProfile");
            string[] assetPaths = new string[guids.Length];
            for (int i = 0; i < guids.Length; i++)
            {
                string guid = guids[i];
                assetPaths[i] = AssetDatabase.GUIDToAssetPath(guid);

                MixedRealityControllerMappingProfile asset = AssetDatabase.LoadAssetAtPath(assetPaths[i], typeof(MixedRealityControllerMappingProfile)) as MixedRealityControllerMappingProfile;

                List <MixedRealityControllerMapping> updatedMappings = new List <MixedRealityControllerMapping>();

                foreach (MixedRealityControllerMapping mapping in asset.MixedRealityControllerMappings)
                {
                    if (mapping.ControllerType.Type == null)
                    {
                        continue;
                    }

                    if (!mapping.HasCustomInteractionMappings)
                    {
                        mapping.UpdateInteractionSettingsFromDefault();
                    }

                    updatedMappings.Add(mapping);
                }

                asset.mixedRealityControllerMappings = updatedMappings.ToArray();
            }
            AssetDatabase.ForceReserializeAssets(assetPaths);
        }
        private static void CreateLocalizationDictionary()
        {
            if (settings != null &&
                (settings.LocalizedPopupMessageDictionary == null || settings.LocalizedPopupMessageDictionary.Count == 0))
            {
                settings.UseLocalizationValues           = true;
                settings.LocalizedPopupMessageDictionary = new LanguagesDictionary();
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.English, "Pressing 'Allow' uses device info for more relevant ad content");
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.French, "'Autoriser' permet d'utiliser les infos du téléphone pour afficher des contenus publicitaires plus pertinents");
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.German, "'Erlauben' drücken benutzt Gerätinformationen für relevantere Werbeinhalte");
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.Catalan, "Prement 'Permetre', s'utilitza la informació del dispositiu per a obtindre contingut publicitari més rellevant");
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.Spanish, "Presionando 'Permitir', se usa la información del dispositivo para obtener contenido publicitario más relevante");
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.Chinese, "点击'允许'以使用设备信息获得更加相关的广告内容");
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.Japanese, "'許可'をクリックすることで、デバイス情報を元により最適な広告を表示することができます");
                settings.LocalizedPopupMessageDictionary.Add((int)SystemLanguage.Korean, "'허용'을 누르면 더 관련성 높은 광고 콘텐츠를 제공하기 위해 기기 정보가 사용됩니다");
            }

            if (settings != null && settings.LocalizedPopupMessageDictionary != null && settings.LocalizedPopupMessageDictionary.ContainsKey((int)SystemLanguage.ChineseSimplified))
            {
                settings.LocalizedPopupMessageDictionary.Remove((int)SystemLanguage.ChineseSimplified);
            }

            if (settings != null && settings.LocalizedPopupMessageDictionary != null && settings.LocalizedPopupMessageDictionary.ContainsKey((int)SystemLanguage.ChineseTraditional))
            {
                settings.LocalizedPopupMessageDictionary.Remove((int)SystemLanguage.ChineseTraditional);
            }

            AssetDatabase.ForceReserializeAssets(new string[] { SETTINGS_ASSET_PATH });
        }
Exemplo n.º 4
0
        private void DoApply()
        {
            bool reimport = true;

            if (m_CurrentModule != null)
            {
                reimport = m_CurrentModule.ApplyRevert(true);
            }
            m_SpriteDataProvider.Apply();

            // Do this so that asset change save dialog will not show
            var originalValue = EditorPrefs.GetBool("VerifySavingAssets", false);

            EditorPrefs.SetBool("VerifySavingAssets", false);
            AssetDatabase.ForceReserializeAssets(new[] { m_SelectedAssetPath }, ForceReserializeAssetsOptions.ReserializeMetadata);
            EditorPrefs.SetBool("VerifySavingAssets", originalValue);

            if (reimport)
            {
                DoTextureReimport(m_SelectedAssetPath);
            }
            Repaint();

            textureIsDirty = false;
            InitSelectedSpriteRect();
        }
    static private void ReserializeAllFiles()
    {
        string[] pAllDataObjectsGUIDs    = AssetDatabase.FindAssets("", new string[] { "Assets" });
        string[] pAllNavMeshObjectsGUIDs = AssetDatabase.FindAssets("", new string[] { "Assets/Scenes" });

        List <string> pDataObjectsPaths = new List <string>(pAllDataObjectsGUIDs.Length);

        for (int i = 0; i < pAllDataObjectsGUIDs.Length; ++i)
        {
            string sPath = AssetDatabase.GUIDToAssetPath(pAllDataObjectsGUIDs[i]);
            if (!sPath.StartsWith("Assets/Scenes"))
            {
                pDataObjectsPaths.Add(sPath);
            }

            if (i < pAllNavMeshObjectsGUIDs.Length)
            {
                string sSceneObjectPath = AssetDatabase.GUIDToAssetPath(pAllNavMeshObjectsGUIDs[i]);
                if (sSceneObjectPath.EndsWith("NavMesh.asset"))
                {
                    pDataObjectsPaths.Add(sSceneObjectPath);
                }
            }
        }

        AssetDatabase.ForceReserializeAssets(pDataObjectsPaths, ForceReserializeAssetsOptions.ReserializeAssets);
    }
    public void OnPostprocessTexture(Texture2D texture)
    {
        if (!fnTest)
        {
            return;
        }
        TextureImporter importer = assetImporter as TextureImporter;

        if (importer.spriteImportMode != SpriteImportMode.Multiple)
        {
            Debug.Log("something went wrong?");
            return;
        }

        List <SpriteMetaData> metas = GetSheetMetas(texture, assetPath);

        Debug.Log("OnPostprocessTexture generating sprites..." + metas.Count);


        importer.spritesheet = metas.ToArray();
        //This first line was the change that fixed it for me
        AssetDatabase.ForceReserializeAssets(new List <string>()
        {
            assetPath
        });
        //Those lines below I was already using so they may or may not be necessary
        AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);
        AssetDatabase.SaveAssets();
    }
Exemplo n.º 7
0
    public static void ReserializeSelected()
    {
        var assetPaths = Selection.objects.Select(s => AssetDatabase.GetAssetPath(s)).ToList();

        AssetDatabase.ForceReserializeAssets(assetPaths);
        Debug.Log($"Reserialized {assetPaths.Count} asset(s)");
    }
Exemplo n.º 8
0
 public static void ReserializeAssets()
 {
     EditorUtility.DisplayProgressBar("Reserializing...", null, 0);
     AssetDatabase.ForceReserializeAssets();
     AssetDatabase.SaveAssets();
     EditorUtility.ClearProgressBar();
 }
Exemplo n.º 9
0
        public static void ReserialiseAssets()
        {
            var result = EditorUtility.DisplayDialogComplex(
                "Mode",
                "Choose reserialisation mode",
                ForceReserializeAssetsOptions.ReserializeAssets.ToString().ToSpaced(),
                ForceReserializeAssetsOptions.ReserializeMetadata.ToString().ToSpaced(),
                ForceReserializeAssetsOptions.ReserializeAssetsAndMetadata.ToString().ToSpaced()
                );
            var mode = result switch {
                0 => ForceReserializeAssetsOptions.ReserializeAssets,
                1 => ForceReserializeAssetsOptions.ReserializeMetadata,
                2 => ForceReserializeAssetsOptions.ReserializeAssetsAndMetadata,
                _ => ForceReserializeAssetsOptions.ReserializeAssets
            };

            var assetsPaths = Selection.assetGUIDs.Select(AssetDatabase.GUIDToAssetPath);

            if (!EditorUtility.DisplayDialog("Confirm",
                                             $"Are you sure you want to perform {mode} on {assetsPaths.Count()} selected assets:\n{string.Join("\n", assetsPaths)}",
                                             "Yes",
                                             "No"
                                             ))
            {
                return;
            }
            try {
                AssetDatabase.ForceReserializeAssets(assetsPaths, mode);
            } catch (Exception ex) {
                EditorUtility.DisplayDialog("Error", ex.Message, "ok");
            }
        }
Exemplo n.º 10
0
    public override void OnInspectorGUI()
    {
        var settings = target as TerrainGenBaseSettings;

        base.OnInspectorGUI();
        if (GUILayout.Button("Change Default Workspace"))
        {
            string path = EditorUtility.SaveFolderPanel("Select Workspace", "", "");

            if (path.Length != 0)
            {
                string p = path.Remove(0, Application.dataPath.Length);
                settings.Workspace = p;
                EditorUtility.SetDirty(settings);
                AssetDatabase.SaveAssets();
            }
        }

        if (GUILayout.Button("Set Blender Path"))
        {
            string path = EditorUtility.OpenFilePanel("Find Blender Executable", "", "exe");
            if (path.Length != 0)
            {
                settings.PathToBlender = path;
                EditorUtility.SetDirty(settings);
                AssetDatabase.SaveAssets();
            }
        }

        if (GUILayout.Button("Save"))
        {
            AssetDatabase.ForceReserializeAssets(new string[] { AssetDatabase.GetAssetPath(target) });
        }
    }
Exemplo n.º 11
0
        static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            m_AssetList = new List <object>();
            List <string> assetPathModified = new List <string>();

            foreach (var importedAsset in importedAssets)
            {
                ISpriteEditorDataProvider ai = InternalEditorBridge.GetISpriteEditorDataProviderFromPath(importedAsset);
                if (ai != null)
                {
                    ai.InitSpriteEditorDataProvider();
                    var  assets      = AssetDatabase.LoadAllAssetsAtPath(importedAsset);
                    var  sprites     = assets.OfType <Sprite>().ToArray <Sprite>();
                    bool dataChanged = false;
                    dataChanged  = PostProcessBoneData(ai, sprites);
                    dataChanged |= PostProcessSpriteMeshData(ai, sprites);
                    if (dataChanged)
                    {
                        assetPathModified.Add(importedAsset);
                        m_AssetList.AddRange(assets);
                    }
                }
            }

            if (assetPathModified.Count > 0 && m_AssetList.Count > 0)
            {
                var originalValue = EditorPrefs.GetBool("VerifySavingAssets", false);
                EditorPrefs.SetBool("VerifySavingAssets", false);
                AssetDatabase.ForceReserializeAssets(assetPathModified, ForceReserializeAssetsOptions.ReserializeMetadata);
                EditorPrefs.SetBool("VerifySavingAssets", originalValue);
                m_AssetList.Clear();
            }
        }
    public void VoxelFieldUi(VisualElement view, Settings settings)
    {
        var voxSize      = view.Q <FloatField>(className: "voxel-size");
        var NbMaxOfVoxel = view.Q <IntegerField>(className: "max-number-of-type");

        voxSize.value      = settings.SizeShared;
        NbMaxOfVoxel.value = (int)settings.MaxTypeOfVoxel;

        NbMaxOfVoxel.RegisterCallback <ChangeEvent <int> >(evt =>
        {
            MinMaxSlider slider = null;

            if (settings.RenderRules.Length > 0)
            {
                slider = view.Q(className: "rule", name: (settings.RenderRules.Length - 1).ToString()).Q <MinMaxSlider>(className: "MinMax");
            }

            if (evt.newValue < 0 || evt.newValue > 255 || (slider != null && evt.newValue < slider.maxValue))
            {
                return;
            }

            if (slider != null)
            {
                slider.highLimit = evt.newValue;
            }

            settings.MaxTypeOfVoxel = (uint)evt.newValue;
            AssetDatabase.ForceReserializeAssets(new List <string> {
                modulePath
            });
        });
    }
    public void RectFieldUI(VisualElement ruleElement, Settings rules, int index)
    {
        var rectSize     = ruleElement.Q <IntegerField>(className: "rect-size");
        var nbRectByLine = ruleElement.Q <IntegerField>(className: "nb-rect-by-line");

        rectSize.value     = (int)rules.RenderRules[index].RenctangleSize;
        nbRectByLine.value = (int)rules.RenderRules[index].NbOfRectByLine;
        rectSize.RegisterCallback <ChangeEvent <int> >(evt =>
        {
            if (evt.newValue < 0)
            {
                return;
            }
            rules.RenderRules[index].RenctangleSize = (uint)evt.newValue;
            AssetDatabase.ForceReserializeAssets(new List <string> {
                modulePath
            });
        });
        nbRectByLine.RegisterCallback <ChangeEvent <int> >(evt =>
        {
            if (evt.newValue < 0)
            {
                return;
            }
            rules.RenderRules[index].NbOfRectByLine = (uint)evt.newValue;
            AssetDatabase.ForceReserializeAssets(new List <string> {
                modulePath
            });
        });
    }
Exemplo n.º 14
0
    public static void Perform()
    {
        var assetGuids      = Selection.assetGUIDs;
        var assetPaths      = new List <string>(assetGuids.Length);
        var searchInFolders = new string[1];

        foreach (var assetGuid in assetGuids)
        {
            var path = AssetDatabase.GUIDToAssetPath(assetGuid);
            assetPaths.Add(path);

            if (!Directory.Exists(path))
            {
                continue;
            }

            searchInFolders[0] = path;
            var assetGuidsInFolders = AssetDatabase.FindAssets("", searchInFolders);
            foreach (var guid in assetGuidsInFolders)
            {
                assetPaths.Add(AssetDatabase.GUIDToAssetPath(guid));
            }
        }

        AssetDatabase.ForceReserializeAssets(assetPaths);
    }
        private static void ForceReserializeAssetsSelect()
        {
            var folderPath = EditorUtility.OpenFolderPanel
                             (
                title: TITLE,
                folder: string.Empty,
                defaultName: string.Empty
                             );

            folderPath = FileUtil.GetProjectRelativePath(folderPath);

            if (!OpenOkCancelDialog($"{folderPath} フォルダ内のアセットを再シリアライズしますか?"))
            {
                return;
            }

            var folderPathWithSlash = folderPath + "/";

            var list = AssetDatabase
                       .GetAllAssetPaths()
                       .Where(c => c.StartsWith(folderPathWithSlash))
            ;

            AssetDatabase.ForceReserializeAssets(list);

            OpenOkDialog($"{folderPath} フォルダ内のアセットを再シリアライズしました");
        }
    public void RuleUI(VisualElement view, Settings rules, int index, float min)
    {
        RuleTreeAsset.CloneTree(view);

        var ruleElement = VisualRoot.Q(className: "rule", name: "Rule");

        ruleElement.name = index.ToString();

        TogglesUi(ruleElement, rules, index);
        MinMaxSliderUI(ruleElement, rules, index, min);

        var objfield = ruleElement.Q <ObjectField>(className: "object-field");

        objfield.objectType = typeof(Material);
        objfield.value      = rules.RenderRules[index].material;

        objfield.RegisterCallback <ChangeEvent <Object> >(evt =>
        {
            var element = evt.target as ObjectField;
            rules.RenderRules[index].material = evt.newValue as Material;
            AssetDatabase.ForceReserializeAssets(new List <string> {
                modulePath
            });
        });
        RectFieldUI(ruleElement, rules, index);
    }
Exemplo n.º 17
0
        public static void RefreshPartReferers()
        {
#if CC2D_RES
            AssetDatabase.ForceReserializeAssets(m_searchPathPath);
            AssetDatabase.Refresh();
            Dictionary <string, PartReferer> lastPartRefererDict = GetCurrentPartRefererDict();
            int counter   = 0;
            var partPacks = PartList.Static.partPacks;
            foreach (PartPack partPack in partPacks)
            {
                int counter2 = 0;
                foreach (Part partObject in partPack.parts)
                {
                    string partRefPath = InitPartReferer(partObject, lastPartRefererDict);
                    EditorUtility.DisplayProgressBar("Initialize Part Referers", WizardUtils.RelativePartPath(partObject),
                                                     (float)counter / partPacks.Count + (float)counter2 / partPack.parts.Count / partPacks.Count);
                    counter2++;
                }
                counter++;
            }
            counter = 0;
            foreach (var lastPartReferer in lastPartRefererDict)
            {
                AssetDatabase.DeleteAsset(lastPartReferer.Key);
                EditorUtility.DisplayCancelableProgressBar("Delete Unused Part Referers", lastPartReferer.Value.name,
                                                           (float)counter / lastPartRefererDict.Count);
                counter++;
            }
            AssetDatabase.Refresh();
            EditorUtility.UnloadUnusedAssetsImmediate(true);
            EditorUtility.ClearProgressBar();
#endif
        }
        //[MenuItem("Assets/Reserialize")]
        public static void ForceReserializeSelection()
        {
            var paths = Selection.objects.Select(AssetDatabase.GetAssetPath).NotNull();

            AssetDatabase.ForceReserializeAssets(paths);
            AssetDatabase.SaveAssets();
        }
 public static void GenerateCompatibilityTestLoadReferenceAsset()
 {
     CompatibilityGraphModelBuilder.CreateAsset(k_CurrentVersionAssetName, k_TmpCurrentVersionAssetPath);
     AssetDatabase.SaveAssets();
     AssetDatabase.ForceReserializeAssets(new[] { k_TmpCurrentVersionAssetPath });
     FileUtil.ReplaceFile(k_TmpCurrentVersionAssetPath, k_CurrentVersionAssetPath);
     AssetDatabase.DeleteAsset(k_TmpCurrentVersionAssetPath);
 }
Exemplo n.º 20
0
        public static void ForceReserializeAllAssets()
        {
            if (!EditorUtility.DisplayDialog("Attention", "Do you want to force reserialize all assets? This can be time heavy operation and result in massive list of changes.", "Ok", "Cancel"))
            {
                return;
            }

            AssetDatabase.ForceReserializeAssets();
        }
        void Apply()
        {
            var path = AssetDatabase.GetAssetPath(m_BuildPipeline);

            m_BuildPipeline.SetSteps(m_BuildSteps.ToArray());
            EditorUtility.SetDirty(m_BuildPipeline);
            AssetDatabase.ForceReserializeAssets(new string[] { path }, ForceReserializeAssetsOptions.ReserializeAssets);
            m_PipelineIsDirty = false;
        }
Exemplo n.º 22
0
        public void Apply()
        {
            // Do this so that asset change save dialog will not show
            var originalValue = EditorPrefs.GetBool("VerifySavingAssets", false);

            EditorPrefs.SetBool("VerifySavingAssets", false);
            AssetDatabase.ForceReserializeAssets(new string[] { assetPath }, ForceReserializeAssetsOptions.ReserializeMetadata);
            EditorPrefs.SetBool("VerifySavingAssets", originalValue);
        }
Exemplo n.º 23
0
    public static void ApplyChanges()
    {
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (Selection.activeObject != null)
        {
            AssetDatabase.ForceReserializeAssets(GetPathToSelection(), ForceReserializeAssetsOptions.ReserializeAssets);
        }
    }
Exemplo n.º 24
0
 public static void ReserializeAll()
 {
     EditorUtility.DisplayProgressBar(
         "Reserializing Assets", "Please Wait while assets are reserialized.", 0.5f);
     try {
         AssetDatabase.ForceReserializeAssets();
     } finally {
         EditorUtility.ClearProgressBar();
     }
 }
 public void TogglesUi(VisualElement ruleElement, Settings rules, int index)
 {
     ruleElement.Query <Toggle>(classes: "Toggle").ForEach(toggle =>
     {
         if (toggle.name == "Transparent")
         {
             toggle.value = rules.RenderRules[index].Transparent;
             toggle.RegisterCallback <ChangeEvent <bool> >(evt =>
             {
                 var tmpToggle = evt.target as Toggle;
                 if (tmpToggle.parent.name == "Rule")
                 {
                     return;
                 }
                 rules.RenderRules[index].Transparent = evt.newValue;
             });
             AssetDatabase.ForceReserializeAssets(new List <string> {
                 modulePath
             });
         }
         else if (toggle.name == "FaceTransparent")
         {
             toggle.value = rules.RenderRules[index].NeighbourTransparentFaced;
             toggle.RegisterCallback <ChangeEvent <bool> >(evt =>
             {
                 var tmpToggle = evt.target as Toggle;
                 if (tmpToggle.parent.name == "Rule")
                 {
                     return;
                 }
                 rules.RenderRules[index].NeighbourTransparentFaced = evt.newValue;
             });
             AssetDatabase.ForceReserializeAssets(new List <string> {
                 modulePath
             });
         }
         else if (toggle.name == "FaceOpaque")
         {
             toggle.value = rules.RenderRules[index].NeighbourOpaqueFaced;
             toggle.RegisterCallback <ChangeEvent <bool> >(evt =>
             {
                 var tmpToggle = evt.target as Toggle;
                 if (tmpToggle.parent.name == "Rule")
                 {
                     return;
                 }
                 rules.RenderRules[index].NeighbourOpaqueFaced = evt.newValue;
             });
             AssetDatabase.ForceReserializeAssets(new List <string> {
                 modulePath
             });
         }
     });
 }
 private void SaveAsset()
 {
     if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(AppCoreSettings.Instance)))
     {
         AssetDatabase.CreateAsset(AppCoreSettings.Instance, SETTINGS_FILE_PATH);
     }
     else
     {
         AssetDatabase.ForceReserializeAssets(new string[] { SETTINGS_FILE_PATH }, ForceReserializeAssetsOptions.ReserializeAssetsAndMetadata);
     }
 }
Exemplo n.º 27
0
 private static void ForceSaveAssets()
 {
     if (EditorUtility.DisplayDialog(
             "Force Assets Reserialization",
             "This may be long operation despite of the size of your project, so be aware! There is no progress bar so it may looks like that Unity is frozen, but be patient, it's working. Proceed operation?",
             "Yes, go ahead!", "Cancel!"))
     {
         AssetDatabase.ForceReserializeAssets();
         AssetDatabase.Refresh();
     }
 }
        private static void ForceReserializeAssetsAll()
        {
            if (!OpenOkCancelDialog("すべてのアセットを再シリアライズしますか?"))
            {
                return;
            }

            AssetDatabase.ForceReserializeAssets();

            OpenOkDialog("すべてのアセットを再シリアライズしました");
        }
Exemplo n.º 29
0
        public static void FlushWrite(SerializedData dataAsset)
        {
#if UNITY_EDITOR
            var assetPaths = new string[1];
            assetPaths[0] = AssetDatabase.GetAssetPath(dataAsset);

            // TODO: Deprecate older versions of Unity.
#if UNITY_2017_3_OR_NEWER
            AssetDatabase.ForceReserializeAssets(assetPaths);
#endif
#endif
        }
Exemplo n.º 30
0
        private static void ForceReserialize()
        {
            GameObject[] selection   = Selection.gameObjects;
            string[]     objectPaths = new string[selection.Length];

            for (int i = 0; i < selection.Length; ++i)
            {
                objectPaths[i] = AssetDatabase.GetAssetPath(selection[i]);
            }

            AssetDatabase.ForceReserializeAssets(objectPaths);
        }