Пример #1
0
        public CPinNameChangeAction(CPin pin, string newName)
        {
            ActionType = ENodeAction.PinNameChange;

            Pin     = pin;
            NewName = newName;
        }
Пример #2
0
 public CAddPinChangeAction(CPin pin, int index, bool bIsIn)
 {
     ActionType = ENodeAction.AddPinChange;
     Pin        = pin;
     Index      = index;
     IsIn       = bIsIn;
 }
Пример #3
0
        public CPinTypeChangeAction(CPin pin, Type newType)
        {
            ActionType = ENodeAction.PinTypeChange;

            Pin     = pin;
            NewType = newType;
        }
Пример #4
0
 /// <summary>
 /// Changes the type of a pin. Should only be called upon editor callback.
 /// </summary>
 /// <param name="context">Context which contains all editor node actions that need to be executed after this call</param>
 /// <param name="pin"></param>
 /// <param name="newType"></param>
 protected void ChangePinType(CNodeChangeContext context, CPin pin, Type newType)
 {
     if (pin is CInputPin inputPin)
     {
         inputPin.Type = newType;
         context.Actions.Add(new CPinTypeChangeAction(pin, newType));
     }
     else if (pin is COutputPin outputPin)
     {
         outputPin.Type = newType;
         context.Actions.Add(new CPinTypeChangeAction(pin, newType));
     }
 }
Пример #5
0
 /// <summary>
 /// Changes the name of a pin. Should only be called upon editor callback.
 /// </summary>
 /// <param name="context">Context which contains all editor node actions that need to be executed after this call</param>
 /// <param name="pin">The pin whose name should be changed</param>
 /// <param name="newName">The new name of the pin</param>
 protected void ChangePinName(CNodeChangeContext context, CPin pin, string newName)
 {
     pin.Name = newName;
     context.Actions.Add(new CPinNameChangeAction(pin, newName));
 }