48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
![]() |
using System;
|
||
|
using Sirenix.OdinInspector;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
// ReSharper disable once CheckNamespace
|
||
|
namespace BlueWaterProject
|
||
|
{
|
||
|
[Serializable]
|
||
|
public class ProcessBar
|
||
|
{
|
||
|
public ProcessBar(GameObject obj, Image fill)
|
||
|
{
|
||
|
Obj = obj;
|
||
|
Fill = fill;
|
||
|
}
|
||
|
|
||
|
[field: SerializeField] public GameObject Obj { get; set; }
|
||
|
[field: SerializeField] public Image Fill { get; set; }
|
||
|
}
|
||
|
|
||
|
public class OceanUi : MonoBehaviour
|
||
|
{
|
||
|
[field: SerializeField] public ProcessBar ProcessBar { get; set; }
|
||
|
|
||
|
private Canvas canvas;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
UiManager.Inst.OceanUi = this;
|
||
|
}
|
||
|
|
||
|
[Button("셋팅 초기화")]
|
||
|
private void Init()
|
||
|
{
|
||
|
canvas = GetComponent<Canvas>();
|
||
|
if (!canvas)
|
||
|
{
|
||
|
Debug.LogError("canvas is null error");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var processBar = canvas.transform.Find("ProcessBar").gameObject;
|
||
|
var fill = processBar.transform.Find("Fill").GetComponent<Image>();
|
||
|
ProcessBar = new ProcessBar(processBar, fill);
|
||
|
}
|
||
|
}
|
||
|
}
|