Last active
March 25, 2020 05:06
-
-
Save tsuzukihashi/b511a146992e058787177f1a33a23601 to your computer and use it in GitHub Desktop.
Unity uGUIをドラッグで動かしてステージを選ぶ ref: https://qiita.com/tsuzuki817/items/659a20ff57c83a022560
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.EventSystems; | |
public class SlideController : MonoBehaviour, IDragHandler { | |
public RectTransform m_rectTransform = null; | |
public void OnDrag(PointerEventData eventData) | |
{ | |
m_rectTransform.position += new Vector3(eventData.delta.x*0.01f, 0f, 0f); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment