public void Initi(int sortIndex, SplitLevel splitLevel, ColorLevel colorLevel) { DetroyBubbles(); if (IsSpawn(splitLevel)) { _bubbleObjects = new List <GameObject>(); int count = Random.Range(3, 6); for (int i = 0; i < count; i++) { SpawnBubble(sortIndex, colorLevel); } } }
protected override void RunAway() { var move = transform.GetComponent <VirusMove>(); for (int i = 0; i < 3; i++) { int level = (int)(SplitLevel - 1); SplitLevel splitLevel = level < 0 ? SplitLevel.Level1 : (SplitLevel)level; float angle = Random.Range(i * 120, (i + 1) * 120); VirusData data = new VirusData(); data.VirusColorLevel = VirusTool.GetColorLevel(CurColorLevel); data.SplitLevel = splitLevel; data.MoveSpeed = move.OriginSpeed; data.MoveDirection = Quaternion.Euler(0, 0, angle) * Vector3.right; int t = VirusGameDataAdapter.GetLevel(); data.HealthValue = VirusTool.GetVirusHealthByColorLevel("DartVirus", t, data.VirusColorLevel); VirusMrg.Instance.SpawnVirus("DartVirus", data, transform.position, true); } }
private bool IsSpawn(SplitLevel splitLevel) { switch (splitLevel) { case SplitLevel.Level1: return(Random.Range(0, 100f) > 80f); case SplitLevel.Level2: return(Random.Range(0, 100f) > 20f); case SplitLevel.Level3: return(Random.Range(0, 100f) > 15f); case SplitLevel.Level4: return(Random.Range(0, 100f) > 10f); case SplitLevel.Level5: return(Random.Range(0, 100f) > 5f); } return(false); }
public static float GetScaleByLevel(SplitLevel splitLevel) { switch (splitLevel) { case SplitLevel.Level1: return(0.5f); case SplitLevel.Level2: return(0.7f); case SplitLevel.Level3: return(0.85f); case SplitLevel.Level4: return(1.1f); case SplitLevel.Level5: return(2f); } return(1); }
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; } } }
public static int GetSplit(SplitLevel splitLevel, VirusName virusName) { switch (splitLevel) { case SplitLevel.Level1: return(0); case SplitLevel.Level2: if (virusName == VirusName.ThreePointsVirus) { return(3); } return(2); case SplitLevel.Level3: if (virusName == VirusName.ThreePointsVirus) { return(3 + 9); } return(2 + 4); case SplitLevel.Level4: if (virusName == VirusName.ThreePointsVirus) { return(3 + 9 + 27); } return(2 + 4 + 8); case SplitLevel.Level5: if (virusName == VirusName.ThreePointsVirus) { return(3 + 9 + 27 + 81); } return(2 + 4 + 8 + 16); } return(0); }