Capture transition between lines

Using Naninovel C# APIs: adding custom actor implementations or commands, overriding engine services, integrating with other systems, etc.
Post Reply
juan.delcastillo
Posts: 30
Joined: 02 Feb 2021 19:11

Capture transition between lines

Post 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?

Elringus
admin
Posts: 538
Joined: 11 May 2020 18:03

Re: Capture transition between lines

Post by Elringus »

Try OnCommand events of IScriptPlayer engine service.

juan.delcastillo
Posts: 30
Joined: 02 Feb 2021 19:11

Re: Capture transition between lines

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

Elringus
admin
Posts: 538
Joined: 11 May 2020 18:03

Re: Capture transition between lines

Post by Elringus »

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

Post Reply