-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class PlayerMovement : MonoBehaviour { | ||
|
||
public GameObject weapon; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
if (Input.GetButtonDown("Fire1")) { | ||
Vector3 shootDirection = Input.mousePosition; | ||
shootDirection.z = 0.0f; | ||
shootDirection = Camera.main.ScreenToWorldPoint(shootDirection); | ||
shootDirection = shootDirection - transform.position; | ||
//Debug.Log(shootDirection.x + " - " + shootDirection.y + " - " + shootDirection.z); | ||
//transform.position += new Vector3(shootDirection.x, shootDirection.y); | ||
GameObject bullet = (GameObject) Instantiate(weapon, transform.position, Quaternion.identity); | ||
|
||
//Debug.Log( | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using System; | ||
|
||
public class Shot : MonoBehaviour { | ||
|
||
public float speed; | ||
public float lifeTime = 1; | ||
private float lifeBegun; | ||
|
||
// Use this for initialization | ||
void Start () { | ||
lifeBegun = Time.time; | ||
Debug.Log(transform.eulerAngles.z); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
if (Time.time > (lifeBegun + lifeTime)) { | ||
Destroy(gameObject); | ||
} else { | ||
float rot = transform.eulerAngles.z; | ||
transform.position += new Vector3(-(float) Math.Sin(degreeToRadian(rot)) * speed * Time.deltaTime, | ||
(float) Math.Cos(degreeToRadian(rot)) * speed * Time.deltaTime); | ||
} | ||
} | ||
|
||
private float degreeToRadian(float degree) { | ||
return (float) ((Math.PI / 180) * degree); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5;0;6;-1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sceneSetups: | ||
- path: Assets/Scenes/scene.unity | ||
isLoaded: 1 | ||
isActive: 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
unityRebuildLibraryVersion: 11 | ||
unityForwardCompatibleVersion: 40 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
0000.56a2b01c.0000 | ||
0000.56a2b038.0000 |