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.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 { | |
class Program { | |
static void Main(string[] args) { |
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 PlayerHealth : MonoBehaviour { | |
public float hitPoints = 100f;//max health | |
public float currentHitPoints; | |
public GameObject destroyFX, lose; | |
// Use this for initialization |
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 |
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
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 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 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; | |
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; | |
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; | |
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; |
NewerOlder