public CPinNameChangeAction(CPin pin, string newName) { ActionType = ENodeAction.PinNameChange; Pin = pin; NewName = newName; }
public CAddPinChangeAction(CPin pin, int index, bool bIsIn) { ActionType = ENodeAction.AddPinChange; Pin = pin; Index = index; IsIn = bIsIn; }
public CPinTypeChangeAction(CPin pin, Type newType) { ActionType = ENodeAction.PinTypeChange; Pin = pin; NewType = newType; }
/// <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)); } }
/// <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)); }