mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:35:34 +00:00
Automatic resizing shadows
This commit is contained in:
parent
34ea128693
commit
e416b3d8cd
4 changed files with 896 additions and 819 deletions
|
|
@ -47,6 +47,8 @@ public partial class Bullet3D : Area3D, IBullet
|
|||
|
||||
private Sprite3D _sprite;
|
||||
|
||||
private Decal _shadow;
|
||||
|
||||
private readonly Vector3 _defaultRotation = new(
|
||||
Mathf.DegToRad(-45f),
|
||||
Mathf.DegToRad(45f),
|
||||
|
|
@ -79,6 +81,8 @@ public partial class Bullet3D : Area3D, IBullet
|
|||
_collisionShape = GetNode<CollisionShape3D>("CollisionShape");
|
||||
|
||||
_sprite = GetNodeOrNull<Sprite3D>("Sprite");
|
||||
|
||||
_shadow = GetNodeOrNull<Decal>("Shadow");
|
||||
}
|
||||
|
||||
public void Initialize(BulletInfo bulletInfo)
|
||||
|
|
@ -105,6 +109,12 @@ public partial class Bullet3D : Area3D, IBullet
|
|||
IsGrazed = false;
|
||||
IsFrozen = false;
|
||||
|
||||
if (_shadow is not null)
|
||||
{
|
||||
var shadowSize = _bulletInfo.OriginalBulletResource.BulletSize * 3;
|
||||
_shadow.Size = new Vector3(shadowSize, _shadow.Size.Y, shadowSize);
|
||||
}
|
||||
|
||||
// Need to clone them here
|
||||
// _modifiers = _bulletInfo.TimeModifiers.Select(x => x.MakeClone()).ToList();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue