1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using UnityEngine;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- #if UNITY_EDITOR
- using UnityEditor;
- #endif
- namespace TerrainComposer2
- {
- static public class TC_SelectItemGroupGUI
- {
- static public int Draw(TC_SelectItemGroup selectItemGroup, ref Vector2 pos, Color color, Color colSelectItem, Color colBracket, float activeMulti)
- {
- bool nodeFoldout = selectItemGroup.parentItem.nodeFoldout;
-
-
-
-
-
-
-
-
- TD.DrawBracket(ref pos, nodeFoldout, true, colBracket * activeMulti, ref selectItemGroup.foldout, true, selectItemGroup.itemList.Count > 0);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (selectItemGroup.foldout > 0)
- {
- if (selectItemGroup.itemList.Count > 1)
- {
- bool isCulled = false;
- pos.x -= TD.texCardBody.width;
- TD.DrawNode(selectItemGroup, pos, color, Color.white, ref isCulled, activeMulti, nodeFoldout, false, false);
- }
- if (selectItemGroup.foldout == 2)
- {
- TC_SelectItem selectItem;
- for (int i = selectItemGroup.itemList.Count - 1; i >= 0; --i)
- {
- selectItem = selectItemGroup.itemList[i];
-
-
-
-
-
- if (selectItem != null)
- {
- pos.x -= TD.nodeWidthHSpace;
- TC_SelectItemGUI.Draw(selectItemGroup, activeMulti, i, nodeFoldout, ref pos, colSelectItem);
- }
- }
- }
- }
- if (nodeFoldout)
- {
- int mouseClick = TD.DrawNodeCount(selectItemGroup, ref pos, selectItemGroup.itemList.Count, nodeFoldout, ref selectItemGroup.foldout, (selectItemGroup.foldout == 0 ? colBracket : (color * 0.75f)) * activeMulti);
- if (mouseClick == 0 && selectItemGroup.itemList.Count == 0) selectItemGroup.Add<TC_SelectItem>("", false, false, true);
- }
- TD.DrawBracket(ref pos, nodeFoldout, false, colBracket * activeMulti, ref selectItemGroup.foldout, true, selectItemGroup.itemList.Count > 0);
- return 0;
- }
- }
- }
|