Unity導入編
Live2D導入編
-
Cubism 5 SDK for Unity R5 をダウンロードする
https://www.live2d.com/sdk/download/unity/

-
Live2Dを表示するための設定
・Assets/Settings/Renderer2D.assetを選択する
・Inspector の一番下にある「Add Renderer Feature」をクリック
・「Cubism Render Pass Feature」を選択
[参考]
https://zenn.dev/tutupizizizi/articles/unity-live2d-urp-texture-fix

-
青い箱をヒエラルキーにドラッグドロップしてからCubism Fade Contollerに natu_cg_1.fadeMotionListをセットする

Naninovel導入編
-
ウィンドウ>Package Management>パッケージマネージャを開く
-
Scenario>Entryというファイルがあるので、書き加える


@setAnimParam param_on:mo_1 param_off:mo_2,mo_3 NOW mo_1 @setAnimParam param_on:mo_2 param_off:mo_1,mo_3 NOW mo_2 @setAnimParam param_on:mo_3 param_off:mo_1,mo_2 NOW mo_3 -
using System; using Naninovel; using Naninovel.Commands; using NUnit.Framework.Constraints; using UnityEngine; // エイリアスの参考 // https://naninovel.com/ja/guide/custom-commands#%E3%83%8F%E3%82%9A%E3%83%A9%E3%83%A1%E3%83%BC%E3%82%BF%E3%82%A8%E3%82%A4%E3%83%AA%E3%82%A2%E3%82%B9 [Serializable, Alias("setAnimParam")] public class AnimatorParameter : Command { public StringListParameter param_on; public StringListParameter param_off; public override Awaitable Execute(ExecutionContext ctx) { Debug.Log($"setAnimParam が呼ばれた {param_on}{param_off}"); GameObject target = GameObject.FindGameObjectWithTag("natu_1"); if (target != null) { Animator animator = target.GetComponent<Animator>(); if (animator != null) { //animator.SetBool(param, true); foreach (string p in param_on) { animator.SetBool(p, true); } foreach (string p in param_off) { animator.SetBool(p, false); } } else { Debug.LogError("animatorが取得できなかった。"); } } else { Debug.LogError("targetが取得できなかった。"); } // if (Assigned(Name)) Debug.Log($"Hello, {Name}!"); // else Debug.Log("Hello World!"); return Async.Completed; } } -
NullReferenceException: Object reference not set to のエラーが出る場合、編集してからStory Editorの保存ボタンを押すと直る














