1
Fork 0
mirror of https://github.com/Steffo99/bleach-beach.git synced 2024-12-04 19:04:19 +00:00
This commit is contained in:
Steffo 2018-08-12 16:22:09 +02:00
parent 5d85a303dc
commit 69a2bcc6f0
3 changed files with 7 additions and 7 deletions

View file

@ -34,7 +34,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1634593922401586}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 10.24, y: 27.43, z: 0}
m_LocalPosition: {x: 3.39, y: 28.18, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}

View file

@ -362,8 +362,8 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingLayerID: -1570049999
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 3504427cef78c5a4ea13eadb8bac91a5, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}

View file

@ -21,12 +21,12 @@ public class Cannon : MonoBehaviour {
private void Update ()
{
Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position);
Vector2 direction = (Vector2)Input.mousePosition - screenPosition;
transform.rotation = Quaternion.LookRotation(Vector3.forward, direction);
spriteRenderer.flipX = direction.x < 0;
if (harpoonAvailable)
{
Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position);
Vector2 direction = (Vector2)Input.mousePosition - screenPosition;
transform.rotation = Quaternion.LookRotation(Vector3.forward, direction);
spriteRenderer.flipX = direction.x < 0;
if (Input.GetMouseButton(0))
{
force = Mathf.Clamp(force + forceBuildingSpeed * Time.deltaTime, 0, maxForce);