Initial commit

This commit is contained in:
msk
2022-01-22 20:13:49 -08:00
parent f9d23e5bcf
commit 687473573d
878 changed files with 70957 additions and 0 deletions
@@ -0,0 +1,37 @@
using System;
using UnityEditor;
using UnityEngine;
public class PrefabLoader : EditorWindow
{
private AssetBundle _bundle;
private string[] _assets = new string[0];
private int _selectedAsset = 0;
[MenuItem("MeatKit/Asset Bundle/Prefab Loader")]
private static void Init()
{
GetWindow<PrefabLoader>().Show();
}
private void OnGUI()
{
if (GUILayout.Button("Select Asset Bundle"))
{
// If there's already a bundle loaded, unload it.
if (_bundle) _bundle.Unload(false);
// Ask for the new bundle, load it, and get its assets
string assetBundlePath = EditorUtility.OpenFilePanel("Select Asset Bundle", string.Empty, string.Empty);
_bundle = AssetBundle.LoadFromFile(assetBundlePath);
_assets = _bundle.GetAllAssetNames();
_selectedAsset = 0;
}
if (_assets.Length > 0)
{
_selectedAsset = EditorGUILayout.Popup(_selectedAsset, _assets);
if (GUILayout.Button("Spawn")) Instantiate(_bundle.LoadAsset(_assets[_selectedAsset]));
}
}
}