|
|
@ -1,6 +1,7 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
using System.Linq; |
|
|
|
using Unity.Netcode; |
|
|
|
using Unity.Netcode; |
|
|
|
using Unity.VisualScripting; |
|
|
|
using Unity.VisualScripting; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine; |
|
|
@ -90,5 +91,15 @@ namespace Game { |
|
|
|
Tests(); |
|
|
|
Tests(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void FixedUpdate() { |
|
|
|
|
|
|
|
foreach (var ball in Balls.Where(b => !b.IsAlive)) |
|
|
|
|
|
|
|
Destroy(ball.gameObject); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int count = Balls.RemoveAll(b => !b.IsAlive); |
|
|
|
|
|
|
|
for (int _ = 0; _ < count; _++) { |
|
|
|
|
|
|
|
Balls.Add(Instantiate(ballPrefab).GetComponent<Ball>()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|