备份CatanBuilding瘦身独立工程

This commit is contained in:
JSD\13999
2026-05-26 16:15:54 +08:00
commit 2d0e6a61b7
12001 changed files with 2431925 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
using UnityEngine;
using UnityEngine.EventSystems;
using System;
namespace Game
{
public class CameraScroller : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
public bool isDragging { get; private set; }
float _yMax = 4.5f;
float _yMin = -1f;
public void OnBeginDrag(PointerEventData eventData)
{
isDragging = true;
}
public void OnDrag(PointerEventData eventData)
{
var main_cam = Camera.main;
if (main_cam != null)
{
var pos = main_cam.transform.position;
var new_y = pos.y;
new_y -= eventData.delta.y * 0.01f;
pos.y = Mathf.Clamp(new_y, _yMin, _yMax);
main_cam.transform.position = pos;
}
}
public void OnEndDrag(PointerEventData eventData)
{
isDragging = false;
}
public void OnPointerClick(PointerEventData eventData)
{
throw new NotImplementedException();
}
}
}