mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-27 22:11:39 +00:00
refactor: move PanAndZoom into RD.UI.Pancake
This commit is contained in:
committed by
alexiscatnip
parent
f06b555da2
commit
2533253ee2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user