|
@@ -20,60 +20,101 @@ public class EditorBundle : Editor
|
|
|
Bundle.Instance = Script;
|
|
|
}
|
|
|
|
|
|
+ public override void OnInspectorGUI()
|
|
|
+ {
|
|
|
+ base.OnInspectorGUI();
|
|
|
+
|
|
|
+ if (GUILayout.Button("ClearTexture"))
|
|
|
+ {
|
|
|
+ for (int i = 0; i < Script.UiList.Count; i++)
|
|
|
+ {
|
|
|
+ Sprite sprite = Script.UiList[i] as Sprite;
|
|
|
+
|
|
|
+ if (sprite == null)
|
|
|
+ {
|
|
|
+ Texture2D texture = Script.UiList[i] as Texture2D;
|
|
|
+
|
|
|
+ if (texture != null)
|
|
|
+ {
|
|
|
+ Script.UiList.RemoveAt(i--);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < Script.SceneList.Count; i++)
|
|
|
+ {
|
|
|
+ Sprite sprite = Script.SceneList[i] as Sprite;
|
|
|
+
|
|
|
+ if (sprite == null)
|
|
|
+ {
|
|
|
+ Texture2D texture = Script.SceneList[i] as Texture2D;
|
|
|
+
|
|
|
+ if (texture != null)
|
|
|
+ {
|
|
|
+ Script.SceneList.RemoveAt(i--);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static void Tag()
|
|
|
{
|
|
|
string path;
|
|
|
-
|
|
|
+ Bundle bundle;
|
|
|
AssetImporter assetImporter;
|
|
|
|
|
|
- for (int i = 0; i < Script.UiList.Count; i++)
|
|
|
+ bundle = AssetDatabase.LoadAssetAtPath<Bundle>("Assets/Resource/DebugMode.prefab");
|
|
|
+
|
|
|
+ for (int i = 0; i < bundle.UiList.Count; i++)
|
|
|
{
|
|
|
- path = AssetDatabase.GetAssetPath(Script.UiList[i]);
|
|
|
+ path = AssetDatabase.GetAssetPath(bundle.UiList[i]);
|
|
|
|
|
|
assetImporter = AssetImporter.GetAtPath(path);
|
|
|
|
|
|
assetImporter.assetBundleName = "ui";
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < Script.AtlasList.Count; i++)
|
|
|
+ for (int i = 0; i < bundle.AtlasList.Count; i++)
|
|
|
{
|
|
|
- path = AssetDatabase.GetAssetPath(Script.AtlasList[i]);
|
|
|
+ path = AssetDatabase.GetAssetPath(bundle.AtlasList[i]);
|
|
|
|
|
|
assetImporter = AssetImporter.GetAtPath(path);
|
|
|
|
|
|
assetImporter.assetBundleName = "atlas";
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < Script.EffectList.Count; i++)
|
|
|
+ for (int i = 0; i < bundle.EffectList.Count; i++)
|
|
|
{
|
|
|
- path = AssetDatabase.GetAssetPath(Script.EffectList[i]);
|
|
|
+ path = AssetDatabase.GetAssetPath(bundle.EffectList[i]);
|
|
|
|
|
|
assetImporter = AssetImporter.GetAtPath(path);
|
|
|
|
|
|
assetImporter.assetBundleName = "effect";
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < Script.AudioList.Count; i++)
|
|
|
+ for (int i = 0; i < bundle.AudioList.Count; i++)
|
|
|
{
|
|
|
- path = AssetDatabase.GetAssetPath(Script.AudioList[i]);
|
|
|
+ path = AssetDatabase.GetAssetPath(bundle.AudioList[i]);
|
|
|
|
|
|
assetImporter = AssetImporter.GetAtPath(path);
|
|
|
|
|
|
assetImporter.assetBundleName = "audio";
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < Script.SceneList.Count; i++)
|
|
|
+ for (int i = 0; i < bundle.SceneList.Count; i++)
|
|
|
{
|
|
|
- path = AssetDatabase.GetAssetPath(Script.SceneList[i]);
|
|
|
+ path = AssetDatabase.GetAssetPath(bundle.SceneList[i]);
|
|
|
|
|
|
assetImporter = AssetImporter.GetAtPath(path);
|
|
|
|
|
|
assetImporter.assetBundleName = "scene";
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < Script.ConfigList.Count; i++)
|
|
|
+ for (int i = 0; i < bundle.ConfigList.Count; i++)
|
|
|
{
|
|
|
- path = AssetDatabase.GetAssetPath(Script.ConfigList[i]);
|
|
|
+ path = AssetDatabase.GetAssetPath(bundle.ConfigList[i]);
|
|
|
|
|
|
assetImporter = AssetImporter.GetAtPath(path);
|
|
|
|