/// <summary> /// Removes all nodes from the patch field and prepares to be collected /// </summary> public void RemovePatch() { Master.ReferenceRect.RemoveChild(SfcPatchNode); SfcPatchNode.QueueFree(); SfcPatchNode = null; Data = null; Master = null; }
/// <summary> /// Constructor. It will add the patch to the 2d editor. /// </summary> public SfcPatchControl(PatchEntity data, Sfc2dEditorControl control, bool isEditable) { Data = data; Master = control; SfcPatchMeta = new SfcPatchMeta(); Node node = ((PackedScene)GD.Load(_patchReferencePath)).Instance(); SfcPatchNode = (SfcPatchNode)node; SfcPatchNode.InitializeWith(this, data, isEditable); control.ReferenceRect.AddChild(SfcPatchNode); }
/// <summary> /// Updates the visible nodes according to the data model. /// </summary> public void UpdatePatchNodes() { SfcPatchMeta.UpdatePatch(this); SfcPatchNode.UpdateNodes(Data); }