1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using UnityEditor;
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- [CustomEditor(typeof(SpriteAsset))]
- public class EditorSpriteAsste : Editor
- {
- #region 变量
- private Vector2 ScrollPos;
- #endregion
- public override void OnInspectorGUI()
- {
- base.OnInspectorGUI();
- if (GUILayout.Button("Hit"))
- {
- SpriteAsset.AddAllBundleSpriteInfo();
- }
- ScrollPos = GUILayout.BeginScrollView(ScrollPos, false, false);
- foreach (var kv in SpriteAsset.SpriteInfoDic)
- {
- EditorGUILayout.ObjectField("", kv.Value.Sprite, typeof(Sprite), false);
- GUILayout.BeginVertical();
- EditorGUILayout.LabelField("Name : " + kv.Value.Name);
- EditorGUILayout.LabelField("LowerLeft : " + kv.Value.UvList[0]);
- EditorGUILayout.LabelField("UpperLeft : " + kv.Value.UvList[1]);
- EditorGUILayout.LabelField("UpperRight : " + kv.Value.UvList[2]);
- EditorGUILayout.LabelField("LowerRight : " + kv.Value.UvList[3]);
- EditorGUILayout.LabelField("");
- GUILayout.EndVertical();
- }
- GUILayout.EndScrollView();
- }
- }
|