Created
June 17, 2019 07:28
-
-
Save IshidaGames/afbcd8a839f5a85e8f9f28633084c0a1 to your computer and use it in GitHub Desktop.
This file contains 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
//UI使うのに必要 | |
using UnityEngine.UI; | |
//DOTween使うのに必要 | |
using DG.Tweening; | |
public class Screen : MonoBehaviour | |
{ | |
public RectTransform screen; | |
void Update() | |
{ | |
//左クリックで動く | |
if (Input.GetMouseButton(0)) | |
{ | |
//0.25秒でVector2(0, 0)に移動 | |
screen.DOAnchorPos(new Vector2(0, 0), 0.25f); | |
} | |
//右クリックで動く | |
if (Input.GetMouseButton(1)) | |
{ | |
//0.25秒でVector2(796, 0)に移動 | |
screen.DOAnchorPos(new Vector2(796, 0), 0.25f); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment