-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
solidDoWant
authored and
solidDoWant
committed
Jan 12, 2017
1 parent
60efe23
commit ef18b88
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
using Planetbase; | ||
using System.IO; | ||
using UnityEngine; | ||
|
||
namespace PlanetbaseFramework | ||
{ | ||
class Utils | ||
{ | ||
public static Texture2D LoadPNG(string filePath) | ||
{ | ||
|
||
Texture2D tex = null; | ||
byte[] fileData; | ||
|
||
if (File.Exists(filePath)) | ||
{ | ||
fileData = File.ReadAllBytes(filePath); | ||
tex = new Texture2D(2, 2); | ||
tex.LoadImage(fileData); //..this will auto-resize the texture dimensions. | ||
} | ||
return tex; | ||
} | ||
} | ||
} |