예제 #1
0
        public BackgroundMatcher(ICameraManager cameraManager, TransitionalSpriteRenderer renderer, BackgroundMetadata metadata)
            : base(cameraManager, updateDelay, renderer)
        {
            this.renderer = renderer;
            this.metadata = metadata;

            MatchMode        = metadata.MatchMode;
            CustomMatchRatio = metadata.CustomMatchRatio;
        }
예제 #2
0
 /// <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);
 }
예제 #3
0
 public GenericBackground(string id, BackgroundMetadata metadata)
     : base(id, metadata)
 {
 }
예제 #4
0
 public SpriteBackground(string id, BackgroundMetadata metadata)
     : base(id, metadata)
 {
 }