refactor: move PanAndZoom into RD.UI.Pancake

This commit is contained in:
alexiscatnip
2022-08-06 02:43:06 +08:00
committed by alexiscatnip
parent f06b555da2
commit 2533253ee2
4 changed files with 10 additions and 6 deletions
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0cd74fda30934cccbdb7639eda8a13c4
timeCreated: 1657640528
@@ -1,9 +1,9 @@
using UnityEngine;
using System;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Raindrop
namespace Raindrop.UI.Pancake
{
/// <summary> A modular and easily customisable Unity MonoBehaviour for handling swipe and pinch motions on mobile. </summary>
public class PanAndZoom : MonoBehaviour
@@ -36,7 +36,7 @@ namespace Raindrop
[Tooltip("Does the script control camera movement?")]
public bool controlCamera = true;
[Tooltip("The controlled camera, ignored of controlCamera=false")]
public Camera cam;
public UnityEngine.Camera cam;
[Header("UI")]
[Tooltip("Are touch motions listened to if they are over UI elements?")]
@@ -234,7 +234,7 @@ namespace Raindrop
if (controlCamera && cameraControlEnabled)
{
if (cam == null) cam = Camera.main;
if (cam == null) cam = UnityEngine.Camera.main;
cam.transform.position -= (cam.ScreenToWorldPoint(deltaPosition) - cam.ScreenToWorldPoint(Vector2.zero));
}
@@ -248,7 +248,7 @@ namespace Raindrop
if (controlCamera && cameraControlEnabled)
{
if (cam == null) cam = Camera.main;
if (cam == null) cam = UnityEngine.Camera.main;
if (cam.orthographic)
{
@@ -5,6 +5,7 @@ using OpenMetaverse;
using Plugins.CommonDependencies;
using Raindrop.Map.Model;
using Raindrop.Services;
using Raindrop.UI.Pancake;
using Raindrop.Utilities;
using UnityEngine;
using UnityEngine.Assertions;