Skip to content

Instantly share code, notes, and snippets.

@IshidaGames
Created June 17, 2019 07:28
Show Gist options
  • Save IshidaGames/afbcd8a839f5a85e8f9f28633084c0a1 to your computer and use it in GitHub Desktop.
Save IshidaGames/afbcd8a839f5a85e8f9f28633084c0a1 to your computer and use it in GitHub Desktop.
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