init
This commit is contained in:
commit
16da8e4dde
333 changed files with 109229 additions and 0 deletions
29
Assets/Scripts/Spawners/BigEnemySpawner.cs
Normal file
29
Assets/Scripts/Spawners/BigEnemySpawner.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BigEnemySpawner : MonoBehaviour{
|
||||
|
||||
public string ObjectToSpawn;
|
||||
Vector2 whereToSpawn;
|
||||
GameController gameController;
|
||||
float nextSpawn;
|
||||
float spawnRate;
|
||||
|
||||
void Start(){
|
||||
gameController = FindObjectOfType<GameController>();
|
||||
spawnRate = gameController.actualBigEnemySpawnRate;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
spawnRate = gameController.actualBigEnemySpawnRate;
|
||||
if (Time.time > nextSpawn){
|
||||
nextSpawn = Time.time + spawnRate;
|
||||
float xPos = Random.Range(gameController.minSpawnPos.x, gameController.maxSpawnPos.x);
|
||||
float yPos = Random.Range(gameController.minSpawnPos.y, gameController.maxSpawnPos.y);
|
||||
whereToSpawn = new Vector2(xPos, yPos);
|
||||
ObjectPooler.Instance.SpawnFromPool(ObjectToSpawn, whereToSpawn, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Spawners/BigEnemySpawner.cs.meta
Normal file
11
Assets/Scripts/Spawners/BigEnemySpawner.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c1306f89d472367469e4d98688605196
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Scripts/Spawners/CircleEnemySpawner.cs
Normal file
29
Assets/Scripts/Spawners/CircleEnemySpawner.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CircleEnemySpawner : MonoBehaviour{
|
||||
|
||||
public string ObjectToSpawn;
|
||||
Vector2 whereToSpawn;
|
||||
GameController gameController;
|
||||
float nextSpawn;
|
||||
float spawnRate;
|
||||
|
||||
void Start(){
|
||||
gameController = FindObjectOfType<GameController>();
|
||||
spawnRate = gameController.actualCircleEnemySpawnRate;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
spawnRate = gameController.actualCircleEnemySpawnRate;
|
||||
if (Time.time > nextSpawn){
|
||||
nextSpawn = Time.time + spawnRate;
|
||||
float xPos = Random.Range(gameController.minSpawnPos.x, gameController.maxSpawnPos.x);
|
||||
float yPos = Random.Range(gameController.minSpawnPos.y, gameController.maxSpawnPos.y);
|
||||
whereToSpawn = new Vector2(xPos, yPos);
|
||||
ObjectPooler.Instance.SpawnFromPool(ObjectToSpawn, whereToSpawn, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Spawners/CircleEnemySpawner.cs.meta
Normal file
11
Assets/Scripts/Spawners/CircleEnemySpawner.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9f7ebe079a4a0d443b7521b2f23780cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Scripts/Spawners/EnemySpawner.cs
Normal file
29
Assets/Scripts/Spawners/EnemySpawner.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EnemySpawner : MonoBehaviour{
|
||||
|
||||
public string ObjectToSpawn;
|
||||
Vector2 whereToSpawn;
|
||||
GameController gameController;
|
||||
float nextSpawn;
|
||||
float spawnRate;
|
||||
|
||||
void Start(){
|
||||
gameController = FindObjectOfType<GameController>();
|
||||
spawnRate = gameController.actualStandardEnemySpawnRate;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
spawnRate = gameController.actualStandardEnemySpawnRate;
|
||||
if (Time.time > nextSpawn){
|
||||
nextSpawn = Time.time + spawnRate;
|
||||
float xPos = Random.Range(gameController.minSpawnPos.x, gameController.maxSpawnPos.x);
|
||||
float yPos = Random.Range(gameController.minSpawnPos.y, gameController.maxSpawnPos.y);
|
||||
whereToSpawn = new Vector2(xPos, yPos);
|
||||
ObjectPooler.Instance.SpawnFromPool(ObjectToSpawn, whereToSpawn, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Spawners/EnemySpawner.cs.meta
Normal file
11
Assets/Scripts/Spawners/EnemySpawner.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c416e122dbe15954da9b496d2dec516f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Scripts/Spawners/GunSpawner.cs
Normal file
29
Assets/Scripts/Spawners/GunSpawner.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GunSpawner : MonoBehaviour{
|
||||
|
||||
public string[] ObjectToSpawn;
|
||||
Vector2 whereToSpawn;
|
||||
GameController gameController;
|
||||
float nextSpawn;
|
||||
float spawnRate;
|
||||
|
||||
void Start(){
|
||||
gameController = FindObjectOfType<GameController>();
|
||||
spawnRate = gameController.actualGunSpawnRate;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
spawnRate = gameController.actualGunSpawnRate;
|
||||
if (Time.time > nextSpawn){
|
||||
nextSpawn = Time.time + spawnRate;
|
||||
float xPos = Random.Range(gameController.minSpawnPos.x, gameController.maxSpawnPos.x);
|
||||
float yPos = Random.Range(gameController.minSpawnPos.y, gameController.maxSpawnPos.y);
|
||||
whereToSpawn = new Vector2(xPos, yPos);
|
||||
ObjectPooler.Instance.SpawnFromPool(ObjectToSpawn[Mathf.RoundToInt(Random.Range(0f, 5f))], whereToSpawn, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Spawners/GunSpawner.cs.meta
Normal file
11
Assets/Scripts/Spawners/GunSpawner.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f14d11e7980db544f999f7c689e08d19
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Scripts/Spawners/RocketEnemySpawner.cs
Normal file
29
Assets/Scripts/Spawners/RocketEnemySpawner.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class RocketEnemySpawner : MonoBehaviour{
|
||||
|
||||
public string ObjectToSpawn;
|
||||
Vector2 whereToSpawn;
|
||||
GameController gameController;
|
||||
float nextSpawn;
|
||||
float spawnRate;
|
||||
|
||||
void Start(){
|
||||
gameController = FindObjectOfType<GameController>();
|
||||
spawnRate = gameController.actualRocketEnemySpawnRate;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
spawnRate = gameController.actualRocketEnemySpawnRate;
|
||||
if (Time.time > nextSpawn){
|
||||
nextSpawn = Time.time + spawnRate;
|
||||
float xPos = Random.Range(gameController.minSpawnPos.x, gameController.maxSpawnPos.x);
|
||||
float yPos = Random.Range(gameController.minSpawnPos.y, gameController.maxSpawnPos.y);
|
||||
whereToSpawn = new Vector2(xPos, yPos);
|
||||
ObjectPooler.Instance.SpawnFromPool(ObjectToSpawn, whereToSpawn, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Spawners/RocketEnemySpawner.cs.meta
Normal file
11
Assets/Scripts/Spawners/RocketEnemySpawner.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 091023997a40832468f1c12258143a0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue