예제 #1
0
        /// <summary>
        /// Turn byte array to sprite data.
        /// </summary>
        /// <param name="data"> Byte array ready to convert to sprite data. </param>
        /// <param name="pixelPerUnit"> Pixel per unit conversion to world space. </param>
        /// <returns> Sprite that had been converted. </returns>
        public static Sprite AsSprite(byte[] data, float pixelPerUnit = 100.0f)
        {
            Texture2D tex = AsTexture2D(data);

            return(JCS_ImageLoader.Create(tex, pixelPerUnit));
        }
예제 #2
0
        /// <summary>
        /// Load screenshot image by file index.
        /// </summary>
        /// <param name="index"> File's index. </param>
        /// <param name="pixelPerUnit"> Pixel per unit conversion to world space. </param>
        /// <returns> Sprite object that loaded image file by index. </returns>
        public static Sprite LoadImageByIndex(int index, float pixelPerUnit = 100.0f)
        {
            string path = ImagePathByIndex(index);

            return(JCS_ImageLoader.LoadImage(path, pixelPerUnit));
        }
예제 #3
0
 /// <summary>
 /// Turn byte array to texture data.
 /// </summary>
 /// <param name="data"> Byte array ready to convert to texture data. </param>
 /// <returns> Texture that had been converted. </returns>
 public static Texture2D AsTexture2D(byte[] data)
 {
     return(JCS_ImageLoader.ConvertToTexture(data));
 }