public void CallUpdate() { if (outputSocket.IsConnected()) { for (int i = 0; i < outputSocket.ConnectedCount; i++) { Node node = (Node)outputSocket.GetConnectedSocket(i).Parent; node.Update(); } } }
public List <int> GetConditionID() { List <int> input = new List <int>(); if (outSocket.IsConnected()) { // 遍尋所有連接的狀態條件 for (int i = 0; i < outSocket.ConnectedCount; i++) { // 狀態條件 AbstracStateConditionNode node = (AbstracStateConditionNode)outSocket.GetConnectedSocket(i).Parent; // 該狀態條件有下一個狀態 if (node.outSocket.IsConnected()) { input.Add(node.Id); } } } return(input); }
/// <summary>Unlinkes the assigned sockets. Triggeres 'Unlink' events.</summary> public void UnLink(InputSocket inputSocket, OutputSocket outputSocket) { _needsUpdate = true; if (inputSocket == null || outputSocket == null || !inputSocket.IsConnected() || !outputSocket.IsConnected()) { return; } if (!AreConected(inputSocket, outputSocket)) { return; } if (TriggerEvents) { EventManager.TriggerOnUnLinkSockets(this, inputSocket, outputSocket); } var index = outputSocket.Edges.IndexOf(inputSocket.Edge); if (index > -1) { outputSocket.Edges[index].Input = null; outputSocket.Edges[index].Output = null; outputSocket.Edges.RemoveAt(index); } inputSocket.Edge.Input = null; inputSocket.Edge.Output = null; inputSocket.Edge = null; if (TriggerEvents) { EventManager.TriggerOnUnLinkedSockets(this, inputSocket, outputSocket); } }