Beispiel #1
0
 public Texture2D TryGetWallAndRequestIfNotReady(int wallType, int paintColor)
 {
     TilePaintSystemV2.WallVariationKey lookupKey = new TilePaintSystemV2.WallVariationKey()
     {
         WallType   = wallType,
         PaintColor = paintColor
     };
     TilePaintSystemV2.WallRenderTargetHolder renderTargetHolder;
     if (this._wallsRenders.TryGetValue(lookupKey, out renderTargetHolder) && renderTargetHolder.IsReady)
     {
         return((Texture2D)renderTargetHolder.Target);
     }
     this.RequestWall(ref lookupKey);
     return((Texture2D)null);
 }
Beispiel #2
0
 public void RequestWall(ref TilePaintSystemV2.WallVariationKey lookupKey)
 {
     TilePaintSystemV2.WallRenderTargetHolder renderTargetHolder;
     if (!this._wallsRenders.TryGetValue(lookupKey, out renderTargetHolder))
     {
         renderTargetHolder = new TilePaintSystemV2.WallRenderTargetHolder()
         {
             Key = lookupKey
         };
         this._wallsRenders.Add(lookupKey, renderTargetHolder);
     }
     if (renderTargetHolder.IsReady)
     {
         return;
     }
     this._requests.Add((TilePaintSystemV2.ARenderTargetHolder)renderTargetHolder);
 }
Beispiel #3
0
 public bool Equals(TilePaintSystemV2.WallVariationKey other)
 {
     return(this.WallType == other.WallType && this.PaintColor == other.PaintColor);
 }