Skip to content

Instantly share code, notes, and snippets.

@chittai
Created December 1, 2018 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chittai/2fb243b9115912668748c3dc7698e850 to your computer and use it in GitHub Desktop.
Save chittai/2fb243b9115912668748c3dc7698e850 to your computer and use it in GitHub Desktop.
DOTweenを使用したケースのUIサイズ変更方法
using System.Collections;
using UnityEngine;
using DG.Tweening;
public class ChangeUISize : MonoBehaviour {
public GameObject panel;
private bool isDefaultScale;
void Update () {
if (Input.GetKey(KeyCode.Space))
{
if (isDefaultScale)
{
panel.transform.DOScale(new Vector3(0, 0, 0), 0.2f);
isDefaultScale = false;
}
else if (!isDefaultScale)
{
panel.transform.DOScale(new Vector3(1, 1, 1), 0.2f);
isDefaultScale = true;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment