LoadTexture() 개인적인 정적인 메소드

private static LoadTexture ( string filepath, Texture2D &texture ) : void
filepath string
texture UnityEngine.Texture2D
리턴 void
예제 #1
0
        private void TopArea()
        {
            if (PackageImport.s_PackageIcon == null && !string.IsNullOrEmpty(this.m_PackageIconPath))
            {
                PackageImport.LoadTexture(this.m_PackageIconPath, ref PackageImport.s_PackageIcon);
            }
            bool  flag   = PackageImport.s_PackageIcon != null;
            float height = (!flag) ? 52f : 84f;
            Rect  rect   = GUILayoutUtility.GetRect(base.position.width, height);

            GUI.Label(rect, GUIContent.none, PackageImport.ms_Constants.topBarBg);
            Rect position;

            if (flag)
            {
                Rect r = new Rect(rect.x + 10f, rect.y + 10f, 64f, 64f);
                PackageImport.DrawTexture(r, PackageImport.s_PackageIcon, true);
                position = new Rect(r.xMax + 10f, r.yMin, rect.width, r.height);
            }
            else
            {
                position = new Rect(rect.x + 5f, rect.yMin, rect.width, rect.height);
            }
            GUI.Label(position, this.m_PackageName, PackageImport.ms_Constants.title);
        }
예제 #2
0
 public static Texture2D GetPreview(string previewPath)
 {
     if (previewPath != PackageImport.s_LastPreviewPath)
     {
         PackageImport.s_LastPreviewPath = previewPath;
         PackageImport.LoadTexture(previewPath, ref PackageImport.s_Preview);
     }
     return(PackageImport.s_Preview);
 }