imported music, added combat and death
This commit is contained in:
@ -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;
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user