Created
September 15, 2017 19:20
-
-
Save danielgc/ed1a829c870f256890b9a12a9629783d to your computer and use it in GitHub Desktop.
FighterBulletController.cs
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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class FigtherBulletController : MonoBehaviour { | |
public float bulletSpeed = 18f; | |
// Use this for initialization | |
void Start () { | |
this.GetComponent<Rigidbody2D>().velocity = new Vector3 (0, bulletSpeed, 0); | |
} | |
// Update is called once per frame | |
void Update () { | |
// monitorear para desaparecer bala | |
if (transform.position.y > 10.5) { | |
Destroy (gameObject); | |
print ("Bala perdida"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment