public override void OnInspectorGUI() { //显示map中对应Area的信号量 if (marks != null && marks.Count > 0) { if (GUILayout.Button("添加")) { TreasureInfoWindow.OpenWindow(m_Target); } } if (GUILayout.Button("同步")) { //去Map层 找对应的物体同步数据 m_Target.SyncInfo(); } EditorGUI.indentLevel = 0; m_ShowTreasure = EditorGUILayout.Foldout(m_ShowTreasure, "Treasure列表"); if (m_ShowTreasure) { EditorGUI.indentLevel = 1; if (m_Target.m_TreasureCache != null && m_Target.m_TreasureCache.Count > 0) { for (int iTreasure = 0; iTreasure < m_Target.m_TreasureCache.Count; iTreasure++) { EditorGUILayout.ObjectField(m_Target.m_TreasureCache[iTreasure], typeof(Treasure), true); } } } EditorGUI.indentLevel = 0; }
public static void OpenWindow(TreasureRoot root) { sm_TreasureWin = GetWindow <TreasureInfoWindow>(); sm_TreasureWin.position = new Rect(600, 300, 400, 400); sm_TreasureWin.minSize = new Vector2(500, 500); sm_TreasureWin.Show(); sm_TreasureWin.Init(root); }