mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-31 03:22:14 +00:00
41 lines
888 B
C#
41 lines
888 B
C#
using Raindrop.UI.Views;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Raindrop.UI.Views
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
} |