mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-29 19:03:10 +00:00
39 lines
826 B
C#
39 lines
826 B
C#
using Raindrop.UI.Views;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Raindrop.UI.Map
|
|
{
|
|
public class SliderZoomable : MonoBehaviour
|
|
{
|
|
private Slider slider;
|
|
public GameObject mapUIGO;
|
|
private MapUIView _mapUIView;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
void Awake()
|
|
{
|
|
_mapUIView = mapUIGO.GetComponent<MapUIView>();
|
|
slider = gameObject.GetComponent<Slider>();
|
|
if (slider != null)
|
|
{
|
|
slider.onValueChanged.AddListener(ListenerMethod);
|
|
}
|
|
|
|
}
|
|
public void ListenerMethod(float value)
|
|
{
|
|
if (_mapUIView != null)
|
|
{
|
|
// _mapUIView.setZoom(value);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
} |