Created
June 17, 2019 07:47
-
-
Save IshidaGames/66baa0f504da81b6ed3325855cbd4002 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 ScreenScale : MonoBehaviour | |
{ | |
public RectTransform screen; | |
void Update() | |
{ | |
//左クリックで動く | |
if (Input.GetMouseButton(0)) | |
{ | |
//大きさを0にする、0.5秒で | |
screen.DOScale(0, 0.5f); | |
} | |
//右クリックで動く | |
if (Input.GetMouseButton(1)) | |
{ | |
//大きさを元の1にする、0.5秒で | |
screen.DOScale(1, 0.5f); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment