@showUI from Play script does not work

All about user interface, be it customizing built-in UIs or adding new ones.
Post Reply
TimoNwaNSiADM
Posts: 9
Joined: 08 May 2022 11:50

@showUI from Play script does not work

Post by TimoNwaNSiADM »

Hello, I've added a button to the Title UI (ctrl+C ctrl+V) as in Custom UI example, and entered string

  • @showUI CreditsUI

in it. After getting an error, I've replaced this to

Code: Select all

@showUI SettingsUI

. But every time this calls an error on click:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
Naninovel.ScriptPlayer.PlayTransientAsync (Naninovel.ScriptPlaylist playlist, Naninovel.CancellationToken cancellationToken) (at Assets/Naninovel/Runtime/ScriptPlayer/ScriptPlayer.cs:350)
UniRx.Async.UniTaskCompletionSource.UniRx.Async.IAwaiter.GetResult () (at Assets/Naninovel/ThirdParty/UniTask/UniRx.Async/UniTaskCompletionSource.cs:112)
UniRx.Async.UniTask.GetResult () (at Assets/Naninovel/ThirdParty/UniTask/UniRx.Async/UniTask.cs:59)
UniRx.Async.UniTask+Awaiter.GetResult () (at Assets/Naninovel/ThirdParty/UniTask/UniRx.Async/UniTask.cs:226)
Naninovel.PlayScript.PlayScriptAsync () (at Assets/Naninovel/Runtime/Script/PlayScript.cs:68)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <71147ca0460545bb99f0885992f306af>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <bd0fb0ffb410470d90a48d812f5481ae>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <bd0fb0ffb410470d90a48d812f5481ae>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <bd0fb0ffb410470d90a48d812f5481ae>:0)
idaot
support
Posts: 275
Joined: 01 Aug 2020 08:25

Re: @showUI from Play script does not work

Post by idaot »

Make sure your version of Unity is supported in Naninovel. For 1.17, it's 2019.4.30 and up and the console will usually let you know if your version of Unity is outdated.

TimoNwaNSiADM
Posts: 9
Joined: 08 May 2022 11:50

Re: @showUI from Play script does not work

Post by TimoNwaNSiADM »

idaot wrote: 08 May 2022 16:39

Make sure your version of Unity is supported in Naninovel. For 1.17, it's 2019.4.30 and up and the console will usually let you know if your version of Unity is outdated.

My Unity version is 2022.1

idaot
support
Posts: 275
Joined: 01 Aug 2020 08:25

Re: @showUI from Play script does not work

Post by idaot »

And also make sure you're using at least 1.17 of Naninovel, I don't recognise the PlayTransientAsync method and Naninovel got rid of the UniRx.Async folder in 1.17. Using an older version of Naninovel with a relatively new version of Unity is not ideal.

Post Reply