20 lines
529 B
C#
20 lines
529 B
C#
using Godot;
|
|
using Newlon.Components.Level;
|
|
using Newlon.Components.Zombies;
|
|
using System;
|
|
|
|
public partial class FallParticle : RigidBody2D
|
|
{
|
|
[Export] private RuntimeZombieData data;
|
|
[Export] private Timer deathTimer;
|
|
public void FallOff()
|
|
{
|
|
SetDeferred("freeze", false);
|
|
foreach (var floor in FallFloor.GetEverythingElse(FallFloor.GetNearest(data.GlobalPosition)))
|
|
{
|
|
AddCollisionExceptionWith(floor);
|
|
}
|
|
Callable.From(()=>{ Reparent(PoolContainer.Instance.Zombies); }).CallDeferred();
|
|
deathTimer.Start();
|
|
}
|
|
}
|