using System.Collections; using System.Collections.Generic; using Godot; using System; namespace Rokojori { public class ScatterPoint:PointData { public bool instanced = false; protected Scatterer _creator; public Scatterer creator => _creator; protected int _creatorID; public int creatorID => _creatorID; public ScatterPoint( Scatterer creator, int id ) { this._creator = creator; this._creatorID = id; } public PackedScene scene; public bool CanBeReusedBy( ScatterPoint other ) { return parent == other.parent && scene == other.scene; } public void UpdateInstantiated( Node3D node ) { ApplyTransform( node ); } public Node3D Instantiate() { if ( ! visible || scene == null || parent == null ) { return null; } var node3D = scene.Instantiate(); parent.AddChild( node3D ); node3D.Owner = parent.Owner; ApplyTransform( node3D ); return node3D; } } }