Merge remote-tracking branch 'origin/dev' into dev_lishuo

# Conflicts:
#	Assets/Scripts/App.cs
This commit is contained in:
lishuo committed 2021-04-28 15:49:24 +08:00
commit 614d067d25
39 files changed
+5682 -12276

No files matched your search

+8 -8
View File
@@ -123,8 +123,9 @@ namespace Assets.Scripts
public static void showToast(GameObject game,string text,int duration = 1,int type = 0)
{
//type 0错误 1正确
var parent = Utils.FindUpParent(game.transform);
var toast = parent.Find("ToastContainer");
var parent = UIManager.Instance.ModalsPanel;
if (parent == null) return;
var toast = parent.transform.Find("ToastContainer");
if (toast != null)
{
MonoBehaviour.DestroyImmediate(toast.gameObject);
@@ -132,7 +133,7 @@ namespace Assets.Scripts
var newToast = MonoBehaviour.Instantiate(Resources.Load<GameObject>("UI/Prefab/ToastContainer"));
newToast.name = "ToastContainer";
newToast.GetComponent<RectTransform>().position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
newToast.transform.parent = parent;
newToast.transform.parent = parent.transform;
toast = newToast.transform;
var toastStyle = toastDict[type].Split('|');
toast.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>(toastStyle[0]);
@@ -156,8 +157,7 @@ namespace Assets.Scripts
newLoading.transform.parent = parent;
loading = newLoading.transform;
}
loading.GetComponent<LoadingPf>().Initial();
loading.gameObject.SetActive(true);
loading.GetComponent<LoadingPf>().Show();
}
public static void showLoadingExtension(this GameObject game)
@@ -171,8 +171,7 @@ namespace Assets.Scripts
newLoading.transform.parent = game.transform;
loading = newLoading.transform;
}
loading.GetComponent<LoadingPf>().Initial();
loading.gameObject.SetActive(true);
loading.GetComponent<LoadingPf>().Show();
}
public static void hideLoading(this GameObject game)
{
@@ -180,7 +179,8 @@ namespace Assets.Scripts
var loading = parent.Find("Loading");
if (loading != null)
{
loading.gameObject.SetActive(false);
//loading.gameObject.SetActive(false);
loading.GetComponent<LoadingPf>().Close();
}
}
/*删除父亲节点下的所有孩子*/