босс
This commit is contained in:
1 parent
76b6566e46
commit
11d290d572
49 files changed
+2562
-587
No files matched your search
@@ -50,6 +50,24 @@ public class EchoTrigger : MonoBehaviour
|
||||
[Header("Реакция мутантов")]
|
||||
public bool alertMutants = true;
|
||||
|
||||
[Header("Акустическое ослепление (Босс)")]
|
||||
private float blindnessTimer = 0f;
|
||||
public bool IsBlinded => blindnessTimer > 0f;
|
||||
|
||||
/// <summary>
|
||||
/// Полностью глушит эхолокацию: шум шагов, выстрелы и броски не создают волн
|
||||
/// </summary>
|
||||
public void ApplyBlindness(float duration)
|
||||
{
|
||||
blindnessTimer = Mathf.Max(blindnessTimer, duration);
|
||||
for (int i = 0; i < MAX_WAVES; i++)
|
||||
{
|
||||
waveActive[i] = false;
|
||||
SetFloatOnAllEchoMaterials("_EchoRadius" + (i + 1), 0f);
|
||||
SetFloatOnAllEchoMaterials("_EchoOpacity" + (i + 1), 0f);
|
||||
}
|
||||
}
|
||||
|
||||
// Пул из 3 одновременных волн
|
||||
private const int MAX_WAVES = 3;
|
||||
private float[] waveRadii = new float[MAX_WAVES];
|
||||
@@ -219,6 +237,15 @@ public class EchoTrigger : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (blindnessTimer > 0f)
|
||||
{
|
||||
blindnessTimer -= Time.deltaTime;
|
||||
for (int i = 0; i < MAX_WAVES; i++)
|
||||
{
|
||||
SetFloatOnAllEchoMaterials("_EchoOpacity" + (i + 1), 0f);
|
||||
}
|
||||
}
|
||||
|
||||
HandleStepDetection();
|
||||
HandleManualEchoPulse();
|
||||
UpdateWaveShaderProgress();
|
||||
@@ -226,6 +253,8 @@ public class EchoTrigger : MonoBehaviour
|
||||
|
||||
void HandleManualEchoPulse()
|
||||
{
|
||||
if (IsBlinded) return;
|
||||
|
||||
// Возможность выпустить эхолокационный импульс (Space, Q или ПКМ)
|
||||
var keyboard = Keyboard.current;
|
||||
var mouse = Mouse.current;
|
||||
@@ -443,6 +472,8 @@ public class EchoTrigger : MonoBehaviour
|
||||
|
||||
public void TriggerExternalWave(Vector3 position, float targetMax, float targetIntensity)
|
||||
{
|
||||
if (IsBlinded) return;
|
||||
|
||||
if (allEchoMaterials.Count == 0)
|
||||
{
|
||||
CollectAllEchoMaterials();
|
||||
|
||||
Reference in new issue
Block a user