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 UnityEngine; | |
using System.Collections; | |
public class SmoothCamFollow : MonoBehaviour { | |
public GameObject target; | |
public float smooth; | |
public Vector3 position; | |
public Quaternion rotation; |
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 UnityEngine; | |
using System.Collections; | |
public class WaveSpawner : MonoBehaviour { | |
public enum SpawnState { SPAWNING, WAITING, COUNTING }; | |
[System.Serializable] | |
public class Wave { | |
public string name;//name of the wave |
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 UnityEngine; | |
using System.Collections; | |
public class EnemyHealth : MonoBehaviour { | |
public float hitPoints = 100f;//max health | |
public float currentHitPoints;//current health | |
public GameObject destroyFX;//not sure why you use GameObject rather than Transform... | |
public GameObject healthbar; |
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 UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class EnemyHealth : MonoBehaviour { | |
public float hitPoints = 100f;//max health | |
public float currentHitPoints;//current health | |
public GameObject destroyFX;//not sure why you use GameObject rather than Transform... | |
//public GameObject healthbar; |
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 UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class EnemyHealth : MonoBehaviour { | |
public float hitPoints = 100f;//max health | |
public float currentHitPoints;//current health | |
public GameObject destroyFX; | |
public Image healthbar; |
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 UnityEngine; | |
using System.Collections; | |
public class EasyAI : MonoBehaviour { | |
public float fpsTargetDistance; //how far away the player is from the enemy | |
public float enemyLookDistance; //how close the player needs to be for the enemy to look at the player | |
public float attackDistance; //how close the player needs to be for the enemy to attack the player | |
public float enemyMovementSpeed; //how fast the enemy moves | |
public float turning; |
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 UnityEngine; | |
using System.Collections; | |
public class PlayerShooting : MonoBehaviour { | |
public GameObject shot; | |
public Transform showSpawn; | |
public float fireRate; | |
public float cooldown; |
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 UnityEngine; | |
using System.Collections; | |
public class LaserProjectile : MonoBehaviour { | |
public float speed = 2f; //speed at which the projectile travels in world space | |
public int damage = 25; //damage dealt to other objects this projectile hits | |
private Transform thisTransform; //cached transform for this projectile | |
public Transform lasterHitFXPrefab; | |
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 UnityEngine; | |
using System.Collections; | |
public class PlayerShooting : MonoBehaviour { | |
public float fireRate; | |
public float cooldown;//wait amout of time before we can shoot again | |
//check to see if we're actually firing | |
public bool isFiring = false; | |
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
// https://www.youtube.com/watch?v=UTLApMrHr5I | |
// https://www.youtube.com/watch?v=188SMf9f6UY <- this one is better? | |
using UnityEngine; | |
using System.Collections; | |
public class EasyAI : MonoBehaviour { | |
public float fpsTargetDistance;//how far away the player is from the enemy | |
public float enemyMovementSpeed;//how fast the enemy moves |
OlderNewer