Code: Select all
public class ChangeTextSpeed : MonoBehaviour
{
[SerializeField] private TextAsset _inkJSON;
public UnityUITypewriterEffect _typeWriterEffect;
public DialogueSystemInkIntegration DSII;
Story _story;
public void Start()
{
_story = DSII.GetStory(_inkJSON.name);
DSII.GetStory(_inkJSON.name).BindExternalFunction("SetIntVariable", (int value, int value1) =>
{
SetTypewriterSpeed(value);
}
);
}
public void Update()
{
// Debug.Log(DSII.GetStory(_inkJSON.name).currentChoices.Count);
}
public void SetTypewriterSpeed(float value)
{
_typeWriterEffect.charactersPerSecond = value;
}
}
It also doesn't call the bound function SetTypeWriterSpeed, does anyone know how this is happening? I feel like everything should work as there are no errors nor does my ink file go to the internal function SetIntVariable
Ink file:
Code: Select all
VAR SomeText = ""
EXTERNAL SetIntVariable(x,y)
->main
=== main ===
Do this test work? #speaker:luka
* Yes#speaker:luka
Yes it does!#speaker:Not luka so much
~ SomeText = "You chose yes"
->main
*[No]#speaker:luka
~SetIntVariable(1, 0)
Well you say no, but actually yes, also the plus means that this option always stays present, removing the "+" and changing it to a "*" will make it continue to last option, also this text takes longer to scrool, click yes will make it go faster
~ SomeText = "You chose no"
->main
*Done
When you choose this option you're just done!! But first theres a choice WITHIN a choice!
**Ok I dont care
**CHOICECEPTION
-Now yer done
// ->DONE
*->
Either way your choices don't matter, it does work. I'm calling a function now that prints out the option you chose.
->chosen
=== chosen ===
{SomeText}
Now I will call a function that passes what you chose to the function
->chosenparam(SomeText)
===chosenparam(sometext)===
{sometext} + 1
->DONE
-> END
==function SetIntVariable(x,y)==
stom programma
~return 1