fix:1、更换项目,使用winter来创建
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FairyGUI;
|
||||
using FGUI.P20_MainTab;
|
||||
using FGUI.ZM_Tab_19;
|
||||
using Newtonsoft.Json;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
public class MainTabUI : BaseUI
|
||||
{
|
||||
private MainTabUICtrl ctrl;
|
||||
private MainTabModel model;
|
||||
private FGUI.P20_MainTab.com_main_tab ui;
|
||||
private FGUI.ZM_Tab_19.com_main_tab ui;
|
||||
|
||||
private Action closeCallBack;
|
||||
|
||||
@@ -21,7 +19,7 @@ namespace FlowerPower
|
||||
public static int mLastIndex = 1;
|
||||
|
||||
private bool exitH5Task;
|
||||
private Action closeCallback;
|
||||
|
||||
|
||||
|
||||
public MainTabUI(MainTabUICtrl ctrl) : base(ctrl)
|
||||
@@ -32,7 +30,7 @@ namespace FlowerPower
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "P20_MainTab";
|
||||
uiInfo.packageName = "ZM_Tab_19";
|
||||
uiInfo.assetName = "com_main_tab";
|
||||
uiInfo.layerType = UILayerType.Top;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
@@ -56,7 +54,7 @@ namespace FlowerPower
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.P20_MainTab.com_main_tab;
|
||||
ui = baseUI as FGUI.ZM_Tab_19.com_main_tab;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
@@ -72,9 +70,10 @@ namespace FlowerPower
|
||||
|
||||
private void CloseAllTabView()
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.TujianUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MenuUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MainUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MailUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.SignInUI_Close);
|
||||
|
||||
}
|
||||
|
||||
@@ -89,12 +88,12 @@ namespace FlowerPower
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
GameDispatcher.Instance.AddListener(GameMsg.MainTab, OnGameTab);
|
||||
// GameDispatcher.Instance.AddListener(GameMsg.MainTab, OnGameTab);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.MainTab, OnGameTab);
|
||||
// GameDispatcher.Instance.RemoveListener(GameMsg.MainTab, OnGameTab);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -107,21 +106,20 @@ namespace FlowerPower
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
ui.com_tab.btn_shop.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_signin.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_main.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_pintu.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_mail.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_options.SetClickDownEffect(0.8f, 1);
|
||||
|
||||
ui.com_tab.btn_signin.SetClick(OnClickSignInTab);
|
||||
ui.com_tab.btn_main.SetClick(OnClickMainTab);
|
||||
ui.com_tab.btn_shop.SetClick(OnClickShopTab);
|
||||
ui.com_tab.btn_pintu.SetClick(OnClickPintuTab);
|
||||
|
||||
ui.com_tab.btn_mail.SetClick(OnClickMailTab);
|
||||
ui.com_tab.btn_options.SetClick(OnClickSettingTab);
|
||||
|
||||
OnGameTab(mTabIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void OnClickShopTab()
|
||||
private void OnClickSignInTab()
|
||||
{
|
||||
OnGameTab(1);
|
||||
}
|
||||
@@ -130,11 +128,16 @@ namespace FlowerPower
|
||||
OnGameTab(2);
|
||||
}
|
||||
|
||||
private void OnClickPintuTab()
|
||||
private void OnClickMailTab()
|
||||
{
|
||||
OnGameTab(3);
|
||||
}
|
||||
|
||||
private void OnClickSettingTab()
|
||||
{
|
||||
OnGameTab(4);
|
||||
}
|
||||
|
||||
private void OnGameTab(object obj = null)
|
||||
{
|
||||
|
||||
@@ -149,9 +152,17 @@ namespace FlowerPower
|
||||
|
||||
private void OnChangeTab(int tabIndex)
|
||||
{
|
||||
ui.com_tab.btn_shop.cont_tab.selectedIndex = tabIndex == 1 ? 1 : 0;
|
||||
ui.com_tab.btn_main.cont_tab.selectedIndex = tabIndex == 2 ? 1 : 0;
|
||||
ui.com_tab.btn_pintu.cont_tab.selectedIndex = tabIndex == 3 ? 1 : 0;
|
||||
// ui.com_tab.cont_show.selectedIndex = tabIndex == 0 ? com_bottom.Show_mian : com_bottom.Show_show;
|
||||
ui.com_tab.btn_signin.cont_tab.selectedIndex = tabIndex == 1 ? btn_sign.Tab_select : btn_sign.Tab_normal;
|
||||
ui.com_tab.btn_main.cont_tab.selectedIndex = tabIndex == 2 ? btn_main.Tab_select : btn_main.Tab_normal;
|
||||
ui.com_tab.btn_mail.cont_tab.selectedIndex = tabIndex == 3 ? btn_mail.Tab_select : btn_mail.Tab_normal;
|
||||
ui.com_tab.btn_options.cont_tab.selectedIndex = tabIndex == 4 ? btn_options.Tab_select : btn_options.Tab_normal;
|
||||
|
||||
|
||||
// ui.com_tab.btn_sign.cont_tab.selectedIndex = tabIndex == 2 ? btn_todos.Tab_select : btn_todos.Tab_normal;
|
||||
// // ui.com_tab.btn_spin.cont_tab.selectedIndex = tabIndex == 1 ? btn_todos.Tab_select : btn_todos.Tab_normal;
|
||||
// ui.com_tab.btn_setting.cont_tab.selectedIndex = tabIndex == 5 ? btn_todos.Tab_select : btn_todos.Tab_normal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -170,17 +181,6 @@ namespace FlowerPower
|
||||
|
||||
private void OnClickTab(int tabIndex)
|
||||
{
|
||||
GGraph node = null;
|
||||
if (tabIndex == 1) {
|
||||
node = ui.com_tab.btn_shop.ani_click;
|
||||
} else if (tabIndex == 2) {
|
||||
node = ui.com_tab.btn_main.ani_click;
|
||||
} else {
|
||||
node = ui.com_tab.btn_pintu.ani_click;
|
||||
}
|
||||
var fx_logo = FXManager.Instance.SetFx<SkeletonAnimation>(node, Fx_Type.fx_click, ref closeCallback);
|
||||
fx_logo.state.SetAnimation(0, "animation", false);
|
||||
|
||||
if (mLastIndex == tabIndex)
|
||||
{
|
||||
return;
|
||||
@@ -188,31 +188,34 @@ namespace FlowerPower
|
||||
var isH5Tab = tabIndex == 5;
|
||||
if (mLastIndex == 1)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex == 2 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.TujianUI_Open : UICtrlMsg.TujianUI_Close, tabIndex == 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.MailUI_Open : UICtrlMsg.MailUI_Close, tabIndex == 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 4 ? UICtrlMsg.MenuUI_Open : UICtrlMsg.MenuUI_Close, tabIndex == 4 ? true : false);
|
||||
|
||||
|
||||
}
|
||||
else if (mLastIndex == 2)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MainUI_Close, tabIndex < 2 ? true : false);
|
||||
buygoldParam param = new buygoldParam() {
|
||||
isShow1 = false,
|
||||
is_in_game = false
|
||||
};
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.BuygoldUI_Open : UICtrlMsg.BuygoldUI_Close, param);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.TujianUI_Open : UICtrlMsg.TujianUI_Close, tabIndex == 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.SignInUI_Open : UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.MailUI_Open : UICtrlMsg.MailUI_Close, tabIndex == 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 4 ? UICtrlMsg.MenuUI_Open : UICtrlMsg.MenuUI_Close, tabIndex == 4 ? true : false);
|
||||
}
|
||||
else if (mLastIndex == 3)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.TujianUI_Close, true);
|
||||
buygoldParam param = new buygoldParam() {
|
||||
isShow1 = false,
|
||||
is_in_game = false
|
||||
};
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.BuygoldUI_Open : UICtrlMsg.BuygoldUI_Close, param);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MailUI_Close, tabIndex < 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.SignInUI_Open : UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex == 2 ? false : true);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 4 ? UICtrlMsg.MenuUI_Open : UICtrlMsg.MenuUI_Close, tabIndex == 4 ? true : false);
|
||||
}
|
||||
else if (mLastIndex == 4)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MenuUI_Close, true);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.SignInUI_Open : UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex == 2 ? false : true);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.MailUI_Open : UICtrlMsg.MailUI_Close, tabIndex == 3 ? false : true);
|
||||
|
||||
}
|
||||
|
||||
// uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex < 2 ? true : false);
|
||||
@@ -229,12 +232,12 @@ namespace FlowerPower
|
||||
else
|
||||
{
|
||||
//背景音乐
|
||||
AudioManager.Instance.PlayBGM(AudioConst.hallbgm);
|
||||
AudioManager.Instance.PlayBGM("hall_bgm");
|
||||
}
|
||||
|
||||
if (PreferencesMgr.Instance.IsLastH5Tab != isH5Tab)
|
||||
if (DataMgr.IsLastH5Tab.Value != isH5Tab)
|
||||
{
|
||||
PreferencesMgr.Instance.IsLastH5Tab = isH5Tab;
|
||||
DataMgr.IsLastH5Tab.Value = isH5Tab;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user