I’ve run into a small issue that I’m hoping you can help me fix.
I have a cutscene with a nested sub-cutscene that is shorter in length. I use a ScreenFader action to fade the screen to black during the parent cutscene. But when the end of the sub-cutscene is reached, the DirectorGUI attached to the Director Camera is disabled, so the screen fader gets turned off.
I’m using Slate 1.72. I know that’s old and I’m sure you’ve fixed this in a more recent version of Slate, but I have to stick with my older version for this game.
Could you just point in the right direction? Happy to make the fix myself I you tell me where to look,
That is actually a non-wanted behaviour. Thanks for pointing this out. I will need to find a way around this, but the code in question, can be found in Cutscene.OnSampleEnded (and OnSampleStarted) method. OnSampleEnded, is called when a cutscene’s first or last frame is called (from within Sample method). Sample on the other hand is called the same both in editor and in runtime.
Probably a quick fix would be to only call OnSampleEnded and OnSampleStarted if the cutscene is actively playing (isActive). This way, a subcutscene (which is not actually active) will not trigger this. The change would be to locate the OnSampleStarted and OnSampleEnded calls within the Ctuscene.Sample method and do this:
1
2
3
4
5
6
7
8
9
10
11
12
13
//...
if(!Application.isPlaying||isActive){
OnSampleStarted();
}
//...
if(!Application.isPlaying||isActive){
OnSampleEnded();
}
//...
Let me know if this change works for you.
Thank you.
Perhaps it’d be better to edit the OnSampleEnded method itself and only disable the DirectorGUI if isActive? I presume we still want to RestoreLayersActive and all the other stuff in that method?
Hello and sorry for the late reply.
This is also a valid alternative, depending on whether or not you want the sub-cutscene “active layer” to override the “master” cutscene.
I think both ways will work fine though.
Hello again and sorry for the late reply.
“Active Layers”, is a per-cutscene option (can be set in the inspector of the cutscene -> “Explicite Active Layers” ), which will enforce only certain layers (unity layers) to be visible for the duration of the cutscene. All gameobjects in the selected layers will be SetActive(true), while all non-selected will be SetActive(false). Once again, that is for the duration of the cutscene. As soon as the cutscene is done, the gameobject activeState will revert to the original.
I hope that helps deciding the change you want to make 🙂