This commit is contained in:
SoulliesOfficial
2026-01-03 18:19:39 -05:00
parent 3bcd7c1cf8
commit 33b1795c1f
7387 changed files with 2762819 additions and 716926 deletions

View File

@@ -0,0 +1,42 @@
using UnityEngine;
using UnityEngine.InputSystem;
namespace INab.WorldScanFX
{
[RequireComponent(typeof(ScanFXBase))]
public class ScanControl : MonoBehaviour
{
// Reference to the ScanFXBase component
public ScanFXBase scanFX;
private void OnEnable()
{
scanFX = GetComponent<ScanFXBase>();
}
// Update is called once per frame
void Update()
{
// Start a new scan when the N key is pressed
if (Keyboard.current.nKey.wasPressedThisFrame)
{
// Ensure scanFX reference is not null
if (scanFX != null)
{
// Check if there are any scans left
if (scanFX.ScansLeft > 0)
{
// Warn the user if scans are still active
Debug.LogWarning("There are " + scanFX.ScansLeft + " scans left. You need to wait for the last scan to end until you can start a new one.");
}
else
{
// Pass scan origin properties and start a new scan
scanFX.PassScanOriginProperties();
scanFX.StartScan(1);
}
}
}
}
}
}