|
@ -4,7 +4,7 @@ using UnityEngine; |
|
|
|
|
|
|
|
|
public class PlayerController : MonoBehaviour { |
|
|
public class PlayerController : MonoBehaviour { |
|
|
|
|
|
|
|
|
private static bool isLocked = false; |
|
|
|
|
|
|
|
|
public bool isLocked = false; |
|
|
|
|
|
|
|
|
public float power; |
|
|
public float power; |
|
|
public float radius; |
|
|
public float radius; |
|
@ -12,6 +12,14 @@ public class PlayerController : MonoBehaviour { |
|
|
|
|
|
|
|
|
public GameObject waveRing; |
|
|
public GameObject waveRing; |
|
|
|
|
|
|
|
|
|
|
|
void Start() { |
|
|
|
|
|
|
|
|
|
|
|
NotificationServer.register("show GameUI", showGameUI); |
|
|
|
|
|
NotificationServer.register("hide GameUI", hideGameUI); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
// Update is called once per frame
|
|
|
void Update () { |
|
|
void Update () { |
|
|
|
|
|
|
|
@ -26,14 +34,6 @@ public class PlayerController : MonoBehaviour { |
|
|
|
|
|
|
|
|
if (Physics.Raycast(ray, out hit, Mathf.Infinity,rayMask)) { |
|
|
if (Physics.Raycast(ray, out hit, Mathf.Infinity,rayMask)) { |
|
|
|
|
|
|
|
|
Vector3 pos = hit.point; |
|
|
|
|
|
pos.y += 1; |
|
|
|
|
|
Quaternion rot = Quaternion.Euler(-90, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
if (waveRing != null) |
|
|
|
|
|
Destroy(Instantiate(waveRing, pos, rot),4); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WaterController waterScript = hit.collider.gameObject.GetComponent<WaterController>(); |
|
|
WaterController waterScript = hit.collider.gameObject.GetComponent<WaterController>(); |
|
|
Debug.DrawLine(Camera.main.transform.position, hit.point, Color.red,1); |
|
|
Debug.DrawLine(Camera.main.transform.position, hit.point, Color.red,1); |
|
|
|
|
|
|
|
@ -48,12 +48,14 @@ public class PlayerController : MonoBehaviour { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// if true stops player from being able to click on water
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
public static void lockControls(bool input) { |
|
|
|
|
|
isLocked = input; |
|
|
|
|
|
|
|
|
private void showGameUI() { |
|
|
|
|
|
Debug.Log("UI open"); |
|
|
|
|
|
isLocked = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void hideGameUI() { |
|
|
|
|
|
Debug.Log("UI close"); |
|
|
|
|
|
isLocked = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |