malé úpravy data transfer minigame
This commit is contained in:
30
Assets/Scripts/data_transfer/RevealObjectCopy.cs
Normal file
30
Assets/Scripts/data_transfer/RevealObjectCopy.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class RevealObjectCopy : MonoBehaviour
|
||||
{
|
||||
public List<GameObject> objects; // seznam objekt?
|
||||
public float delay = 1f; // ?as mezi odkrýváním
|
||||
|
||||
void Start()
|
||||
{
|
||||
// nejd?ív všechny skryjeme
|
||||
foreach (GameObject obj in objects)
|
||||
{
|
||||
obj.SetActive(false);
|
||||
}
|
||||
|
||||
// spustíme postupné odkrývání
|
||||
StartCoroutine(Reveal());
|
||||
}
|
||||
|
||||
IEnumerator Reveal()
|
||||
{
|
||||
foreach (GameObject obj in objects)
|
||||
{
|
||||
yield return new WaitForSeconds(delay);
|
||||
obj.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user