FAtlasManager.LoadImage C# (CSharp) Method

LoadImage() public method

public LoadImage ( string imagePath ) : void
imagePath string
return void
    public void LoadImage(string imagePath)
    {
        if(DoesContainAtlas(imagePath)) return; //we already have it

        string filePath = imagePath+Futile.resourceSuffix+"_png";

        TextAsset imageBytes = Resources.Load (filePath, typeof(TextAsset)) as TextAsset;

        if(imageBytes != null) //do we have png bytes?
        {
            Texture2D texture = new Texture2D(0,0,TextureFormat.ARGB32,false);

            texture.LoadImage(imageBytes.bytes);

            Resources.UnloadAsset(imageBytes);

            LoadAtlasFromTexture(imagePath, texture);
        }
        else //load it as a normal Unity image asset
        {
            ActuallyLoadAtlasOrImage(imagePath, imagePath+Futile.resourceSuffix,"");
        }
    }