ProFlares_Demo_Space.cs 635 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ProFlares_Demo_Space : MonoBehaviour {
  5. public GameObject missilePrefab;
  6. public Transform missileLauncher;
  7. public List<GameObject> missileList = new List<GameObject>();
  8. // Use this for initialization
  9. void Start () {
  10. }
  11. // Update is called once per frame
  12. void Update () {
  13. if (Input.GetKey("space"))
  14. {
  15. GameObject missileClone = Instantiate<GameObject>(missilePrefab);
  16. missileClone.transform.position = missileLauncher.position;
  17. //missileClone.GetComponent<Rigidbody>().velocity = Vector3.up*1;
  18. }
  19. }
  20. }