private void prepForNewRenderTexture(bool initWorley) { // initialize the texture saver textureSaver = new SaveTexture(); textureSaver.slicer = slicer; textureSaver.slicerKernel = slicerKernel; // initialize the worley noise buffer only if worley will be used if (initWorley) { createWorleyPointsBuffer(); } }
void Update() { if (Texture != null && texName != Texture.name) { texName = Texture.name; HorizontalFlip = FlipTexture.FlipHorizontal(Texture); VerticalFlip = FlipTexture.FlipVertical(Texture); DiagonalFlip = FlipTexture.FlipHorizontal(FlipTexture.FlipVertical(Texture)); HorizontalFlip.name = "HorizontalFlip"; VerticalFlip.name = "VerticalFlip"; DiagonalFlip.name = "DiagonalFlip"; SaveTexture.Save(HorizontalFlip, Constants.Suffixes.ImageSuffixTypes.PNG, Constants.Folders.ClippedRoomTextureFolderPath); SaveTexture.Save(VerticalFlip, Constants.Suffixes.ImageSuffixTypes.PNG, Constants.Folders.ClippedRoomTextureFolderPath); SaveTexture.Save(DiagonalFlip, Constants.Suffixes.ImageSuffixTypes.PNG, Constants.Folders.ClippedRoomTextureFolderPath); } }
public SaveTexture() { Instance = this; }
// Use this for initialization void Start() { instance = this; path = Application.persistentDataPath + "/Images/"; }