private List <DescriptionEnemies> GetListEnemies(int numberEnemies) { List <DescriptionEnemies> lstEnemies = new List <DescriptionEnemies>(); float scaleValue = -0.0928333f * numberEnemies + 1.2785f; for (int x = 0; x < numberEnemies; x++) { DescriptionEnemies enemy = new DescriptionEnemies(); enemy.Type = TypeEnemy.Basic; enemy.Scale = new float[] { scaleValue, scaleValue, scaleValue }; if (UnityEngine.Random.value > 0.4f) { enemy.Position = new float[] { UnityEngine.Mathf.Clamp(x * 15, 1, 40), UnityEngine.Mathf.Clamp(x * 15, 1, 40), 0 } } ; else { enemy.Position = new float[] { UnityEngine.Mathf.Clamp(x * 15, 60, 100), UnityEngine.Mathf.Clamp(x * 15, 60, 100), 0 } }; enemy.MagnitudVelocity = -Convert.ToInt16(inputEnemiesVelocity.text); lstEnemies.Add(enemy); } return(lstEnemies); } }
public void Drop(DescriptionEnemies descriptionEnemy) { float[] scale = descriptionEnemy.Scale; Vector3 spawnPosition = SpawningPosition(descriptionEnemy.Position); GameObject enemy = pullEnemies.GetObject(spawnPosition, Quaternion.identity); if (enemy != null) { enemy.GetComponent <MoveEnemy>().PowerForce = descriptionEnemy.MagnitudVelocity; enemy.transform.localScale = new Vector3(scale[0], scale[1], scale[2]); enemy.SetActive(true); } }
private List <DescriptionEnemies> GetListEnemies(int level) { List <DescriptionEnemies> lstEnemies = new List <DescriptionEnemies>(); int numberEnemies = Convert.ToInt16(inputEnemies.text); float scaleValue = Convert.ToInt16(inputScaleEnemies.text); for (int x = 0; x <= numberEnemies; x++) { DescriptionEnemies enemy = new DescriptionEnemies(); enemy.Type = TypeEnemy.Basic; enemy.Scale = new float[] { scaleValue, scaleValue, scaleValue }; enemy.Position = new float[] { UnityEngine.Mathf.Clamp(x * 15, 1, 100), UnityEngine.Mathf.Clamp(x * 15, 1, 100), 0 }; enemy.MagnitudVelocity = UnityEngine.Random.Range(-18, -28); lstEnemies.Add(enemy); } return(lstEnemies); }
private List <DescriptionEnemies> GetListEnemies(int level) { List <DescriptionEnemies> lstEnemies = new List <DescriptionEnemies> (); int numberEnemies = 2 + UnityEngine.Mathf.RoundToInt(coefficientOfVariationForEnemies * level); float scaleValue = coefficientScaleEnemyM * numberEnemies + coefficientScaleEnemyB; for (int x = 0; x < numberEnemies; x++) { DescriptionEnemies enemy = new DescriptionEnemies(); enemy.Type = TypeEnemy.Basic; enemy.Scale = new float[] { scaleValue, scaleValue, scaleValue }; enemy.Position = new float[] { UnityEngine.Mathf.Clamp(x * 15, 1, 100), UnityEngine.Mathf.Clamp(x * 15, 1, 100), 0 }; enemy.MagnitudVelocity = UnityEngine.Random.Range(-18, -28); lstEnemies.Add(enemy); } return(lstEnemies); }