-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ivan/update-unity-to-2022.3.49
# Conflicts: # .BinaryPrefs/ProjectSettings/ProjectVersion.txt
- Loading branch information
Showing
16 changed files
with
335 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Ceditor/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using UnityEditor; | ||
using UnityEditorInternal; | ||
using UnityEngine; | ||
|
||
namespace Appegy.Storage.Example | ||
{ | ||
public static class MenuItemsTools | ||
{ | ||
private static readonly string[] _mutableFolders = | ||
{ | ||
"Assets", | ||
"Packages", | ||
"ProjectSettings", | ||
}; | ||
|
||
private static readonly HashSet<Type> _textAssetsTypes = new HashSet<Type> | ||
{ | ||
typeof(MonoScript), | ||
typeof(DefaultAsset), | ||
typeof(TextAsset), | ||
typeof(AssemblyDefinitionAsset), | ||
typeof(AssemblyDefinitionReferenceAsset) | ||
}; | ||
|
||
[MenuItem("Assets/Reserialize All", false, 40)] | ||
public static void ReserializeAll() | ||
{ | ||
ReserializeAssets(AssetDatabase.GetAllAssetPaths()); | ||
} | ||
|
||
private static void ReserializeAssets(IEnumerable<string> assets) | ||
{ | ||
var regularAssets = new HashSet<string>(); | ||
var textAssets = new HashSet<string>(); | ||
|
||
foreach (var assetPath in assets.Where(IsMutableAsset)) | ||
{ | ||
if (_textAssetsTypes.Contains(AssetDatabase.GetMainAssetTypeAtPath(assetPath))) | ||
{ | ||
textAssets.Add(assetPath); | ||
} | ||
else | ||
{ | ||
regularAssets.Add(assetPath); | ||
} | ||
} | ||
|
||
AssetDatabase.StartAssetEditing(); | ||
ForceReserialize(regularAssets, ForceReserializeAssetsOptions.ReserializeAssetsAndMetadata); | ||
ForceReserialize(textAssets, ForceReserializeAssetsOptions.ReserializeAssets); | ||
AssetDatabase.SaveAssets(); | ||
AssetDatabase.StopAssetEditing(); | ||
} | ||
|
||
private static void ForceReserialize(IEnumerable<string> assetsCollection, ForceReserializeAssetsOptions options) | ||
{ | ||
AssetDatabase.ForceReserializeAssets(assetsCollection, options); | ||
} | ||
|
||
private static bool IsMutableAsset(string assetPath) | ||
{ | ||
var realPath = Path.GetRelativePath(Directory.GetCurrentDirectory(), assetPath); | ||
return _mutableFolders.Any(c => realPath.StartsWith(c)); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,3 +293,4 @@ InputManager: | |
type: 0 | ||
axis: 0 | ||
joyNum: 0 | ||
m_UsePhysicalKeys: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.