注册 登录
  • 欢迎访问Sharezer Blog

NGUI的NGUIEditorTools类

NGUI sharezer 942次浏览 已收录 0个评论
//返回一个空白可用1x1白色纹理
static public Texture2D blankTexture

//返回一个可用的纹理,看起来像一个黑色的检查板
static public Texture2D backdropTexture

//返回一个可用的纹理,看起来像一个高对比度检查板
static public Texture2D contrastTexture

//用于标题栏/标题的梯度纹理
static public Texture2D gradientTexture

//创建一个白色的虚拟纹理
static Texture2D CreateDummyTex ()

//创建一个检查背景的纹理
static Texture2D CreateCheckerTex (Color c0, Color c1)

//创建一个渐变纹理
static Texture2D CreateGradientTex ()

//绘制纹理贴图。像GUI.DrawTexture()但平铺而伸
static public void DrawTiledTexture (Rect rect, Texture tex)

//在指定的矩形周围绘制一个单位像素轮廓
static public void DrawOutline (Rect rect)
static public void DrawOutline (Rect rect, Color color)
static public void DrawOutline (Rect rect, Rect relative, Color color)
static public void DrawOutline (Rect rect, Rect relative)
//绘制一个九宫格轮廓
static public void DrawOutline (Rect rect, Rect outer, Rect inner)

//画一个方格背景为指定的纹理
static public Rect DrawBackground (Texture2D tex, float ratio)

//绘制一个可见的分隔符
static public void DrawSeparator ()

//显示一个列表的精灵和返回选择
static public string DrawList (string field, string[] list, string selection, params GUILayoutOption[] options)
static public string DrawAdvancedList (string field, string[] list, string selection, params GUILayoutOption[] options)

//返回选定对象的根对象
static public GameObject SelectedRoot ()
static public GameObject SelectedRoot (bool createIfMissing)

//检查看看这个动作会破坏预置连接
static public bool WillLosePrefab (GameObject root)
//更改指定的纹理资产的导入设置
static public bool MakeTextureReadable (string path, bool force)
//改变指定的纹理资产的导入设置,使其适合作为纹理图集使用
static bool MakeTextureAnAtlas (string path, bool force, bool alphaTransparency)

//修复指定的纹理的导入设置,必要时重新导入它
static public Texture2D ImportTexture (string path, bool forInput, bool force, bool alphaTransparency)
static public Texture2D ImportTexture (Texture tex, bool forInput, bool force, bool alphaTransparency)

//获取图集对应纹理路径
static public string GetSaveableTexturePath (UIAtlas atlas)

//返回当前选择对象所在的文件夹
static public string GetSelectionFolder ()

//查找所有场景组件,活动或非活动
static public List<T> FindAll<T> () where T : Component

static public bool DrawPrefixButton (string text)
static public bool DrawPrefixButton (string text, params GUILayoutOption[] options)
static public int DrawPrefixList (int index, string[] list, params GUILayoutOption[] options)
static public int DrawPrefixList (string text, int index, string[] list, params GUILayoutOption[] options)

static public void DrawSprite (Texture2D tex, Rect rect, UISpriteData sprite, Color color)
static public void DrawSprite (Texture2D tex, Rect drawRect, UISpriteData sprite, Color color, Material mat)
static public void DrawSprite (Texture2D tex, Rect drawRect, Color color, Rect textureRect, Vector4 border)
static public void DrawSprite (Texture2D tex, Rect drawRect, Color color, Material mat, int x, int y, int width, int height, int borderLeft, int borderBottom, int borderRight, int borderTop)
public static void DrawTexture (Texture2D tex, Rect rect, Rect uv, Color color)
public static void DrawTexture (Texture2D tex, Rect rect, Rect uv, Color color, Material mat)

//画一个精灵选择字段
static public void DrawSpriteField (string label, UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
static public void DrawPaddedSpriteField (string label, UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
static public void DrawSpriteField (string label, string caption, UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
static public bool DrawSpriteField (UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, params GUILayoutOption[] options)
static public void DrawSpriteField (string label, SerializedObject ob, string spriteField, params GUILayoutOption[] options)
static public void DrawSpriteField (string label, SerializedObject ob, SerializedProperty atlas, SerializedProperty sprite, params GUILayoutOption[] options)
static public void DrawSpriteField (string label, SerializedObject ob, SerializedProperty atlas, SerializedProperty sprite, bool removable, params GUILayoutOption[] options)
static public void DrawSpriteField (string label, SerializedObject ob, SerializedProperty atlas, SerializedProperty sprite, float width, bool padded, bool removable, params GUILayoutOption[] options)
static public void DrawAdvancedSpriteField (UIAtlas atlas, string spriteName, SpriteSelector.Callback callback, bool editable, params GUILayoutOption[] options)

//重画所有inspector窗口的精灵
static public void RepaintSprites ()

//选择当前图集里的指定精灵
static public void SelectSprite (string spriteName)
//选择指定的图集里的精灵
static public void SelectSprite (UIAtlas atlas, string spriteName)

//选择指定的游戏对象
static public void Select (GameObject go)
//选择前一选中对象
static public void SelectPrevious ()

//是否有一个统一的缩放
static public bool IsUniform (Vector3 scale)
//检查指定的游戏对象是否有一个统一的缩放
static public bool IsUniform (GameObject go)
//修正指定对象的统一缩放比例
static public void FixUniform (GameObject go)

//绘制一个Header标签
static public bool DrawMinimalisticHeader (string text)
static public bool DrawHeader (string text)
static public bool DrawHeader (string text, string key)
static public bool DrawHeader (string text, bool detailed)
static public bool DrawHeader (string text, string key, bool forceOn, bool minimalistic)

//开始绘制内容区域
static public void BeginContents ()
static public void BeginContents (bool minimalistic)
//结束绘制内容区域
static public void EndContents ()

//绘制委托列表
static public void DrawEvents (string text, Object undoObject, List<EventDelegate> list)
static public void DrawEvents (string text, Object undoObject, List<EventDelegate> list, bool minimalistic)
static public void DrawEvents (string text, Object undoObject, List<EventDelegate> list, string noTarget, string notValid, bool minimalistic)

//绘制一个序列化的属性
static public SerializedProperty DrawProperty (this SerializedObject serializedObject, string property, params GUILayoutOption[] options)
static public SerializedProperty DrawProperty (this SerializedObject serializedObject, string property, string label, params GUILayoutOption[] options)
static public SerializedProperty DrawProperty (string label, SerializedObject serializedObject, string property, params GUILayoutOption[] options)
static public SerializedProperty DrawPaddedProperty (this SerializedObject serializedObject, string property, params GUILayoutOption[] options)
static public SerializedProperty DrawPaddedProperty (string label, SerializedObject serializedObject, string property, params GUILayoutOption[] options)
static public SerializedProperty DrawProperty (string label, SerializedObject serializedObject, string property, bool padding, params GUILayoutOption[] options)
static public void DrawProperty (string label, SerializedProperty sp, params GUILayoutOption[] options)
static public void DrawProperty (string label, SerializedProperty sp, bool padding, params GUILayoutOption[] options)
//绘制一个序列化的数组属性
static public void DrawArray (this SerializedObject obj, string property, string title)
//绘制一个紧凑的Vector4
static public void DrawBorderProperty (string name, SerializedObject serializedObject, string field)
//绘制一个紧凑的Rect
static public void DrawRectProperty (string name, SerializedObject serializedObject, string field)
static public void DrawRectProperty (string name, SerializedObject serializedObject, string field, float labelWidth, float spacing)

//从鼠标位置确定到4点指定的世界矩形的距离
static public float SceneViewDistanceToRectangle (Vector3[] worldPoints, Vector2 mousePos)

//光线投射到指定的面板,返回一个列表控件。
static public List<UIWidget> SceneViewRaycast (Vector2 mousePos)

//选择最顶部的部件在指定的屏幕坐标
static public bool SelectWidget (Vector2 pos)
static public bool SelectWidget (GameObject start, Vector2 pos, bool inFront)

//创建一个撤消
static public void RegisterUndo (string name, params Object[] objects)

//获取指定类型的内部类标识
static public int GetClassID (System.Type type)
static public int GetClassID<T> () where T : MonoBehaviour

//一个指定类型的替换指定MonoBehaviour
static public SerializedObject ReplaceClass (MonoBehaviour mb, System.Type type)
static public SerializedObject ReplaceClass (MonoBehaviour mb, int classID)
static public void ReplaceClass (SerializedObject ob, int classID)
static public void ReplaceClass (SerializedObject ob, System.Type type)
static public T ReplaceClass<T> (MonoBehaviour mb) where T : MonoBehaviour

//自动更新指定图集中的精灵从所有场景中的UITextures
static public void UpgradeTexturesToSprites (UIAtlas atlas)

//显示屏幕上哪一位置上所有精灵的列表
static public void ShowSpriteSelectionMenu (Vector2 screenPos)

//加载指定路径的资源
static public Object LoadAsset (string path)
static public T LoadAsset<T> (string path) where T: Object

//获取Object的GUID
static public string ObjectToGUID (Object obj)
//通过GUID获取Object
static public Object GUIDToObject (string guid)
static public T GUIDToObject<T> (string guid) where T : Object

//添加一个边界周围指定的颜色缓冲区的宽度和高度的一个单一的像素周围,返回的颜色缓冲区将有它的宽度和高度增加了2
static public Color32[] AddBorder (Color32[] colors, int width, int height)
//向指定的颜色缓冲区添加一个软阴影
static public void AddShadow (Color32[] colors, int width, int height, Color shadow)
//向指定的颜色缓冲区添加一个视觉深度效果
static public void AddDepth (Color32[] colors, int width, int height, Color shadow)

//在右侧绘制18个像素填充。用于对齐字段。
static public void DrawPadding ()


Sharezer , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明NGUI的NGUIEditorTools类
喜欢 (0)
[liangshaoze@sina.cn]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址