示例#1
0
 private void DrawBoneWearInfo()
 {
     ShowUtil.DrawTitle("骨骼装配方案", Color.magenta);
     ShowUtil.DrawLine();
     GUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("添加骨骼", GUILayout.Width(120f)))
     {
         List <EquipInfo.EquipSki> skis;
         if (equipInfo.skis == null)
         {
             skis = new List <EquipInfo.EquipSki>();
         }
         else
         {
             skis = new List <EquipInfo.EquipSki>(equipInfo.skis);
         }
         skis.Add(new EquipInfo.EquipSki());
         equipInfo.skis = skis.ToArray();
     }
     GUILayout.EndHorizontal();
     if (null == equipInfo.skis)
     {
         return;
     }
     for (int i = 0; i < equipInfo.skis.Length; ++i)
     {
         ShowUtil.DrawLine();
         DrawOneSki(equipInfo.skis[i]);
     }
 }
示例#2
0
        private void DrawSpriteColliderInfo()
        {
            ShowUtil.DrawTitle("代表本体的碰撞信息", Color.magenta);
            ShowUtil.DrawLine();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("重置", GUILayout.Width(120f)))
            {
                SetSpriteCollider();
            }
            GUILayout.EndHorizontal();
            if (spriteInfo.spriteCollider == null)
            {
                EditorUtils.DrawNoCollider();
                return;
            }

            ObjCollider objCollider = spriteInfo.spriteCollider;

            EditorGUI.indentLevel += 2;
            EditorGUILayout.ObjectField("碰撞体",
                                        objCollider,
                                        typeof(ObjCollider), true);
            objCollider.gameObject.layer = EditorGUILayout.LayerField("碰撞体层级", objCollider.gameObject.layer, GUILayout.ExpandWidth(true));
            EditorGUILayout.ObjectField("信息体", objCollider.info, typeof(ObjInfo), true);
            EditorGUI.indentLevel -= 2;
        }
示例#3
0
        private void DrawObstacleInfo()
        {
            ShowUtil.DrawTitle("障碍信息", Color.yellow);
            ShowUtil.DrawLine();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("设置障碍", GUILayout.Width(120f)))
            {
                SetObstacle();
            }
            GUILayout.EndHorizontal();
            if (itemInfo.obstacle == null)
            {
                EditorGUILayout.LabelField("没有设置障碍", GUILayout.Width(120));
                return;
            }
            EditorGUI.indentLevel += 2;
            EditorGUILayout.ObjectField("障碍", itemInfo.obstacle, typeof(GameObject), true);
            Collider obstacleCollider = itemInfo.obstacle.GetComponent <Collider>();

            if (obstacleCollider == null)
            {
                EditorGUILayout.LabelField("请设置障碍的Collider");
            }
            EditorGUI.indentLevel -= 2;
        }
示例#4
0
        private void DrawUsableColliderInfo()
        {
            ShowUtil.DrawTitle("使用的碰撞信息", Color.magenta);
            ShowUtil.DrawLine();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("添加", GUILayout.Width(120f)))
            {
                UseableCollider        collider     = EditorUtils.AddUsableCollider(furniture.transform, furnitureInfo, 3, true);
                List <UseableCollider> newColliders = new List <UseableCollider>(furnitureInfo.usableColliders);
                newColliders.Add(collider);
                furnitureInfo.usableColliders = newColliders.ToArray();
            }
            GUILayout.EndHorizontal();

            if (furnitureInfo.usableColliders == null || furnitureInfo.usableColliders.Length == 0)
            {
                EditorUtils.DrawNoCollider();
                return;
            }
            for (int i = 0; i < furnitureInfo.usableColliders.Length; ++i)
            {
                ShowUtil.DrawLine();
                EditorUtils.DrawUsableColliderInfo(ref furnitureInfo.usableColliders[i]);
            }
        }
示例#5
0
 private void DrawEquipInfo()
 {
     DrawBoneWearInfo();
     ShowUtil.DrawLine();
     DrawOtherInfo();
     ShowUtil.DrawLine();
     EditorUtils.DrawApply(equip, prefab);
 }
示例#6
0
 private void DrawCharatorInfo()
 {
     ShowUtil.DrawTitle("当前角色信息", Color.cyan);
     ShowUtil.DrawLine();
     EditorGUI.indentLevel += 2;
     EditorGUILayout.LabelField("模型名:" + (prefab == null?"无": prefab.name), GUILayout.ExpandWidth(true));
     EditorGUI.indentLevel -= 2;
 }
示例#7
0
 public static void DrawPrefabInfo(GameObject prefab)
 {
     ShowUtil.DrawTitle("当前物体信息", Color.cyan);
     ShowUtil.DrawLine();
     EditorGUI.indentLevel += 2;
     EditorGUILayout.LabelField("模型名:" + (prefab == null?"无": prefab.name), GUILayout.ExpandWidth(true));
     EditorGUI.indentLevel -= 2;
 }
示例#8
0
 private void DrawItemInfo()
 {
     DrawComponentInfo();
     ShowUtil.DrawLine();
     DrawItemColliderInfo();
     ShowUtil.DrawLine();
     DrawUseableColliderInfo();
     ShowUtil.DrawLine();
     DrawObstacleInfo();
     ShowUtil.DrawLine();
     EditorUtils.DrawApply(item, prefab);
 }
示例#9
0
 private void DrawSpriteInfo()
 {
     DrawComponentInfo();
     ShowUtil.DrawLine();
     DrawMountInfo();
     ShowUtil.DrawLine();
     DrawSpriteColliderInfo();
     ShowUtil.DrawLine();
     DrawUseableColliderInfo();
     ShowUtil.DrawLine();
     DrawOtherInfo();
     ShowUtil.DrawLine();
     EditorUtils.DrawApply(charater, prefab);
 }
示例#10
0
 private void DrawFurnitureInfo()
 {
     DrawComponentInfo();
     ShowUtil.DrawLine();
     DrawFurnitureColliderInfo();
     ShowUtil.DrawLine();
     DrawUsableColliderInfo();
     ShowUtil.DrawLine();
     DrawObstacleInfo();
     ShowUtil.DrawLine();
     DrawOtherInfo();
     ShowUtil.DrawLine();
     EditorUtils.DrawApply(furniture, prefab);
 }
示例#11
0
 private void OnGUI()
 {
     scrollPosition = GUILayout.BeginScrollView(scrollPosition);
     EditorUtils.DrawNewScene(prefab, Release, SetEquip);
     ShowUtil.DrawLine();
     EditorUtils.DrawPrefabInfo(prefab);
     ShowUtil.DrawLine();
     if (null == equipInfo)
     {
         DrawNoEquipInfo();
     }
     else
     {
         DrawEquipInfo();
     }
     GUILayout.EndScrollView();
 }
示例#12
0
 private void OnGUI()
 {
     scrollPosition = GUILayout.BeginScrollView(scrollPosition);
     DrawNewScene();
     ShowUtil.DrawLine();
     DrawCharatorInfo();
     ShowUtil.DrawLine();
     if (null == spriteInfo)
     {
         DrawNoSpriteInfo();
     }
     else
     {
         DrawSpriteInfo();
     }
     GUILayout.EndScrollView();
 }
示例#13
0
 private void OnGUI()
 {
     scrollPosition = GUILayout.BeginScrollView(scrollPosition);
     DrawNewScene();
     ShowUtil.DrawLine();
     DrawPrefabInfo();
     ShowUtil.DrawLine();
     if (null == itemInfo)
     {
         DrawNoItemInfo();
     }
     else
     {
         DrawItemInfo();
     }
     GUILayout.EndScrollView();
 }
示例#14
0
 private void DrawUseableColliderInfo()
 {
     ShowUtil.DrawTitle("代表被拾取的碰撞体信息", Color.magenta);
     ShowUtil.DrawLine();
     GUILayout.BeginHorizontal();
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("重置", GUILayout.Width(120f)))
     {
         EditorUtils.SetUsableCollider(ref spriteInfo.useableCollider, charater.transform, spriteInfo, 1, false);
     }
     GUILayout.EndHorizontal();
     if (spriteInfo.useableCollider == null)
     {
         EditorUtils.DrawNoCollider();
         return;
     }
     EditorUtils.DrawUsableColliderInfo(ref spriteInfo.useableCollider);
 }