Hello devs,
I want to run a C# method in game object for camera transition shader effect in the middle of dialogue, (actually when enter one of conversation nodes). I thought of using events but it can't run the script that is component of gameobject (can only run object type).
Is there an easy way to do this?
Running C# method in the middle conversation nodes?
Re: Running C# method in the middle conversation nodes?
Yes, make a custom sequencer command. Here are the steps:
1. Make a copy of Scripts / Templates / SequencerCommandTemplate.cs. For example, let's say you name it SequencerCommandShaderEffect.cs.
2. Edit the script, and fill in your code where the comments indicate.
3. In your conversation node's Sequence field, add:
If you want to also use the default sequence defined on the Dialogue Manager (which delays for a duration based on the subtitle length unless you've changed it), set the Sequence field to:
1. Make a copy of Scripts / Templates / SequencerCommandTemplate.cs. For example, let's say you name it SequencerCommandShaderEffect.cs.
2. Edit the script, and fill in your code where the comments indicate.
3. In your conversation node's Sequence field, add:
Code: Select all
ShaderEffect()
Code: Select all
ShaderEffect();
{{default}}
Re: Running C# method in the middle conversation nodes?
Hi Toni, thank you for your answer,
I try to follow what the doc said, and it gives me 2 error, and it seems it didn't run the function in the script too,
Can you please tell me what did I do wrong?
Thank you
I try to follow what the doc said, and it gives me 2 error, and it seems it didn't run the function in the script too,
Can you please tell me what did I do wrong?
Thank you
- Attachments
-
- arx.JPG (197.5 KiB) Viewed 599 times
Re: Running C# method in the middle conversation nodes?
Sorry, one error is because i put double (;) in the command. But for sendmessage function still not work(it said null).
Re: Running C# method in the middle conversation nodes?
Hello Toni, thank you for answering. I already solve it. (I don't know if not using parameter I just using empty between comas:
sendmessages(function,,obj);
Thank you for your help, cheers
sendmessages(function,,obj);
Thank you for your help, cheers
Re: Running C# method in the middle conversation nodes?
Hi - Thanks for letting me know that you solved it.