29 lines
603 B
C#
29 lines
603 B
C#
using System;
|
|
using JetBrains.Annotations;
|
|
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class testGun : MonoBehaviour
|
|
{
|
|
public GameManager gm;
|
|
public GameObject bullet;
|
|
|
|
public Vector3 bulletSpawn;
|
|
public GameObject spawner;
|
|
Camera camera;
|
|
|
|
void Start() {
|
|
Camera camera = FindAnyObjectByType<Camera>();
|
|
Ray ray = camera.ScreenPointToRay(Input.mousePosition);
|
|
}
|
|
|
|
void Update() {
|
|
bulletSpawn = spawner.transform.position;
|
|
|
|
if (Input.GetMouseButton(0)) {
|
|
Instantiate(bullet, bulletSpawn, Quaternion.identity);
|
|
|
|
}
|
|
}
|
|
}
|