private void SpawnEnemy(Vector3 spawnPosition) { GameObject enemySpawned = Instantiate(enemyPrefab, spawnPosition, Quaternion.identity); EnemyController newEnemy = enemySpawned.GetComponent <EnemyController>(); newEnemy.DisactiveEnemy(); enemiesSpawned.Add(newEnemy); newEnemy.ActiveEnemy(); RoundsManager.Instance.PlusEnemies(); }
public void LumberAttack() { GameObject tempPlayer = CharacterController.ActivePlayer(), tempEnemy = EnemyController.ActiveEnemy(); Debug.Log(tempPlayer.name + "has attacked " + tempEnemy.name); if (Random.value < tempPlayer.GetComponent <LuberMan> ().CritRate) { tempEnemy.GetComponent <EnemyController> ().Health -= tempPlayer.GetComponent <LuberMan> ().Damage * 2; } else { tempEnemy.GetComponent <EnemyController> ().Health -= tempPlayer.GetComponent <LuberMan> ().Damage; } tempPlayer.GetComponent <LuberMan> ().formatPlayer(); }