public void SetPattern(DesignPattern pattern) { Initialize(); if (this.Pattern != null) { Logger.Log(Logger.Level.TRACE, "Removing old pattern preview and texture."); GameObject.Destroy(Preview.texture); GameObject.Destroy(Preview); } if (pattern == null) { Logger.Log(Logger.Level.ERROR, "Pattern is null!"); } this.Pattern = pattern; this.Name = pattern.Name; if (TooltipHandler == null) { TooltipHandler = GetComponent <TooltipHandler>(); } if (TooltipHandler != null) { TooltipHandler.Tooltip = this.Name; } Preview = pattern.GetPreview(); if (ImageImage == null) { Logger.Log(Logger.Level.ERROR, "ImageImage is null!"); } ImageImage.sprite = Preview; }
public void SetPattern(DesignPattern pattern) { if (this.Pattern != null) { GameObject.DestroyImmediate(Preview.texture); GameObject.DestroyImmediate(Preview); } this.Pattern = pattern; this.Name = pattern.Name; Preview = pattern.GetPreview(); ImageImage.sprite = Preview; }
private void CreatePreviewSprite() { _Pattern.GetPreview(); }