void OnTriggerEnter(Collider other)
StartCoroutine(SpawnWave());
InvokeRepeating("PerformAttack", 1f, attackInterval); opposer vr script
IEnumerator SpawnWave()
void EnableHitbox() => attackHitbox.SetActive(true); void DisableHitbox() => attackHitbox.SetActive(false); using UnityEngine; public class OpposerParry : MonoBehaviour IEnumerator SpawnWave() void EnableHitbox() =>
public float attackInterval = 2f; public GameObject attackHitbox; public Animator animator; void DisableHitbox() =>
while (true) waveNumber++; int enemyCount = Mathf.Min(3 + waveNumber, 10); for (int i = 0; i < enemyCount; i++) Transform spawn = spawnPoints[Random.Range(0, spawnPoints.Length)]; GameObject enemy = Instantiate(enemyPrefabs[Random.Range(0, enemyPrefabs.Length)], spawn.position, spawn.rotation); // Set attack speed based on wave difficulty enemy.GetComponent<OpposerEnemy>().attackInterval = Mathf.Max(0.8f, 2f - waveNumber * 0.1f); yield return new WaitForSeconds(1f); yield return new WaitForSeconds(waveInterval);