public static ProgressBar Show(string bgPath, string fgPath, Action onFinished = null, Image.FillMethod fillMethod = Image.FillMethod.Horizontal, bool leftFill = true)
{
if (barGo != null)
{
GameObject.DestroyImmediate(barGo);
}
barGo = null;
curProgressBar = null;
var tempGo = Instantiate(ResourceManager.LoadGameObjectAssets(PrefabResourceName));
barGo = tempGo;
GameObject.DontDestroyOnLoad(barGo);
curProgressBar = tempGo.GetComponent <ProgressBar>();
curProgressBar.onFinish = onFinished;
curProgressBar.progressBg.sprite = UR.Load <Sprite>(bgPath) as Sprite;
curProgressBar.progressBg.SetNativeSize();
curProgressBar.progress.sprite = UR.Load <Sprite>(fgPath) as Sprite;
curProgressBar.progress.SetNativeSize();
curProgressBar.progress.type = Image.Type.Filled;
curProgressBar.progress.fillMethod = fillMethod;
curProgressBar.progress.fillOrigin = leftFill ? 0 : 1;
curProgressBar.progress.fillAmount = 0;
return(curProgressBar);
}