You've already forked FateViewer
Add project files.
This commit is contained in:
40
Assets/Editor/AvatarMaker.cs
Normal file
40
Assets/Editor/AvatarMaker.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Infrastructure.Editor
|
||||
{
|
||||
public class AvatarMaker
|
||||
{
|
||||
[MenuItem("CustomTools/MakeAvatarMask")]
|
||||
private static void MakeAvatarMask()
|
||||
{
|
||||
GameObject activeGameObject = Selection.activeGameObject;
|
||||
|
||||
if (activeGameObject != null)
|
||||
{
|
||||
AvatarMask avatarMask = new AvatarMask();
|
||||
|
||||
avatarMask.AddTransformPath(activeGameObject.transform);
|
||||
|
||||
var path = string.Format("Assets/{0}.mask", activeGameObject.name.Replace(':', '_'));
|
||||
AssetDatabase.CreateAsset(avatarMask, path);
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("CustomTools/MakeAvatar")]
|
||||
private static void MakeAvatar()
|
||||
{
|
||||
GameObject activeGameObject = Selection.activeGameObject;
|
||||
|
||||
if (activeGameObject != null)
|
||||
{
|
||||
Avatar avatar = AvatarBuilder.BuildGenericAvatar(activeGameObject, "");
|
||||
avatar.name = activeGameObject.name;
|
||||
Debug.Log(avatar.isHuman ? "is human" : "is generic");
|
||||
|
||||
var path = string.Format("Assets/{0}.ht", avatar.name.Replace(':', '_'));
|
||||
AssetDatabase.CreateAsset(avatar, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Editor/AvatarMaker.cs.meta
Normal file
11
Assets/Editor/AvatarMaker.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3908e8bec00280449aad82fd59cfe1d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
24
Assets/Editor/CreateAssetBundles.cs
Normal file
24
Assets/Editor/CreateAssetBundles.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
|
||||
public class CreateAssetBundles
|
||||
{
|
||||
[MenuItem("Assets/Build selected as AssetBundle")]
|
||||
static void BuildAssetBundle()
|
||||
{
|
||||
string assetBundleDirectory = "Assets/AssetBundles/";
|
||||
if (!Directory.Exists(assetBundleDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(assetBundleDirectory);
|
||||
}
|
||||
BuildPipeline.BuildAssetBundle(Selection.activeObject, new UnityEngine.Object[] { Selection.activeObject }, assetBundleDirectory + Selection.activeObject.name,
|
||||
BuildAssetBundleOptions.UncompressedAssetBundle,
|
||||
EditorUserBuildSettings.activeBuildTarget);
|
||||
}
|
||||
|
||||
[MenuItem("Assets/Build selected as AssetBundle", true)]
|
||||
static bool CheckAssetBundlePossible()
|
||||
{
|
||||
return Selection.activeObject != null;
|
||||
}
|
||||
}
|
||||
11
Assets/Editor/CreateAssetBundles.cs.meta
Normal file
11
Assets/Editor/CreateAssetBundles.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f056bf9df981654780ad064d7184821
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user