//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();
 }
 //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();
 }
示例#3
0
    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);
        }
    }