Script Extensions
Extension methods for ScriptComponent, in the Stride.CommunityToolkit.Engine namespace. Mostly shortcuts for things a script reaches for on almost every frame.
DeltaTime()- Seconds since the last update, instead of writingGame.UpdateTime.Elapsed.TotalSecondsout in full.GetGCCamera()- Gets the camera bound to the graphics compositor slot namedMain. Returnsnullwhen no slot matches.GetGCCamera(cameraName)- The same, for a camera slot you named yourself.GetFirstGCCamera()- Gets the first camera in the graphics compositor whatever its slot is called, which is usually what you want when there is only one.
Note
GC here is the graphics compositor, not the garbage collector. These look the camera up by its
compositor slot rather than by searching the scene, so they find the camera that is actually being
rendered from.