protected override void Init() { this.NodeStart = UtilGameObject.FindInParent("NodeStart", this.gameObject) .AddComponent <TrafficAIEditNode>(); this.NodeStart.gameObject.AddComponent <TrafficAIEditNodeLink>(); this.NodeEnd = UtilGameObject.FindInParent("NodeEnd", this.gameObject) .AddComponent <TrafficAIEditNode>(); this.NodeEnd.gameObject.AddComponent <TrafficAIEditNodeLink>(); }
public void DeleteNext(TrafficAIEditNode node) { for (int i = 0, max = this.nextList.Length; i < max; i++) { var next = this.nextList[i]; if (next != node) { continue; } this.nextList[i] = null; // Delete edge TrafficAIModel.Instance.RemoveEdge(this.Data, node.Data); break; } this.RefreshNexts(); }
public void AddNext(TrafficAIEditNode node) { if (node == null) { Debug.LogError("TrafficAIEditNode::AddNext error node is null"); return; } for (int i = 1, max = this.nextList.Length; i < max; i++) { var next = this.nextList[i]; if (next != null) { continue; } this.nextList[i] = node; break; } this.RefreshNexts(); // Add edge TrafficAIModel.Instance.AddEdge(this.Data, node.Data); }