TO SQUASH: Started map covering.

This commit is contained in:
2026-08-12 00:52:57 -04:00
parent 59e6e73b20
commit 1cf68b32a1
64 changed files with 1275 additions and 488 deletions
@@ -0,0 +1,58 @@
using UnityEngine;
public class VerticalLaser : BarBase
{
public GameObject verticalLaserPrefab;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
Initialize();
}
// Update is called once per frame
void FixedUpdate()
{
if (canFire)
{
if (canFireTop)
{
Vector3 topSide = new Vector3(
bounds.center.x,
bounds.max.y + (bounds.size.y / 2.0f),
bounds.center.z
);
var top = Instantiate(verticalLaserPrefab, topSide, Quaternion.identity);
var topLaserScript = top.GetComponent<VerticalLaser>();
topLaserScript.canFireBottom = false;
Physics2D.IgnoreCollision(
top.GetComponent<Collider2D>(),
GetComponent<Collider2D>(),
true
);
}
if (canFireBottom)
{
Vector3 bottomSide = new Vector3(
bounds.center.x,
bounds.min.y - (bounds.size.y / 2.0f),
bounds.center.z
);
var bottom = Instantiate(verticalLaserPrefab, bottomSide, Quaternion.identity);
var bottomLaserScript = bottom.GetComponent<VerticalLaser>();
bottomLaserScript.canFireTop = false;
Physics2D.IgnoreCollision(
bottom.GetComponent<Collider2D>(),
GetComponent<Collider2D>(),
true
);
}
canFire = false;
}
}
}