public override void OnChildUpdated(IChainableSeries <IScriptableEntry> child) { if (child == this.nestedSeries) { var currentTerminator = ChainableSeriesUtilities.GetChainTerminator(this.nestedSeries); if (currentTerminator != this.pairedNestedBlockTerminator) { this.pairedNestedBlockTerminator.AbortSelf(); if (currentTerminator.GetCanHaveChildren()) { currentTerminator.SimpleAppendChild(this.pairedNestedBlockTerminator); } } this.GetChild()?.OnParentUpdated(this.GetChildTransform()); } base.OnChildUpdated(child); }
protected override Vector3 GetChildTransform() { if (this.nestedSeries != null) { var currentPhysicalTerminator = ChainableSeriesUtilities.GetChainTerminator(this.nestedSeries); if (currentPhysicalTerminator == this.pairedNestedBlockTerminator) { currentPhysicalTerminator = currentPhysicalTerminator.GetParent(); } #pragma warning disable CS0252 // Possible unintended reference comparison; left hand side needs cast if (currentPhysicalTerminator == this || !(currentPhysicalTerminator is SeriesDragDrop)) #pragma warning restore CS0252 // Possible unintended reference comparison; left hand side needs cast { // Debug.Log($"defaulting to base child transform. Current physicalTerminator: {(currentPhysicalTerminator as MonoBehaviour)?.name}"); return(base.GetChildTransform()); } //TODO: find the size of the nested block and use that to determine the position var draggableTerminator = currentPhysicalTerminator as SeriesDragDrop; return(base.GetChildTransform() + (draggableTerminator.transform.position + -this.transform.position + -this.GetNestedOffset())); } return(base.GetChildTransform()); }