ball 项目提交
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SecretDetailCtrl : BaseCtrl
|
||||
{
|
||||
public static SecretDetailCtrl Instance { get; private set; }
|
||||
|
||||
private SecretDetailModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.SecretDetailModel) as SecretDetailModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8adb52e123a146b9bca2f91a9346bf41
|
||||
timeCreated: 1753517102
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SecretDetailModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70914fdb77b643ff9fefe690b05f720e
|
||||
timeCreated: 1753517102
|
||||
@@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using FairyGUI;
|
||||
using SGModule.Common.Extensions;
|
||||
using SGModule.Common.Helper;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SecretDetailUI : BaseUI
|
||||
{
|
||||
private SecretDetailUICtrl ctrl;
|
||||
private SecretDetailModel model;
|
||||
private FGUI.LG_secretAlbums.com_secretDetail ui;
|
||||
|
||||
public SecretDetailUI(SecretDetailUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.SecretDetailUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_secretAlbums";
|
||||
uiInfo.assetName = "com_secretDetail";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.SecretDetailModel) as SecretDetailModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
if (_loader != null && !_loader.isDisposed && _loader.texture != null)
|
||||
{
|
||||
_loader.texture.Dispose();
|
||||
_loader.texture = null;
|
||||
}
|
||||
_loader = null;
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_secretAlbums.com_secretDetail;
|
||||
}
|
||||
|
||||
private DetailData _pictureName;
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args == null) return;
|
||||
_pictureName = (DetailData)args;
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private GLoader _loader = new GLoader();
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
_loader = ui.com_loader.GetChild("loader") as GLoader;
|
||||
|
||||
TextureHelper.SetImgLoader(ui.com_loader.GetChild("loader") as GLoader, _pictureName.Name, null,
|
||||
_pictureName.Name1, FolderNames.SecretName);
|
||||
var btnDownCoin = ((FGUI.LG_Common.btn_unlock)ui.btn_download_coin);
|
||||
var downloadCoinNum = ConfigSystem.GetCommonConf().CoinsDownload;
|
||||
btnDownCoin.title = downloadCoinNum.ToString();
|
||||
if (GameHelper.GetVipLevel() >= 1)
|
||||
{
|
||||
(ui.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
|
||||
ui.is_vip.selectedIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.is_vip.selectedIndex = 0;
|
||||
btnDownCoin.down_load.selectedIndex = 1;
|
||||
}
|
||||
btnDownCoin.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.Get101() >= downloadCoinNum)
|
||||
{
|
||||
DataMgr.Coin.Value -= downloadCoinNum;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
TextureHelper.SaveImageToAlbum(_pictureName.Name, FolderNames.SecretName, CtrlCloseUI);
|
||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_enough_gold", true);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||
}
|
||||
});
|
||||
|
||||
ui.btn_download.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.GetVipLevel() >= 1)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(_pictureName.Name, FolderNames.SecretName, CtrlCloseUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowVideoAd("secret_albnums", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(_pictureName.Name, FolderNames.SecretName, CtrlCloseUI);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void ItemRender(int index, GObject obj)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private int GetPepleNum(float quantity)
|
||||
{
|
||||
// 获取当前时间
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
// 计算当天已经过去的分钟数(从凌晨 0 点开始算)
|
||||
int minutesPassedToday = now.Hour * 60 + now.Minute;
|
||||
|
||||
// 计算人数
|
||||
int num = Mathf.FloorToInt(quantity * minutesPassedToday);
|
||||
|
||||
return num;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29b4548115424136b933917cce0cf07b
|
||||
timeCreated: 1753517102
|
||||
@@ -0,0 +1,74 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SecretDetailUICtrl : BaseUICtrl
|
||||
{
|
||||
private SecretDetailUI ui;
|
||||
private SecretDetailModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.SecretDetailUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.SecretDetailUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.SecretDetailModel) as SecretDetailModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new SecretDetailUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
}
|
||||
public override uint GetCloseUIMsg(string uiName)
|
||||
{
|
||||
return closeUIMsg;
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dacaf63ed5a4250994be0e0de513d7e
|
||||
timeCreated: 1753517102
|
||||
Reference in New Issue
Block a user