Skip to content

Instantly share code, notes, and snippets.

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