Hello.
I am a Japanese user.
This question is also posted using DeepL, so I apologize for the poor English.
I'm currently thinking of using Naninovel for my game conversations.
As a first step, I tried to initialize it manually and load NaniScript from C#.
I used a Japanese site for reference.
However, I got an error and it does not work well.
I don't even know what the problem is, and I'm in trouble.
Can you please help me?
The error message is as follows.
System.ArgumentException: Input Axis Mouse ScrollWheel is not setup.
To change the input settings use: Edit -> Settings -> Input
at (wrapper managed-to-native) UnityEngine.Input.GetAxis(string)
at Naninovel.InputAxisTrigger.Sample () [0x00013] in D:\unitygame\CorgiEngine_Study_Project\Assets\Naninovel\Runtime\Input\InputAxisTrigger.cs:25
at Naninovel.InputSampler.<SampleInput>g_SampleAxes|43_1 () [0x00020] in D:\unitygame\CorgiEngine_Study_Project\Assets\Naninovel\Runtime\Input\InputSampler.cs:122
at Naninovel.InputSampler.SampleInput () [0x00061] in D:\unitygame\CorgiEngine_Study_Project\Assets\Naninovel\Runtime\Input\InputSampler.cs:100
at Naninovel.InputManager.SampleInputAsync (System.Threading.CancellationToken cancellationToken) [0x000bc] in D:\unitygame\CorgiEngine_Study_Project\Assets\Naninovel\Runtime\Input\InputManager.cs:168
UnityEngine.Debug:LogError (object)
Naninovel.Async.UniTaskScheduler:PublishUnobservedTaskException (System.Exception) (at Assets/Naninovel/Runtime/Common/Async/UniTask/UniTaskScheduler.cs:65)
Naninovel.Async.CompilerServices.AsyncUniTaskVoidMethodBuilder:SetException (System.Exception) (at Assets/Naninovel/Runtime/Common/Async/UniTask/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs:29)
Naninovel.InputManager/<SampleInputAsync>d_24:MoveNext () (at Assets/Naninovel/Runtime/Input/InputManager.cs:156)
Naninovel.Async.CompilerServices.MoveNextRunner`1<Naninovel.InputManager/<SampleInputAsync>d__24>:Run () (at Assets/Naninovel/Runtime/Common/Async/UniTask/CompilerServices/MoveNextRunner.cs:16)
Naninovel.Async.Internal.ContinuationQueue:RunCore () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Internal/ContinuationQueue.cs:193)
Naninovel.Async.Internal.ContinuationQueue:EarlyUpdate () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Internal/ContinuationQueue.cs:153)
Naninovel.Async.Internal.ContinuationQueue:Run () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Internal/ContinuationQueue.cs:100)
The code I used is as follows
I attached the following code to an object from the game and ran the game.
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Naninovel;
public class nani_initTest : MonoBehaviour
{
private int scriptCnt = 0;
private bool nextFlag = false;
private ScriptPlayer player = null;
private string[] scriptList = new string[]
{
"StartScript", "SecondScript"
};
// Start is called before the first frame update
void Start()
{
NaninovelInitial();
}
async void NaninovelInitial()
{
Debug.Log("test0");
// 初期化完了のメッセージを表示。
Engine.OnInitializationFinished += () =>
{
Debug.Log("Naninovel Initialize Complete.");
nextFlag = true;
player = Engine.GetService<ScriptPlayer>();
player.OnStop += (Script script) =>
{
scriptCnt++;
nextFlag = true;
};
};
Debug.Log("test2");
// ノベルシステムの初期化
await RuntimeInitializer.InitializeAsync();
Debug.Log("test1");
}
// Update is called once per frame
void Update()
{
if (nextFlag)
{
nextFlag = false;
if (scriptList.Length > scriptCnt)
{
PlayNaninovelMessage(scriptList[scriptCnt]);
}
}
}
async void PlayNaninovelMessage(string id)
{
await player.PreloadAndPlayAsync(id);
}
}