то же самое

This commit is contained in:
lapich committed 2026-10-11 19:16:11 +03:00
1 parent 090cdc9933
commit ac99977be3
534 files changed
+36990 -48

No files matched your search

+14 -2
View File
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using UnityEngine.InputSystem;
public class EchoTrigger : MonoBehaviour
@@ -27,9 +27,16 @@ public class EchoTrigger : MonoBehaviour
private float[] waveIntensities = new float[MAX_WAVES]; // Память для яркости каждой волны
private bool[] waveActive = new bool[MAX_WAVES];
public static EchoTrigger Instance;
private Vector3 lastPosition;
private float distanceMoved = 0f;
void Awake()
{
if (Instance == null) Instance = this;
}
void Start()
{
if (echoMaterial != null)
@@ -103,6 +110,11 @@ public class EchoTrigger : MonoBehaviour
targetIntensity = sneakIntensity;
}
TriggerExternalWave(transform.position, targetMax, targetIntensity);
}
public void TriggerExternalWave(Vector3 position, float targetMax, float targetIntensity)
{
// Ищем свободный слот
int waveIndex = -1;
for (int i = 0; i < MAX_WAVES; i++)
@@ -135,6 +147,6 @@ public class EchoTrigger : MonoBehaviour
waveActive[waveIndex] = true;
echoMaterial.SetFloat("_EchoOpacity" + (waveIndex + 1), targetIntensity);
echoMaterial.SetVector("_EchoPosition" + (waveIndex + 1), transform.position);
echoMaterial.SetVector("_EchoPosition" + (waveIndex + 1), position);
}
}