91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 11.85MB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-06-18
  • 語言: C#
  • 標(biāo)簽: NGUI??

資源簡介

2018能用UI組件。NGUI是嚴(yán)格遵循KISS原則并用C#編寫的Unity(適用于專業(yè)版和免費版)插件,提供強大的UI系統(tǒng)和事件通知框架。其代碼簡潔,多數(shù)類少于200行代碼。

資源截圖

代碼片段和文件信息

using?UnityEngine;
using?UnityEditor;
using?System.Collections.Generic;

///?
///?Inspector?class?used?to?edit?Inventory?Databases.
///?


[CustomEditor(typeof(InvDatabase))]
public?class?InvDatabaseInspector?:?Editor
{
static?int?mIndex?=?0;

bool?mConfirmDelete?=?false;

///?
///?Draw?an?enlarged?sprite?within?the?specified?texture?atlas.
///?


public?Rect?DrawSprite?(Texture2D?tex?Rect?sprite?Material?mat)?{?return?DrawSprite(tex?sprite?mat?true?0);?}

///?
///?Draw?an?enlarged?sprite?within?the?specified?texture?atlas.
///?


public?Rect?DrawSprite?(Texture2D?tex?Rect?sprite?Material?mat?bool?addPadding)
{
return?DrawSprite(tex?sprite?mat?addPadding?0);
}

///?
///?Draw?an?enlarged?sprite?within?the?specified?texture?atlas.
///?


public?Rect?DrawSprite?(Texture2D?tex?Rect?sprite?Material?mat?bool?addPadding?int?maxSize)
{
float?paddingX?=?addPadding???4f?/?tex.width?:?0f;
float?paddingY?=?addPadding???4f?/?tex.height?:?0f;
float?ratio?=?(sprite.height?+?paddingY)?/?(sprite.width?+?paddingX);

ratio?*=?(float)tex.height?/?tex.width;

//?Draw?the?checkered?background
Color?c?=?GUI.color;
Rect?rect?=?NGUIEditorTools.DrawBackground(tex?ratio);
GUI.color?=?c;

if?(maxSize?>?0)
{
float?dim?=?maxSize?/?Mathf.Max(rect.width?rect.height);
rect.width?*=?dim;
rect.height?*=?dim;
}

//?We?only?want?to?draw?into?this?rectangle
if?(Event.current.type?==?EventType.Repaint)
{
if?(mat?==?null)
{
GUI.DrawTextureWithTexCoords(rect?tex?sprite);
}
else
{
//?NOTE:?DrawPreviewTexture?doesn‘t?seem?to?support?BeginGroup-based?clipping
//?when?a?custom?material?is?specified.?It?seems?to?be?a?bug?in?Unity.
//?Passing?‘null‘?for?the?material?or?omitting?the?parameter?clips?as?expected.
UnityEditor.EditorGUI.DrawPreviewTexture(sprite?tex?mat);
//UnityEditor.EditorGUI.DrawPreviewTexture(drawRect?tex);
//GUI.DrawTexture(drawRect?tex);
}
rect?=?new?Rect(sprite.x?+?rect.x?sprite.y?+?rect.y?sprite.width?sprite.height);
}
return?rect;
}

///?
///?Helper?function?that?sets?the?index?to?the?index?of?the?specified?item.
///?


public?static?void?SelectIndex?(InvDatabase?db?InvbaseItem?item)
{
mIndex?=?0;

foreach?(InvbaseItem?i?in?db.items)
{
if?(i?==?item)?break;
++mIndex;
}
}

///?
///?Draw?the?inspector?widget.
///?


public?override?void?OnInspectorGUI?()
{
NGUIEditorTools.SetLabelWidth(80f);
InvDatabase?db?=?target?as?InvDatabase;
NGUIEditorTools.DrawSeparator();

InvbaseItem?item?=?null;

if?(db.items?==?null?||?db.items.Count?==?0)
{
mIndex?=?0;
}
else
{
mIndex?=?Mathf.Clamp(mIndex?0?db.items.Count?-?1);
item?=?db.items[mIndex];
}

if?(mConfirmDelete)
{
//?Show?the?confirmation?dialog
GUILayout.Label(“Are?you?sure?you?want?to?delete?‘“?+?item.name?+?“‘?“);
NGUI

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-02-11?16:22??NGUI\
?????目錄???????????0??2019-02-11?16:22??NGUI\Editor\
?????目錄???????????0??2019-02-11?16:22??NGUI\Editor\Preview\
?????文件???????15578??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Background.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Background.png.meta
?????文件???????18984??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Button.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Button.png.meta
?????文件???????18520??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Checkbox.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Checkbox.png.meta
?????文件????????8328??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Horizontal?Scroll?Bar.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Horizontal?Scroll?Bar.png.meta
?????文件????????4875??2018-06-29?08:15??NGUI\Editor\Preview\Control?-?Colored?Popup?List.png
?????文件?????????955??2018-06-29?08:15??NGUI\Editor\Preview\Control?-?Colored?Popup?List.png.meta
?????文件???????13110??2018-06-29?08:13??NGUI\Editor\Preview\Control?-?Colored?Progress?Bar.png
?????文件?????????955??2018-06-29?08:13??NGUI\Editor\Preview\Control?-?Colored?Progress?Bar.png.meta
?????文件????????6255??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Slider.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Slider.png.meta
?????文件????????8276??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Vertical?Scroll?Bar.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Colored?Vertical?Scroll?Bar.png.meta
?????文件????????6007??2018-06-29?08:16??NGUI\Editor\Preview\Control?-?Simple?Button.png
?????文件?????????955??2018-06-29?08:16??NGUI\Editor\Preview\Control?-?Simple?Button.png.meta
?????文件???????16145??2018-06-29?08:16??NGUI\Editor\Preview\Control?-?Simple?Checkbox.png
?????文件?????????955??2018-06-29?08:16??NGUI\Editor\Preview\Control?-?Simple?Checkbox.png.meta
?????文件????????3112??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Simple?Horizontal?Scroll?Bar.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Simple?Horizontal?Scroll?Bar.png.meta
?????文件????????5876??2018-06-29?08:13??NGUI\Editor\Preview\Control?-?Simple?Horizontal?Slider.png
?????文件?????????955??2018-06-29?08:13??NGUI\Editor\Preview\Control?-?Simple?Horizontal?Slider.png.meta
?????文件????????8570??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Simple?Input?Field.png
?????文件?????????955??2018-06-29?08:14??NGUI\Editor\Preview\Control?-?Simple?Input?Field.png.meta
?????文件????????7689??2018-06-29?08:13??NGUI\Editor\Preview\Control?-?Simple?Popup?List.png
?????文件?????????955??2018-06-29?08:13??NGUI\Editor\Preview\Control?-?Simple?Popup?List.png.meta
............此處省略820個文件信息

評論

共有 條評論