fix:1、更换项目,使用winter来创建
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class UnlockLevelCtrl : BaseCtrl
|
||||
{
|
||||
public static UnlockLevelCtrl Instance { get; private set; }
|
||||
|
||||
private UnlockLevelModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.UnlockLevelModel) as UnlockLevelModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ed37101546f24366b2287ba874f9481
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class UnlockLevelModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e5dee4d6067d4289bc107da0d397ce4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,248 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using FGUI.LG_Common;
|
||||
using DG.Tweening;
|
||||
using SGModule.NetKit;
|
||||
using System.Collections.Generic;
|
||||
using SGModule.Common.Extensions;
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class UnlockLevelUI : BaseUI
|
||||
{
|
||||
private UnlockLevelUICtrl ctrl;
|
||||
private UnlockLevelModel model;
|
||||
private FGUI.LG_End.com_unlockLevel ui;
|
||||
|
||||
public UnlockLevelUI(UnlockLevelUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.UnlockLevelUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_End";
|
||||
uiInfo.assetName = "com_unlockLevel";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.UnlockLevelModel) as UnlockLevelModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
for (int i = 0; i < loader_list.Count; i++)
|
||||
{
|
||||
if (loader_list[i] != null && !loader_list[i].isDisposed && loader_list[i].texture != null)
|
||||
{
|
||||
loader_list[i].texture.Dispose();
|
||||
loader_list[i].texture = null;
|
||||
}
|
||||
}
|
||||
loader_list.Clear();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_End.com_unlockLevel;
|
||||
}
|
||||
private LevelUnlock levelUnlock_;
|
||||
private int level_;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
level_ = (int)args;
|
||||
Debug.Log(level_);
|
||||
|
||||
if (!loader_list.Contains(ui.com_loader.GetChild("loader") as GLoader))
|
||||
{
|
||||
loader_list.Add(ui.com_loader.GetChild("loader") as GLoader);
|
||||
}
|
||||
|
||||
levelUnlock_ = ConfigSystem.GetConfig<LevelUnlock>()[level_];
|
||||
TextureHelper.SetImgLoader(ui.com_loader.GetChild("loader") as GLoader, levelUnlock_.Name, (s) =>
|
||||
{
|
||||
TextureHelper.SetImageBlur(ui.com_loader.GetChild("loader") as GLoader);
|
||||
}, "LevelAlbums/", FolderNames.AlbumName);
|
||||
InitView();
|
||||
if (levelUnlock_.LeveType == 1)
|
||||
{
|
||||
TrackKit.SendEvent(ADEventTrack.Special, ADEventTrack.Property.speciallevel);
|
||||
}
|
||||
else if (levelUnlock_.LeveType == 2)
|
||||
{
|
||||
TrackKit.SendEvent(ADEventTrack.VipLevel, ADEventTrack.Property.viplevel);
|
||||
}
|
||||
|
||||
}
|
||||
private List<GLoader> loader_list = new List<GLoader>();
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
GameDispatcher.Instance.AddListener(GameMsg.BuyVip, refrsh);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.BuyVip, refrsh);
|
||||
}
|
||||
#endregion
|
||||
private void refrsh(object a = null)
|
||||
{
|
||||
DOVirtual.DelayedCall(0.5f, () =>
|
||||
{
|
||||
InitView();
|
||||
});
|
||||
|
||||
}
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
|
||||
if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||
{
|
||||
(ui.btn_vip as btn_claim_2).have_vip.selectedIndex = 1;
|
||||
}
|
||||
if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||
{
|
||||
(ui.btn_watch as btn_claim_1).have_vip.selectedIndex = 1;
|
||||
}
|
||||
|
||||
if (levelUnlock_.LeveType == 1) //特殊关
|
||||
{
|
||||
ui.type.selectedIndex = 0;
|
||||
ui.btn_pay.title = levelUnlock_.GoldCoins.ToString();
|
||||
|
||||
ui.btn_pay.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.Coin.Value >= levelUnlock_.GoldCoins)
|
||||
{
|
||||
DataMgr.Coin.Value -= levelUnlock_.GoldCoins;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
DataMgr.LevelUnlockList.Value.Add(level_);
|
||||
GameHelper.ShowTips("unlocked", true);
|
||||
DataMgr.LevelUnlockList.Save();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
CtrlCloseUI();
|
||||
TrackKit.SendEvent(ADEventTrack.Special, ADEventTrack.Property.speciallevelcoin);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_enough_gold", true);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||
}
|
||||
});
|
||||
|
||||
ui.btn_watch.SetClick(() => //7天都不包含。30天包含特殊,365全部包含
|
||||
{
|
||||
if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||
{
|
||||
DataMgr.LevelUnlockList.Value.Add(level_);
|
||||
GameHelper.ShowTips("unlocked", true);
|
||||
DataMgr.LevelUnlockList.Save();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
CtrlCloseUI();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowVideoAd("UnlockSpecialLevel", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
DataMgr.LevelUnlockList.Value.Add(level_);
|
||||
GameHelper.ShowTips("unlocked", true);
|
||||
DataMgr.LevelUnlockList.Save();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
TrackKit.SendEvent(ADEventTrack.Special, ADEventTrack.Property.speciallevelvideo);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
else if (levelUnlock_.LeveType == 2)//vip关
|
||||
{
|
||||
ui.type.selectedIndex = 1;
|
||||
ui.btn_pay.title = levelUnlock_.GoldCoins.ToString();
|
||||
|
||||
ui.btn_pay.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.Coin.Value >= levelUnlock_.GoldCoins)
|
||||
{
|
||||
DataMgr.Coin.Value -= levelUnlock_.GoldCoins;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
DataMgr.LevelUnlockList.Value.Add(level_);
|
||||
GameHelper.ShowTips("unlocked", true);
|
||||
DataMgr.LevelUnlockList.Save();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
TrackKit.SendEvent(ADEventTrack.VipLevel, ADEventTrack.Property.viplevelcoin);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_enough_gold", true);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||
}
|
||||
});
|
||||
ui.btn_vip.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||
{
|
||||
DataMgr.LevelUnlockList.Value.Add(level_);
|
||||
GameHelper.ShowTips("unlocked", true);
|
||||
DataMgr.LevelUnlockList.Save();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.VipClubViewUI_Open, 2);
|
||||
TrackKit.SendEvent(ADEventTrack.VipLevel, ADEventTrack.Property.viplevelsub);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
GameHelper.SetLevel(GameHelper.GetLevel() + 1);
|
||||
if (UIManager.Instance.IsExistUI(UIConst.NewEndUI))
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.NewEndUI_Close);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Open);
|
||||
}
|
||||
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 631ea815252db45da85a29cdbc773808
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class UnlockLevelUICtrl : BaseUICtrl
|
||||
{
|
||||
private UnlockLevelUI ui;
|
||||
private UnlockLevelModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.UnlockLevelUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.UnlockLevelUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.UnlockLevelModel) as UnlockLevelModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new UnlockLevelUI(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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b70f920f2c424e619f7e3b2f6d38a92
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user