Skip to content

Instantly share code, notes, and snippets.

@didacus
didacus / EnemyHealthManager.cs
Created November 14, 2021 15:12
Unity - Basic enemy health manager
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyHealthManager : MonoBehaviour
{
public int startingHealth;
private int currentHealth;
public float flashLength;
private float flashCounter;
@didacus
didacus / GunController.cs
Created November 14, 2021 15:23
Unity - Basic gun controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GunController : MonoBehaviour
{
public bool isFiring;
public BulletController bullet;
public float bulletSpeed;
public float fireRate;
@didacus
didacus / DamagePlayer.cs
Created November 14, 2021 15:28
Unity - Basic player damage
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DamagePlayer : MonoBehaviour
{
public int damageToGive;
public void OnTriggerEnter(Collider other)
{