mirror of
https://github.com/ConjureETS/Labo_2_Equ_1_a15.git
synced 2026-03-24 01:50:58 +00:00
23 lines
675 B
C#
23 lines
675 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class ShootingScript : MonoBehaviour {
|
|
|
|
public float attackSpeed;
|
|
private float nextShootTime = 0.0f;
|
|
public GameObject Missile;
|
|
// Use this for initialization
|
|
void Start () {
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
if(Input.GetButton("Fire1") && Time.time > nextShootTime){
|
|
print("pewpew");
|
|
nextShootTime = Time.time + attackSpeed;
|
|
//avancer le missile au depart quand il va apparaitre (quand je vais avoir anim de combat)
|
|
GameObject clone = Instantiate( Missile,transform.position,transform.rotation) as GameObject;
|
|
}
|
|
}
|
|
}
|