//Constructor public EditorObjectConnection(EditorObject.EditorObjectMessage message, EditorObject caller, EditorObject subject, EventTransceiver.Events onEvent) { OnEvent = onEvent; Message = message; Caller = caller; Subject = subject; GUID = System.Guid.NewGuid().ToString(); SetColor(); }
public void AddConnection(EditorObject subject, EditorObject caller, EditorObject.EditorObjectMessage message, EventTransceiver.Events onEvent) { if (ContainsConnection(subject, caller) == null) { EditorObjectConnection newConnection = EditorObjectConnection.CreateInstance <EditorObjectConnection>(); newConnection.Message = message; newConnection.Caller = caller; newConnection.Subject = subject; newConnection.OnEvent = onEvent; Registry.Add(newConnection); Registry.Sort(_comparer); } else { Debug.LogWarning(string.Format("Attempted to add a connection between {0} and {1}, but a connection already exists", subject.ToString(), caller.ToString()), this); } }