public bool Equals(WallVariationKey other) { if (WallType == other.WallType) { return(PaintColor == other.PaintColor); } return(false); }
public Texture2D TryGetWallAndRequestIfNotReady(int wallType, int paintColor) { WallVariationKey wallVariationKey = default(WallVariationKey); wallVariationKey.WallType = wallType; wallVariationKey.PaintColor = paintColor; WallVariationKey lookupKey = wallVariationKey; if (_wallsRenders.TryGetValue(lookupKey, out WallRenderTargetHolder value) && value.IsReady) { return(value.Target); } RequestWall(ref lookupKey); return(null); }
public void RequestWall(ref WallVariationKey lookupKey) { if (!_wallsRenders.TryGetValue(lookupKey, out WallRenderTargetHolder value)) { value = new WallRenderTargetHolder { Key = lookupKey }; _wallsRenders.Add(lookupKey, value); } if (!value.IsReady) { _requests.Add(value); } }