Created
December 1, 2018 15:18
-
-
Save chittai/2fb243b9115912668748c3dc7698e850 to your computer and use it in GitHub Desktop.
DOTweenを使用したケースのUIサイズ変更方法
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 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