열차 목업의 내부 확인용 프로젝트
smchoi
2024-07-22 3fc9f79ca436203b0b5ba39b6a079ee086227c11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Collections;
using System.Collections.Generic;
//using Microsoft.Unity.VisualStudio.Editor;
using UnityEngine;
 
public class UILoadingBar : MonoBehaviour
{
    public TMPro.TMP_Text TxtPercent;
    public TMPro.TMP_Text TxtLoading;
 
    public UnityEngine.UI.Image ProgresBar;
 
    public GameObject LoadingPanel;
 
    void Start()
    {
        
    }
 
    public void Show() {
        SetValue(0f);
        LoadingPanel.SetActive(true);
    }
 
    public void Hide() {
        LoadingPanel.SetActive(false);
    }
 
    /// <summary>
    /// 퍼센트 설정하기
    /// </summary>
    /// <param name="value">0~1 사이의 값</param>
    public void SetValue(float value) {
        TxtPercent.text = string.Format("{0:P0}", value);
        ProgresBar.fillAmount = value;
    }
}