Posts

Showing posts with the label assets

combining png file textures and the Streaming Assets folder

Below is some code that takes whatever pngs you put in the Streaming Assets folder, puts them all into one texture and assigns them to a File Texture  input for a Visual FX graph. Certain things like resolution have been hardcoded into this script, so you might want to alter those numbers. You'll want to use the flipbook image so that each image can be used seperately (or not), as sprites. This should work with normal particles as well, if altered a bit.     using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; using UnityEngine.UI; using UnityEngine.Networking; using UnityEngine.VFX; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; public class multiTextureScan : MonoBehaviour {     public VisualEffect _visualEffect;     public Dictionary<string, Texture2D> textures = new Dictionary<string, Texture2D>();     // Source textures.     pub...