Is there a way to know when a transition between two lines of the played Naninovel script has happened through c# scripts?
Capture transition between lines
-
- admin
- Posts: 538
- Joined: 11 May 2020 18:03
Re: Capture transition between lines
Try OnCommand events of IScriptPlayer
engine service.
-
- Posts: 30
- Joined: 02 Feb 2021 19:11
Re: Capture transition between lines
How do I use this event? I've seen a video talking about but I don't know how to declare it
This is my code for reference:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LifeSystem : MonoBehaviour
{
int lifePoints = 90;
public string label;
DirectorScript directorScript;
Slider slider;
void Start()
{
directorScript = FindObjectOfType<DirectorScript>();
slider = gameObject.GetComponent<Slider>();
}
void Update()
{
slider.value = lifePoints;
directorScript.scriptPlayer.OnCommandExecutionFinish;
}
}
-
- admin
- Posts: 538
- Joined: 11 May 2020 18:03
Re: Capture transition between lines
Check out C# tutorials on how to work with events; there is nothing special here on Naninovel side.