예제 #1
0
 public virtual void DisconnectFrom(Input input)
 {
     input.SetIncommingDataType(null);
     if (!destinations.Remove(input))
     {
         Debug.LogError("Trying to disconnect an input that was never connected in " + GetType());
     }
     input.host.PartialSetup();
     if (onDisconnect != null)
     {
         onDisconnect(input);
     }
 }
예제 #2
0
 /// <summary>
 /// connect to input without sending a partial setup
 /// </summary>
 /// <param name="input">input to connect to</param>
 /// <returns></returns>
 public virtual bool ConnectToDiscreet(Input input)
 {
     // if (GetDataType() == null)//if i don't know what i'am returning dont create link
     //      return false;
     // if (!ContainsType(input.GetAllowedDataTypes(), GetDataType()))//if i am not the right data type don't allow connection
     //     return false;
     destinations.Add(input);
     input.SetIncommingDataType(GetDataType());
     //input.host.PartialSetup();
     input.outputConnectedTo = this;
     //  if (onConnect != null)
     //    onConnect(input);
     return(true);
 }
예제 #3
0
        internal abstract object GetData();//give back the data you stored to pass to the inputs of other node (stored inside destinations)

        //called by the hosting node at the end of his process

        public virtual bool ConnectTo(Input input) //this is for the UI part
        {
            if (GetDataType() == null)             //if i don't know what i'am returning dont create link
            {
                return(false);
            }
            if (!ContainsType(input.GetAllowedDataTypes(), GetDataType()))//if i am not the right data type don't allow connection
            {
                return(false);
            }
            destinations.Add(input);
            input.SetIncommingDataType(GetDataType());
            input.host.PartialSetup();
            input.outputConnectedTo = this;
            if (onConnect != null)
            {
                onConnect(input);
            }
            return(true);
        }