DrawTexture() public static method

public static DrawTexture ( Rect r, Texture2D tex, bool useDropshadow ) : void
r UnityEngine.Rect
tex UnityEngine.Texture2D
useDropshadow bool
return 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 override void OnGUI(Rect rect)
 {
     PackageImport.DrawTexture(rect, this.m_Preview, false);
 }