public override void OnInspectorGUI() { //显示map中对应Area的信号量 if (marks != null && marks.Count > 0) { if (GUILayout.Button("添加")) { MineralInfoWindow.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_MineralCache != null && m_Target.m_MineralCache.Count > 0) { for (int iMineral = 0; iMineral < m_Target.m_MineralCache.Count; iMineral++) { EditorGUILayout.ObjectField(m_Target.m_MineralCache[iMineral], typeof(Treasure), true); } } } EditorGUI.indentLevel = 0; }
public static void OpenWindow(MineralRoot root) { sm_TreasureWin = GetWindow <MineralInfoWindow>(); sm_TreasureWin.position = new Rect(600, 300, 400, 400); sm_TreasureWin.minSize = new Vector2(500, 500); sm_TreasureWin.Show(); sm_TreasureWin.Init(root); }