아카이브
[VR 팀프로젝트] Wave 끝났을 때 연출 만들기 본문
게임 스테이지에서 정해진 수의 적을 물리치면 웨이브가 끝나며 다음 웨이브로 넘어가기 위한 연출이 나온다.
smoke 이펙트를 사용하고
코루틴 딜레이를 사용해 텍스트를 순차적으로 나오게함
사라질때는 Fade Out으로 사라지게 만듬
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace SYJ
{
public class TestDelay : MonoBehaviour
{
public GameObject waveText;
public GameObject compText;
public CanvasGroup canvasGroup;
public float fadeSpeed = 1.5f;
void Start()
{
StartCoroutine("FadeOut");
waveText.SetActive(false);
compText.SetActive(false);
StartCoroutine("Delay1");
StartCoroutine("Delay2");
}
IEnumerator Delay1()
{
yield return new WaitForSeconds(2f);
waveText.SetActive(true);
}
IEnumerator Delay2()
{
yield return new WaitForSeconds(2.5f);
compText.SetActive(true);
}
IEnumerator FadeOut()
{
yield return new WaitForSeconds(10f);
while (canvasGroup.alpha > 0)
{
canvasGroup.alpha -= Time.deltaTime * fadeSpeed;
yield return null;
}
}
}
}
'VR 콘텐츠 제작' 카테고리의 다른 글
[VR 팀프로젝트] 타이틀 씬 연출하기 (1) | 2023.12.29 |
---|---|
[VR 팀프로젝트] 랜덤 ui창 띄우기 (0) | 2023.12.05 |
[VR 팀프로젝트] UI에 UpgradeData 데이터 넣기 (0) | 2023.11.29 |
팀프로젝트 업그레이드 UI 구성 (0) | 2023.11.16 |
Interaction 초기설정 (0) | 2023.10.26 |