private static void ResetModelProperties() { EditorUtility.DisplayProgressBar("Optimize Resource/Reset Model Properties", "Collecting FBX", 0); var gos = EnumAssets.EnumInCurrentSelection <UnityEngine.Object>(); ResetObjectModelProperties(gos); /* * List<string> list = new List<string>(); * { * // foreach(var go in gos) * var __enumerator5 = (gos).GetEnumerator(); * while (__enumerator5.MoveNext()) * { * var go = __enumerator5.Current; * { * var path = AssetDatabase.GetAssetPath(go.GetInstanceID()); * if ((path.Contains(".FBX") || path.Contains(".fbx")) && !path.Contains(".meta")) * { * list.Add(path); * } * } * } * } * * int i = 0; * string log = ""; * { * var __list6 = list; * var __listCount6 = __list6.Count; * for (int __i6 = 0; __i6 < __listCount6; ++__i6) * { * var path = __list6[__i6]; * { * EditorUtility.DisplayProgressBar("Optimize Resource/Reset Model Properties", path, i * 1.0f / list.Count); * log += path + "\n"; * ResetProperty(path); * i++; * } * } * } */ AssetDatabase.Refresh(); // if (!string.IsNullOrEmpty(log)) // { // Debug.Log(log); // } EditorUtility.ClearProgressBar(); //EditorUtility.DisplayDialog("Optimize Resource/Reset Model Properties", "Done Total=" + list.Count.ToString(), "OK"); }
private static void PrintSoundFileLength() { string log = ""; var gos = EnumAssets.EnumInCurrentSelection <UnityEngine.Object>(); foreach (var go in gos) { var path = AssetDatabase.GetAssetPath(go.GetInstanceID()); var audio = Resources.LoadAssetAtPath <AudioClip>(path); if (null != audio) { log += path + "\t" + audio.length + "\n"; } } Debug.Log(log); }
private static void OptimizeTextruePropertie() { var gos = EnumAssets.EnumInCurrentSelection <UnityEngine.Object>(); ResetTextureProperty(gos); }