live2D (sdk가 6.5 미지원으로 sprite로 대응)
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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.Framework.Motion;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Live2D.Cubism.Samples.OriginalWorkflow.Motion
|
||||
{
|
||||
[RequireComponent(typeof(CubismMotionController))]
|
||||
public class CubismMotionPreview : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public AnimationClip Animation;
|
||||
|
||||
/// <summary>
|
||||
/// MotionController to be operated.
|
||||
/// </summary>
|
||||
CubismMotionController _motionController;
|
||||
|
||||
/// <summary>
|
||||
/// Get motion controller.
|
||||
/// </summary>
|
||||
private void Start()
|
||||
{
|
||||
var model = this.FindCubismModel();
|
||||
|
||||
_motionController = model.GetComponent<CubismMotionController>();
|
||||
|
||||
_motionController.AnimationEndHandler += PlayIdleAnimation;
|
||||
|
||||
if (Animation == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
PlayIdleAnimation();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void PlayIdleAnimation(int index = 0)
|
||||
{
|
||||
_motionController.PlayAnimation(Animation, isLoop: false, priority: CubismMotionPriority.PriorityIdle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Play specified animation.
|
||||
/// </summary>
|
||||
/// <param name="animation">Animation clip to play.</param>
|
||||
public void PlayAnimation(AnimationClip animation)
|
||||
{
|
||||
_motionController.PlayAnimation(animation, isLoop: false, priority: CubismMotionPriority.PriorityForce);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2306d75f08d7b8b47823c8a66e70007e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
[English](Description.md) / [日本語](Description.ja.md)
|
||||
|
||||
---
|
||||
|
||||
# Motion
|
||||
|
||||
このサンプルは、OriginalWorkflowを使用してCubismモデルのシンプルなモーションを再生する方法を示しています。
|
||||
|
||||
モーション名の付いた各ボタンをクリックすると、アニメーションが再生されます。
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ed26e6942cdb4f4892f991a5266c65c
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
[English](Description.md) / [日本語](Description.ja.md)
|
||||
|
||||
---
|
||||
|
||||
# Motion
|
||||
|
||||
This sample shows how to play a simple motion of a Cubism model with OriginalWorkflow.
|
||||
|
||||
Animation will be played when you click each button with the motion name.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ffd831e4b5c3f048bd601177ab63c07
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Live2D/Cubism/Samples/OriginalWorkflow/Motion/Motion.unity
LFS
Normal file
BIN
Assets/Live2D/Cubism/Samples/OriginalWorkflow/Motion/Motion.unity
LFS
Normal file
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd8b0413f5722b74694b4df43bf8c762
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user