public void Import(string[] imports) { int passedLength = 0; if (imports != null) { if (XCPManager.currentXCP.tileTextures == null) { XCPManager.currentXCP.tileTextures = new Png[imports.Length]; } else { passedLength = XCPManager.currentXCP.tileTextures.Length; Array.Resize(ref XCPManager.currentXCP.tileTextures, XCPManager.currentXCP.tileTextures.Length + imports.Length); } Texture2D tex = new Texture2D(0, 0); for (int i = 0; i < imports.Length; i++) { tex.LoadImage(File.ReadAllBytes(imports[0])); XCPManager.currentXCP.tileTextures[passedLength + i] = XCPManager.TexToPng(tex); } } GenerateMapView(); }
void IconUpdate(string[] iconPath) { if (iconPath[0] == "") { Debug.LogError("Heyyyy No image here"); return; } Texture2D tex = new Texture2D(0, 0); tex.LoadImage(File.ReadAllBytes(iconPath[0])); tex.filterMode = FilterMode.Point; newXCPInstance.xcpIcon = XCPManager.TexToPng(tex); iconPrew.sprite = XCPManager.TexToSprite(tex); }