Skip to content

Instantly share code, notes, and snippets.

@tsuzukihashi
Last active March 25, 2020 05:06
Show Gist options
  • Save tsuzukihashi/b511a146992e058787177f1a33a23601 to your computer and use it in GitHub Desktop.
Save tsuzukihashi/b511a146992e058787177f1a33a23601 to your computer and use it in GitHub Desktop.
Unity uGUIをドラッグで動かしてステージを選ぶ ref: https://qiita.com/tsuzuki817/items/659a20ff57c83a022560
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