This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Enemy : MonoBehaviour | |
{ | |
[SerializeField] private int pointsValue = 10; //How many points the enemy is worth | |
private ScoreManager scoreManager; //A local ScoreManager variable so you can access it later | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SpawnManager : MonoBehaviour | |
{ | |
[SerializeField] private GameObject enemyPrefab; //Holds our enemy to be spawned | |
[SerializeField] private int totalEnemiesToSpawn; //How many we'll spawn | |
private int currentAmountSpawned; //How many have spawned | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Start() | |
{ | |
//This starts the coroutine and lets Unity know this is a coroutine | |
StartCoroutine(SpawnEnemies()); | |
} | |
//IEnumerator is used to denote this a coroutine | |
private IEnumerator SpawnEnemies() | |
{ | |
//This will spawn the enemy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SpawnManager : MonoBehaviour | |
{ | |
[SerializeField] private GameObject enemyPrefab; | |
[SerializeField] private int totalEnemiesToSpawn; | |
private int currentAmountSpawned; | |
private GameObject enemyContaner; //Holds your shiny new enemy objects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using System.Numerics; | |
using Ludiq.PeekCore; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using Vector3 = UnityEngine.Vector3; | |
public class Parallax : MonoBehaviour | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public enum PowerUpType { SpeedBoost, Firepower, Invisibility } | |
public class PowerUp : MonoBehaviour | |
{ | |
[SerializeField] private PowerUpType powerUpType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScoreManager : MonoBehaviour | |
{ | |
[SerializeField] private Text scoreText; //Holds the Text object responsible for our score | |
[SerializeField] private int score; //Tracks how many points we've accumulated so far | |
// Start is called before the first frame update | |
void Start() | |
{ | |
//Sets the score to zero | |
scoreText.text = "Score: " + score; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
using UnityEngine.UI; | |
public class UIManager : MonoBehaviour | |
{ | |
[SerializeField] private GameObject gameOverPanel; | |
[SerializeField] private Text restartText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
public class LevelManager : MonoBehaviour | |
{ | |
public static LevelManager Instance; | |
void Awake() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
public class EnemyExplosion : MonoBehaviour | |
{ | |
[SerializeField] private GameObject explosionPrefab; //Explosion animation prefab | |
// Start is called before the first frame update |