newlon/scripts/components/plants/PlantEyesightLimiter.cs

13 lines
No EOL
290 B
C#

using Godot;
using System;
public partial class PlantEyesightLimiter : CollisionShape2D
{
public override void _Ready()
{
if (Shape is SegmentShape2D segment)
{
segment.B = new Vector2(Utility.RightFieldBoundary.X-GlobalPosition.X, 0);
}
}
}