How to make a loading bar in unity in hindi | creating loading bar in unity in hindi
Автор: Gamedev Hub
Загружено: 2021-10-03
Просмотров: 1913
You can use LoadSceneAsync method in StartCoroutine method to load scene and create loading.
Creating Loading in unity in hindi
Loading Scene in unity in hindi
whiole script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class scene_loading : MonoBehaviour
{
public GameObject loading_panel;
public Slider slider;
public Text txt;
public void Load_Scene(string scene_name)
{
StartCoroutine(Load_Async_Scene(scene_name));
loading_panel.SetActive(true);
}
IEnumerator Load_Async_Scene(string scene_name)
{
AsyncOperation operation = SceneManager.LoadSceneAsync(scene_name);
while (operation.isDone==false)
{
float process = Mathf.Clamp01(operation.progress/0.9f);
slider.value=process;
txt.text = (process*100).ToString() +"%";
yield return null;
}
}
}
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: