public void OnEvent(UIVirusTipEvent eventType) { if (WaveVirusDataAdapter.IsShowBoss()) { ShowBigVirus(); } else { ShowManyVirus(); } }
public void GameStart() { _minOrderIndex = 0; _maxOrderIndex = 5000; _percent.Value = 1; _curCount = 0; _isTiped = false; _virusObjects = new List <GameObject>(); _originCount = WaveVirusDataAdapter.Load(VirusGameDataAdapter.GetLevel()); StartCoroutine(Spawn()); }
private IEnumerator Spawn() { List <WaveVirusItem> items = WaveVirusDataAdapter.GetWaveVirus(); int count = items.Count; int cc = 0; _isSpawned = false; while (true) { yield return(new WaitForSeconds(Random.Range(0.3f, 0.8f))); VirusData data = new VirusData(); Vector3 dir = Quaternion.Euler(0, 0, Random.Range(-20f, 20f)) * Vector3.down; SplitLevel splitLevel = items[cc].SplitLevel; string virusName = items[cc].VirusName.ToString(); int level = VirusGameDataAdapter.GetLevel(); data.VirusColorLevel = items[cc].ColorLevel; data.HealthValue = VirusTool.GetVirusHealthByColorLevel(virusName, level, data.VirusColorLevel); data.MoveSpeed = 3; data.MoveDirection = dir; data.SplitLevel = splitLevel; SpawnVirus(virusName, data); cc++; if (cc >= count) { _isSpawned = true; WaveVirusDataAdapter.WaveIndex++; if (WaveVirusDataAdapter.WaveIndex >= WaveVirusDataAdapter.MaxWave) { WaveVirusDataAdapter.IsNextWave = false; } yield break; } } }