Created
December 1, 2018 15:31
-
-
Save chittai/ec1a6188d5d9e87c47998d4e8ae406b9 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
public class ChangeUISize : MonoBehaviour { | |
public GameObject panel; | |
void Update () { | |
if (Input.GetKey(KeyCode.Space)) | |
{ | |
StartCoroutine(ChangePaneltoBigSize()); | |
} | |
} | |
IEnumerator ChangePaneltoBigSize() | |
{ | |
var size = 0f; | |
var speed = 0.05f; | |
while (size <= 1.0f) | |
{ | |
panel.transform.localScale = Vector3.Lerp(new Vector3(0, 0, 0), new Vector3(1, 1, 1), size); | |
size += speed; | |
yield return null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment