maint: enemy asset folder restructuring, animations added, animators added, created enemy spawners

This commit is contained in:
Chris
2025-10-23 20:37:35 -04:00
parent 6659b6ee7c
commit 5ce787251d
24 changed files with 1491 additions and 137 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6e73b4c62d7c3214db04bcea1fb9f856
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
using System.Collections.Generic;
using Drawing;
using Sirenix.OdinInspector;
using UnityEngine;
public class EnemySpawn : MonoBehaviour{
public float radius = 30f;
public int minimumEnemies = 1;
public int maximumEnemies = 5;
public Vector2 enemyCount;
// TODO: Replace this with an Enemy selector based on difficulty, random chance, etc?
public GameObject enemy;
public List<GameObject> enemies;
void Start(){
SpawnEnemies();
}
void SpawnEnemies(){
int count = Random.Range(minimumEnemies, maximumEnemies + 1);
for (int i = 0; i < count; i++) {
Vector3 newPosition = transform.position;
float randomX = Random.Range(-(radius / 2f), radius / 2f);
float randomZ = Random.Range(-(radius / 2f), radius / 2f);
newPosition += new Vector3(randomX, transform.position.y, randomZ);
float randomRot = Random.Range(0f, 360f);
GameObject newEnemy = Instantiate(enemy, newPosition, Quaternion.AngleAxis(randomRot, Vector3.up));
enemies.Add(newEnemy);
}
}
// Update is called once per frame
void Update()
{
Draw.WireCylinder(transform.position, transform.position + Vector3.up * 7f, radius);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dd8d1c9c0ddc5c14497e74371d4b0350