feat:1、创建项目

This commit is contained in:
2026-06-25 15:22:28 +08:00
commit c05a65cdc3
6577 changed files with 1168287 additions and 0 deletions
@@ -0,0 +1,19 @@
namespace ChillConnect
{
public class LoadingCtrl : BaseCtrl
{
public static LoadingCtrl Instance { get; private set; }
private LoadingModel model;
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 341654c8a54544e9aefdab73ec4873a4
timeCreated: 1676622067
@@ -0,0 +1,15 @@
namespace ChillConnect
{
public class LoadingModel : BaseModel
{
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fcfcdf9f5d1c4197b3049bca9336855a
timeCreated: 1676622067
@@ -0,0 +1,164 @@
using System.Collections;
using System.Globalization;
using DG.Tweening;
using FairyGUI;
using FGUI.Loading_25;
using UnityEngine;
namespace ChillConnect
{
public class LoadingUI : BaseUI
{
private LoadingUICtrl ctrl;
private LoadingModel model;
private com_loading ui;
protected GProgressBar pb_loading;
private Tweener tweener;
protected int currValue;
public LoadingUI(LoadingUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.LoadingUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "Loading_25";
uiInfo.assetName = "com_loading";
uiInfo.layerType = UILayerType.Loading;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = false;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as com_loading;
}
protected override void OnOpenBefore(object args)
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenBgUI_Open);
ui.com_pb.max = 100;
ui.com_pb.value = 0;
ui.com_pb.text_per.text = ui.com_pb.value + "%";
// if (!GameHelper.IsConnect()) {
// return;
// }
// CrazyAsyKit.StartCoroutine(SetProgress(50));
// var splashCanvas = GameObject.Find("SplashCanvas");
// if (splashCanvas != null)
// {
// splashCanvas.SetActive(false);
// Object.Destroy(splashCanvas);
// }
if (PlayerPrefs.GetInt("OpenAD", 1) == 0) closeMask();
closeMask();
}
public IEnumerator SetProgress(int max)
{
tweener.Kill();
tweener = DOTween.To(() => ui.com_pb.value,
x => ui.com_pb.value = x, max, 12f)
.OnUpdate(() =>
{
ui.com_pb.text_per.text = ui.com_pb.value + "%";
});
yield return tweener;
}
private void Reconnection(object obj = null)
{
//CrazyAsyKit.StartCoroutine(SetProgress(97));
}
protected override void OnOpen(object args)
{
}
#endregion
#region
protected override void AddListener()
{
GameDispatcher.Instance.AddListener(GameMsg.UpdateHotFixMax, OnUpdateHotFixMax);
// GameDispatcher.Instance.AddListener(GameMsg.UpdateHotFixProgress, OnUpdateHotFixProgress);
GameDispatcher.Instance.AddListener(GameMsg.Network_reconnection, Reconnection);
// GameDispatcher.Instance.AddListener(GameMsg.CloseMask, closeMask);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.UpdateHotFixMax, OnUpdateHotFixMax);
// GameDispatcher.Instance.RemoveListener(GameMsg.UpdateHotFixProgress, OnUpdateHotFixProgress);
GameDispatcher.Instance.RemoveListener(GameMsg.Network_reconnection, Reconnection);
// GameDispatcher.Instance.RemoveListener(GameMsg.CloseMask, closeMask);
}
#endregion
private void closeMask(object a = null)
{
ui.com_pb.visible = true;
OnUpdateHotFixProgress(97);
}
private bool loading = false;
private bool isAgree = true;
public void CheckAgree()
{
if (!isAgree) return;
tweener.Kill();
ctrl.CloseUI();
}
private void OnUpdateHotFixMax(object obj)
{
if (obj != null)
{
var max = (int)obj;
// ui.pb_loading.max = max;
}
}
private void OnUpdateHotFixProgress(object obj)
{
if (loading) return;
if (obj != null)
{
loading = true;
tweener.Kill();
var value = (int)obj;
// pb_loading.value = value;
tweener = DOTween.To(() => ui.com_pb.value,
x => ui.com_pb.value = x, value, 12f)
.OnUpdate(() =>
{
ui.com_pb.text_per.text = (int)(ui.com_pb.value) + "%";
});
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0873adccf5e64e15a037be3341254d6c
timeCreated: 1676622067
@@ -0,0 +1,70 @@
namespace ChillConnect
{
public class LoadingUICtrl : BaseUICtrl
{
private LoadingUI ui;
private LoadingModel model;
private uint openUIMsg = 0;
private uint closeUIMsg = 0;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new LoadingUI(this);
ui.Open(args);
}
}
public override void CloseUI(object args = null)
{
if (ui is { isClose: false })
{
ui.Close();
}
ui = null;
}
#endregion
public override uint GetOpenUIMsg(string uiName)
{
return openUIMsg;
}
public override uint GetCloseUIMsg(string uiName)
{
return closeUIMsg;
}
protected override void AddListener()
{
AppDispatcher.Instance.AddListener(AppMsg.UI_DisplayLoadingUI, OpenUI);
AppDispatcher.Instance.AddListener(AppMsg.UI_HideLoadingUI, OnHideLoading);
}
protected override void RemoveListener()
{
AppDispatcher.Instance.RemoveListener(AppMsg.UI_DisplayLoadingUI, OpenUI);
AppDispatcher.Instance.RemoveListener(AppMsg.UI_HideLoadingUI, OnHideLoading);
}
private void OnHideLoading(object obj)
{
if (ui == null) return;
ui.CheckAgree();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5f7cb8eec2bb493fb2e95f287120770e
timeCreated: 1676622067