Added Console
Debug commands can now be executed using an in-game console
This commit is contained in:
parent
b589a6422c
commit
75eb534983
305 changed files with 2975 additions and 17480 deletions
|
|
@ -31,14 +31,14 @@ public class ClickCatcher : MonoBehaviour, IPointerEnterHandler, IPointerExitHan
|
|||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
//Debug.Log("Pointer Entered");
|
||||
Debug.Log("Pointer Entered");
|
||||
OnEnter?.Invoke(eventData);
|
||||
PointerIsInside = true;
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
//Debug.Log("Pointer Exited");
|
||||
Debug.Log("Pointer Exited");
|
||||
OnExit?.Invoke(eventData);
|
||||
PointerIsInside = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,23 +7,27 @@ public class DragHandler : MonoBehaviour
|
|||
{
|
||||
public Camera Camera;
|
||||
public float Scaling;
|
||||
public ClickCatcher Background;
|
||||
private Vector2 _previousPosition;
|
||||
|
||||
void Update()
|
||||
{
|
||||
var newPosition = Camera.ScreenToWorldPoint(Input.mousePosition);
|
||||
if(Input.GetMouseButtonDown(0))
|
||||
_previousPosition = newPosition;
|
||||
if (Input.GetMouseButton(0))
|
||||
if (Background.PointerIsInside)
|
||||
{
|
||||
Camera.transform.position -= (Vector3)((Vector2) newPosition - _previousPosition);
|
||||
}
|
||||
var newPosition = Camera.ScreenToWorldPoint(Input.mousePosition);
|
||||
if(Input.GetMouseButtonDown(0))
|
||||
_previousPosition = newPosition;
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
Camera.transform.position -= (Vector3)((Vector2) newPosition - _previousPosition);
|
||||
}
|
||||
|
||||
if (abs(Input.mouseScrollDelta.y) > .01f)
|
||||
{
|
||||
var previousPosition = Camera.ScreenToWorldPoint(Input.mousePosition);
|
||||
Camera.orthographicSize *= 1 + Input.mouseScrollDelta.y * Scaling;
|
||||
Camera.transform.position -= Camera.ScreenToWorldPoint(Input.mousePosition) - previousPosition;
|
||||
if (abs(Input.mouseScrollDelta.y) > .01f)
|
||||
{
|
||||
var previousPosition = Camera.ScreenToWorldPoint(Input.mousePosition);
|
||||
Camera.orthographicSize *= 1 + Input.mouseScrollDelta.y * Scaling;
|
||||
Camera.transform.position -= Camera.ScreenToWorldPoint(Input.mousePosition) - previousPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue