/// <summary> /// Creates the matcher for a background actor with the provided metadata and renderer. /// Will return null in case matcher is not required based on the actor configuration. /// </summary> public static BackgroundMatcher CreateFor(BackgroundMetadata metadata, TransitionalRenderer renderer) { if (renderer is TransitionalSpriteRenderer spriteRenderer && metadata.MatchMode != CameraMatchMode.Disable) { var cameraManager = Engine.GetService <ICameraManager>(); var matcher = new BackgroundMatcher(cameraManager, spriteRenderer, metadata); matcher.Start(); return(matcher); } return(null); }
public override async UniTask InitializeAsync() { await base.InitializeAsync(); matcher = BackgroundMatcher.CreateFor(ActorMetadata, TransitionalRenderer); }