Beispiel #1
0
            public ObjectListItemWrapper(EditorObject obj, bool useObjectName)
            {
                mEditorObject = obj;

                if (mEditorObject == null)
                {
                    Text = "NULL OBJECT ERROR!!";
                    return;
                }

                string displayValue;

                if (useObjectName == true)
                {
                    Text = obj.Name;
                }
                else
                {
                    Text = mEditorObject.ToString();
                }
            }
    public void RemoveConnection(EditorObject subject, EditorObject caller)
    {
        EditorObjectConnection connectionToRemove = ContainsConnection(subject, caller);

        if (connectionToRemove != null)
        {
            Registry.Remove(connectionToRemove);
        }
        else
        {
            Debug.LogWarning(string.Format("Attempted to remove a connection between {0} and {1}, but a connection does not exist", subject.ToString(), caller.ToString()), this);
        }
    }
    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);
        }
    }