Example #1
0
        private void DropInNestedSeries(IChainableSeries <IScriptableEntry> newNested)
        {
            Debug.Log($"adding {(newNested as MonoBehaviour)?.name} as nested under {this.name}");
            if (newNested == null || !newNested.GetCanHaveParents())
            {
                throw new Exception("ERROR: invalid nesting. see logs");
            }

            var originalNested = this.nestedSeries;

            this.nestedSeries = newNested;
            newNested.SetParent(this);

            ChainableSeriesUtilities.UpdateOriginalChildAfterSplice(originalNested, newNested);

            this.nestedSeries?.OnParentUpdated(this.GetNestedChildTransform());
            this.OnChildUpdated(this.nestedSeries);
            //var currentTerminator = ChainableSeriesUtilities.GetChainTerminator(this.nestedSeries);
            //if (currentTerminator.GetCanHaveChildren())
            //{
            //    this.pairedNestedBlockTerminator.GetParent()?.AbortChild(this.pairedNestedBlockTerminator);
            //    this.pairedNestedBlockTerminator.SetParent(null);
            //    currentTerminator.SpliceChildIn(this.pairedNestedBlockTerminator);
            //}

            //(newNested as SeriesDragDrop).UpdatePositionRelativeToParent(this.GetNestedChildTransform());
        }