Is there a way to run the function you wrote in the C# script in the edit window?
If there is a way, please let me know in detail.
I'm using a translator. Please excuse me.
![image](https://github.com/kaYeonTan/OhMyHonor/ ... 391cd74ce8)
I have a question.
Re: I have a question.
Hello,
If you want to run a C# function in a conversation's dialogue entry:
1. Register the function with Lua. Example:
2. Use the function in the dialogue entry's Script field:
If you want to run a C# function in a conversation's dialogue entry:
1. Register the function with Lua. Example:
Code: Select all
public AudioClip beep;
void Awake()
{
Lua.RegisterFunction(nameof(Beep), this, SymbolExtensions.GetMethodInfo(() => Beep()));
}
public void Beep()
{
AudioSource.PlayClipAtPoint(beep, Vector3.zero);
}