live2D (sdk가 6.5 미지원으로 sprite로 대응)
This commit is contained in:
7
Assets/Live2D/Cubism/Samples/Editor/Description.ja.md
Normal file
7
Assets/Live2D/Cubism/Samples/Editor/Description.ja.md
Normal file
@@ -0,0 +1,7 @@
|
||||
[English](Description.md) / [日本語](Description.ja.md)
|
||||
|
||||
---
|
||||
|
||||
# Editor
|
||||
|
||||
このフォルダーには、Cubismアセットのインポートをスクリプトからカスタマイズする方法を示すコードが含まれています。
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8fab83b1af1f444e8a13ec2f29c307a9
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7
Assets/Live2D/Cubism/Samples/Editor/Description.md
Normal file
7
Assets/Live2D/Cubism/Samples/Editor/Description.md
Normal file
@@ -0,0 +1,7 @@
|
||||
[English](Description.md) / [日本語](Description.ja.md)
|
||||
|
||||
---
|
||||
|
||||
# Editor
|
||||
|
||||
This folder contains code showing how Cubism asset importing can be customized from scripts.
|
||||
7
Assets/Live2D/Cubism/Samples/Editor/Description.md.meta
Normal file
7
Assets/Live2D/Cubism/Samples/Editor/Description.md.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fe55a66ba47a944f8c497767cd466b7
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
59
Assets/Live2D/Cubism/Samples/Editor/ImportCustomization.cs
Normal file
59
Assets/Live2D/Cubism/Samples/Editor/ImportCustomization.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright(c) Live2D Inc. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by the Live2D Open Software license
|
||||
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
|
||||
*/
|
||||
|
||||
|
||||
using Live2D.Cubism.Core;
|
||||
using Live2D.Cubism.Rendering;
|
||||
using Live2D.Cubism.Editor.Importers;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
|
||||
namespace Live2D.Cubism.Samples.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows how Cubism model importing can be customized.
|
||||
/// </summary>
|
||||
internal static class ImportCustomization
|
||||
{
|
||||
#region Unity Event Handling
|
||||
|
||||
/// <summary>
|
||||
/// Registers processor.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// BE CAREFUL! Uncomment the following line to enable the sample.
|
||||
// DON'T DO THIS IN REAL PROJECTS!
|
||||
/// </remarks>
|
||||
// [InitializeOnLoadMethod]
|
||||
private static void RegisterModelImporter()
|
||||
{
|
||||
CubismImporter.OnDidImportModel += OnModelImport;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cubism Import Event Handling
|
||||
|
||||
/// <summary>
|
||||
/// Customizes model importing.
|
||||
/// </summary>
|
||||
/// <param name="sender">Event source.</param>
|
||||
/// <param name="model">Imported model.</param>
|
||||
private static void OnModelImport(CubismModel3JsonImporter sender, CubismModel model)
|
||||
{
|
||||
// Lets pretend we want to change the vertex colors of all drawables to green...
|
||||
foreach (var renderer in model.Drawables.Select(d => d.GetComponent<CubismRenderer>()))
|
||||
{
|
||||
renderer.Color = Color.green;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dffce8cbc48222b47aa3ae59c42b7ec5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"reference": "GUID:e5d337e0b3581c343aafde08e6e1727e"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ee4e0eca1d7f0d48a34f54d96ab5db1
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user