public override void DrawGUI() { #if UNITY_EDITOR int id = UnityEditor.EditorGUILayout.IntField("Id", Id); if (id != Id) { this.Id = id; this.SetName(); } this.Type = (ELvlPathType)UnityEditor.EditorGUILayout.EnumPopup("Type", Type); GUI.color = Color.green; GUILayout.Space(10); if (GUILayout.Button("Add Node", GUILayout.Height(30))) { LvlPathNode node = new LvlPathNode(); PathNodes.Add(node); } GUI.color = Color.white; GUILayout.Space(5); for (int i = PathNodes.Count - 1; i >= 0; i--) { GUILayout.Space(5); UnityEditor.EditorGUILayout.LabelField("路径点" + i, BVT.BTStyle.STYLE_CENTERLABEL, GUILayout.Height(30)); PathNodes[i].Pos = UnityEditor.EditorGUILayout.Vector3Field("Pos", PathNodes[i].Pos); PathNodes[i].Euler = UnityEditor.EditorGUILayout.Vector3Field("Euler", PathNodes[i].Euler); GUI.color = Color.red; if (GUILayout.Button("X", GUILayout.Width(40))) { PathNodes.RemoveAt(i); } GUI.color = Color.white; } #endif }
public override void Import(DCFG cfg) { LvlPath data = cfg as LvlPath; this.Id = data.Id; this.Type = data.Type; this.PathNodes = data.PathNodes; }
public override void Read(XmlElement os) { this.Id = os.GetInt32("Id"); this.Type = (ELvlPathType)os.GetInt32("Type"); this.PathNodes = ReadListFromChildAttribute <LvlPathNode>(os, "PathNodes"); }