Add project files.

This commit is contained in:
2023-10-08 18:51:40 +02:00
commit 51cc9df14f
2249 changed files with 636804 additions and 0 deletions

View 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);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b3908e8bec00280449aad82fd59cfe1d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7f056bf9df981654780ad064d7184821
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: