imported music, added combat and death

This commit is contained in:
2023-04-21 03:30:43 -04:00
parent 0b7b2515d1
commit c4094b169c
82 changed files with 11177 additions and 2270 deletions

View File

@ -9,11 +9,18 @@ public class BulletComponent : MonoBehaviour
private float existed = 0f;
[SerializeField]
private string type = "flare";
private FlareRegister register;
[SerializeField]
private float damageRange = 20f;
[SerializeField]
private float damageMagnitude = 1f;
public float DamageMagnitude { get { return this.damageMagnitude; } }
public float DamageRange { get { return damageRange; } }
// Start is called before the first frame update
void Start()
{
register = FlareRegister.instance;
register.bullets.Add(this);
}
// Update is called once per frame
@ -25,6 +32,7 @@ public class BulletComponent : MonoBehaviour
{
if(existed >= duration)
{
register.bullets.Remove(this);
Destroy(this.gameObject);
}
existed += Time.fixedDeltaTime;

View File

@ -25,6 +25,7 @@ public class PistolComponent : MonoBehaviour
[SerializeField]
private float maxProjectileDuration = 5f;
//private Dictionary<int,float> projectiles = new Dictionary<int, float>();
@ -32,7 +33,7 @@ public class PistolComponent : MonoBehaviour
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
@ -66,7 +67,7 @@ public class PistolComponent : MonoBehaviour
{
targetObject.gameObject.transform.position = hit.point;
float drop = CalculateDrop(this.bulletSpawnPoint.position, hit.point, this.transform.up * this.firePower);
print(drop);
//print(drop);
}
}
@ -84,6 +85,8 @@ public class PistolComponent : MonoBehaviour
Rigidbody pRigid = projectile.GetComponent<Rigidbody>();
pRigid.AddForce(pRigid.transform.up*this.firePower, ForceMode.Impulse);
projectile.transform.parent = null;
}
public void Enable()