Capture transition between lines

Posted: 02 Feb 2021 19:13
by juan.delcastillo

Is there a way to know when a transition between two lines of the played Naninovel script has happened through c# scripts?


Re: Capture transition between lines

Posted: 02 Feb 2021 19:15
by Elringus

Try OnCommand events of IScriptPlayer engine service.


Re: Capture transition between lines

Posted: 02 Feb 2021 19:38
by juan.delcastillo

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;
}
}


Re: Capture transition between lines

Posted: 02 Feb 2021 20:16
by Elringus

Check out C# tutorials on how to work with events; there is nothing special here on Naninovel side.