Hi,
First thank you for the great tool, I loved.
even for me as a unity noob/beginner it’s simple to understand.
But something I can’t find how to do it:
I have a script attached on an Object, I want to that script be enabled or disabled during the cutscene is that possible?
the script itself is the Draw Call Minimizer script from the AssetStore
Hello and sorry for the late reply!
Thanks a lot. I am really glad you like SLATE.
Yes, that is quite possible to do, simply by using the action clip named “Set Behaviours Active State” found under the “GameObject” category in an ActionTrack. The “Set Behaviours Active State” action clip, will list all monobehaviours attached on the target actor in the clip’s inspector along with a checkbox next to each one of those. Then the clip allow you to either Enable, Disable, or Toggle those checked scripts.
Thank you will try that, but what if I have a script not attached on any object so not a monobehaviours.
For example I couldn’t find how to load a new scene in the cut scene, so I did a script which do this for me and I need to run that script somewhere in the middle of the cut scene.
Also sorry can you enplane a little bit how the cut scene “skip” and “End” work.
If you want to run a function at some point in the cutscene, then you can create a script with that function and attach it on the Cutscene gameobject and finally use the “Events/Send Global Message” action clip possible to be added on the ActionTrack of the Director Group. Then in the inspector of that action clip, set the function you want to call.
So lets suppose that you have this script attached on the Cutscene GameObject:
1
2
3
4
5
6
7
8
publicclassMyScript:MonoBehaviour{
publicvoidLoadScene(stringname){
Application.LoadLevel(name);
}
}
You can then add “Events/Send Global Message (string)” action clip on an ActionTrack of the Director Group and set it to call the function named “LoadScene” with a parameter named “Menu”.
[attachment file=”SendGlobalMessage.png”]
So, at least right now, only methods existing on MonoBehaviours and attached to either the Cutscene gameobject or any of it’s affected actor gameobjects, can be called from within the cutscene (similar to how Animation Events in Unity work).
Regarding your question about “Skip” and “End”, can you please clarify what you mean?
Are you asking about the “Default Stop Mode” options (Skip/Rewind/Hold) seen in the Cutscene inspector?