Exemplo n.º 1
0
 public ITexture2D GetReadableTexture2D()
 {
     if (this.m_ReadableTexture == null)
     {
         ITextureImporter assetImporterFromPath = this.m_AssetDatabase.GetAssetImporterFromPath(this.m_SelectedAssetPath);
         int width  = 0;
         int height = 0;
         assetImporterFromPath.GetWidthAndHeight(ref width, ref height);
         this.m_ReadableTexture = SpriteUtility.CreateTemporaryDuplicate(this.m_OriginalTexture, width, height);
         if (this.m_ReadableTexture != null)
         {
             this.m_ReadableTexture.filterMode = FilterMode.Point;
         }
     }
     return(new UnityEngine.U2D.Interface.Texture2D(this.m_ReadableTexture));
 }