using System.Collections; using System.Collections.Generic; using Godot; using System; namespace Rokojori { [Tool] [GlobalClass] public partial class ScatterList:Scatterer { [Export] public bool childrenNeedToBeVisible = true; [Export] public bool childrenNeedToBeProcessing = false; [Export] public bool clearChildContainers = false; public override void _Process( double delta ) { if ( clearContainers ) { clearContainers = false; ClearContainers(); } if ( clearChildContainers ) { clearChildContainers = false; Nodes.ForEachDirectChild( this, s => s.ClearContainers() ); } if ( ! ( update || updateAlways ) ) { return; } update = false; ScatterAndInstantiatePoints(); } protected override List _Scatter( List points ) { var output = points; Nodes.ForEachDirectChild( this, ( s )=> { if ( ! IsChildEnabled( s ) ) { return; } output = s.Scatter( output ); } ); return output; } bool IsChildEnabled( Scatterer s ) { return IsChildEnabled( s, childrenNeedToBeVisible, childrenNeedToBeProcessing ); } } }