init
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "81826c88-7340-4d8e-8b68-6ca821520549",
|
||||
"files": [
|
||||
".jpg",
|
||||
".json"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "81826c88-7340-4d8e-8b68-6ca821520549@6c48a",
|
||||
"displayName": "yeshchina_1_cg",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "81826c88-7340-4d8e-8b68-6ca821520549",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "81826c88-7340-4d8e-8b68-6ca821520549@f9941",
|
||||
"displayName": "yeshchina_1_cg",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 996,
|
||||
"height": 1280,
|
||||
"rawWidth": 996,
|
||||
"rawHeight": 1280,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-498,
|
||||
-640,
|
||||
0,
|
||||
498,
|
||||
-640,
|
||||
0,
|
||||
-498,
|
||||
640,
|
||||
0,
|
||||
498,
|
||||
640,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
1280,
|
||||
996,
|
||||
1280,
|
||||
0,
|
||||
0,
|
||||
996,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-498,
|
||||
-640,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
498,
|
||||
640,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "81826c88-7340-4d8e-8b68-6ca821520549@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": false,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "81826c88-7340-4d8e-8b68-6ca821520549@6c48a"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,438 @@
|
||||
import { _decorator, instantiate, isValid, Label, Node, Prefab, Sprite } from 'cc';
|
||||
import { GButton } from '../../Main/Common/GButton';
|
||||
import AudioManager from '../../Main/Manager/AudioManager';
|
||||
import Utils from '../../Main/Common/Utils';
|
||||
import { ViewManager } from '../../Main/Manager/ViewManager';
|
||||
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
|
||||
import li_BaseView from '../../Main/Common/li_BaseView';
|
||||
import GameRootUI from '../../Main/Common/GameRootUI';
|
||||
import ResManager from '../../Main/Manager/ResManager';
|
||||
import HttpUnit from '../../Main/Common/HttpUnit';
|
||||
import { SDKManager } from '../../Main/Channel/SDKManager';
|
||||
import ScrollViewList from '../../Main/Common/ScrollViewList';
|
||||
import GameManager from '../../Main/Manager/GameManager';
|
||||
import { I_LevelConfig } from '../../Main/Config/CommonConfig';
|
||||
import SubManager from '../SubManager';
|
||||
import { ByteDanceSDK } from '../../Main/Channel/bdSDK';
|
||||
import GlobalValue from '../../Main/Common/GlobalValue';
|
||||
import PlayerDataManager from '../../Main/Manager/PlayerDataManager';
|
||||
import { E_AD_TARGET } from './TalkAdDialog';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//主界面
|
||||
@ccclass('Start_UI')
|
||||
export class Start_UI extends li_BaseView {
|
||||
@property(ScrollViewList)
|
||||
private Level_List: ScrollViewList = null
|
||||
@property(Prefab)
|
||||
private Level_Item: Prefab = null
|
||||
private itemClone: any = null
|
||||
|
||||
private _nodeTab: any = {};
|
||||
private _data;
|
||||
private levelData: I_LevelConfig[] = []; //关卡数据
|
||||
private curLevelIdx: number = 0; //当前关卡Idx
|
||||
|
||||
//----重写父类接口---------------------------------------
|
||||
onLoadCT() {
|
||||
this.registerListenner();
|
||||
Utils.parseNode(this.node, this._nodeTab)
|
||||
this.itemClone = instantiate(this.Level_Item)
|
||||
this.Level_List.setTemplateItem(this.itemClone)
|
||||
Utils.setString(this._nodeTab.labNpcName, "")
|
||||
Utils.setString(this._nodeTab.labNpcTalk, "")
|
||||
}
|
||||
openUIDataCT(data: any): void {
|
||||
this._data = data
|
||||
}
|
||||
|
||||
|
||||
registerListenner() {
|
||||
Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
|
||||
Utils.addInnerEL(InnerMsgCode.UI_Talk_Back, this, this.resiveTalkBack)
|
||||
Utils.addInnerEL(InnerMsgCode.UI_BD_Sidebar, this, this.resiveBDSidebar)
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
|
||||
GButton.BandClick(this._nodeTab.btnStart, this.onStartClick, this, 10002);
|
||||
GButton.BandClick(this._nodeTab.btnAddTZCount, this.onAddTZClick, this);
|
||||
GButton.BandClick(this._nodeTab.tzCountNode, this.onAddTZClick, this);
|
||||
GButton.BandClick(this._nodeTab.btnSetting, this.onSettingClick, this);
|
||||
GButton.BandClick(this._nodeTab.btnBDSidebar, this.onBDSidebarClick, this);
|
||||
GButton.BandClick(this._nodeTab.btnGM, this.onGMClick, this);
|
||||
|
||||
SDKManager.register_video_reward(this.node.uuid, (tag:number)=>{
|
||||
console.log("视频广告回调", tag)
|
||||
if (tag == 1) {
|
||||
// 加次数
|
||||
HttpUnit.ins.setUserAd({type:1}, (data) => {
|
||||
SubManager.ShowPrompt("观看视频成功,获得相亲次数")
|
||||
this.refreshXiangqinTicket()
|
||||
})
|
||||
}
|
||||
})
|
||||
SDKManager.register_share_reward(this.node.uuid, (tag:number)=>{
|
||||
console.log("分享回调", tag)
|
||||
if (tag == 1) {
|
||||
// 加次数
|
||||
HttpUnit.ins.setUserShare({type:1}, (data) => {
|
||||
SubManager.ShowPrompt("分享成功,获得相亲次数")
|
||||
this.refreshXiangqinTicket()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
AudioManager.I.PlayMusic(1, true) //背景乐
|
||||
GameRootUI.InitDisableOperUI(false)
|
||||
GameRootUI.InitCrossUI(false)
|
||||
this.setUIVisible(true)
|
||||
|
||||
//设置按钮
|
||||
if (GlobalValue.GMSwtitch) {
|
||||
this._nodeTab.btnSetting.active = true
|
||||
this._nodeTab.btnGM.active = true
|
||||
} else {
|
||||
this._nodeTab.btnSetting.active = false
|
||||
this._nodeTab.btnGM.active = false
|
||||
}
|
||||
|
||||
//抖音侧边栏
|
||||
this._nodeTab.btnBDSidebar.active = false
|
||||
if (SDKManager.isByteDance()) {
|
||||
this.refreshBdSidebarUI()
|
||||
ByteDanceSDK.CheckSidebarState((state) =>{
|
||||
if (state == true) {
|
||||
this.refreshBdSidebarUI()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//判断玩家权限是否已获取
|
||||
if (!HttpUnit.IsLogin()) {
|
||||
HttpUnit.ins.login((loginData) => {
|
||||
console.log("主界面: 获取授权并登录成功!")
|
||||
this.userInited()
|
||||
})
|
||||
} else {
|
||||
this.userInited()
|
||||
}
|
||||
|
||||
//判断是否需要显示引导
|
||||
this.resetGuide()
|
||||
this.checkGuide()
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//GM界面关闭消息
|
||||
resiveGMClose(data) {
|
||||
Utils.Log("收到GM界面关闭消息")
|
||||
}
|
||||
|
||||
//退出聊天消息
|
||||
resiveTalkBack(data) {
|
||||
Utils.Log("收到退出聊天消息")
|
||||
this.setUIVisible(true)
|
||||
this.refreshLevelList()
|
||||
HttpUnit.ins.getUserData((userData) => {
|
||||
this.refreshXiangqinTicket()
|
||||
})
|
||||
}
|
||||
|
||||
//抖音侧边栏消息
|
||||
resiveBDSidebar(data) {
|
||||
this.refreshBdSidebarUI()
|
||||
}
|
||||
|
||||
|
||||
//增加相亲次数
|
||||
private doAddXiangqinCnt(add:number = 1) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//显示主界面UI
|
||||
setUIVisible(vis: boolean) {
|
||||
this._nodeTab.UIRoot.active = vis
|
||||
}
|
||||
|
||||
//刷新抖音侧边栏按钮显示状态
|
||||
refreshBdSidebarUI() {
|
||||
if (!SDKManager.isByteDance()) {
|
||||
//不是抖音平台,不显示
|
||||
this._nodeTab.btnBDSidebar.active = false
|
||||
return
|
||||
}
|
||||
|
||||
let stage = ByteDanceSDK.SidebarState
|
||||
if (stage == 1) {
|
||||
//前往
|
||||
this._nodeTab.btnBDSidebar.active = true
|
||||
Utils.setString(this._nodeTab.labBDSidebar, "前往抖音侧边栏")
|
||||
} else if (stage == 2) {
|
||||
//领奖
|
||||
this._nodeTab.btnBDSidebar.active = true
|
||||
Utils.setString(this._nodeTab.labBDSidebar, "领取抖音侧边栏")
|
||||
} else {
|
||||
//版本不支持
|
||||
this._nodeTab.btnBDSidebar.active = false
|
||||
}
|
||||
}
|
||||
|
||||
//刷新玩家信息完毕
|
||||
userInited() {
|
||||
this.refreshSdkUI()
|
||||
this.refreshLevelList()
|
||||
this.refreshXiangqinTicket()
|
||||
}
|
||||
|
||||
//刷新剩余相亲次数
|
||||
private refreshXiangqinTicket() {
|
||||
let xqnum = HttpUnit.GetXiangqinTickets()
|
||||
let xqmax = HttpUnit.GetXiangqinMaxTickets()
|
||||
Utils.setString(this._nodeTab.labTZCount, xqnum + "/" + xqmax)
|
||||
Utils.setString(this._nodeTab.labBtnTZCount, "" + xqnum)
|
||||
}
|
||||
|
||||
//刷新关卡列表
|
||||
private refreshLevelList() {
|
||||
HttpUnit.ins.getLevelList((levelList) => {
|
||||
if (levelList) {
|
||||
GameManager.SetLevelCfg(levelList)
|
||||
this.levelData = levelList
|
||||
this.levelData.unshift({} as any) //在最前面插入一个占位数据,用于数组排版显示
|
||||
this.Level_List.numItems = this.levelData.length
|
||||
if (this.curLevelIdx < 1) {
|
||||
this.curLevelIdx = 1
|
||||
for (let i = 1; i < this.levelData.length; i++) {
|
||||
if (this.levelData[i].is_unlock == true) {
|
||||
if (this.curLevelIdx < i) {
|
||||
this.curLevelIdx = i
|
||||
}
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (this.curLevelIdx > 2) {
|
||||
this.Level_List.scrollTo(this.curLevelIdx-2)
|
||||
}
|
||||
}
|
||||
this.changeLevel(this.curLevelIdx, true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//刷新SDK相关的UI
|
||||
refreshSdkUI() {
|
||||
console.log("主界面:刷新SDK相关的UI...")
|
||||
SDKManager.getUserInfo((data) => {
|
||||
//头像
|
||||
let spt = this._nodeTab.headIcon.getComponent(Sprite)
|
||||
ResManager.I.changeRemoteSpriteFrame(spt, data.avatarUrl)
|
||||
//名字
|
||||
let nickName = this._nodeTab.nickName.getComponent(Label)
|
||||
nickName.string = data.nickName
|
||||
console.log("主界面 设置头像和名字:", data.avatarUrl, data.nickName)
|
||||
})
|
||||
//刷新id
|
||||
let id = HttpUnit.GetID()
|
||||
Utils.setString(this._nodeTab.userId, `ID:${id}`)
|
||||
}
|
||||
|
||||
|
||||
//关卡列表渲染
|
||||
onRenderItemList(node: any, idx: number) {
|
||||
if(!isValid(node)) {return}
|
||||
if (!node.inited) {
|
||||
node.inited = true;
|
||||
Utils.parseNode(node);
|
||||
}
|
||||
|
||||
GButton.RemoveClick(node)
|
||||
|
||||
//第一个是占位用的
|
||||
if (idx == 0) {
|
||||
node.l_rotateN.active = false
|
||||
node.zhanweiNode.active = true
|
||||
return
|
||||
}
|
||||
|
||||
node.l_rotateN.active = true
|
||||
node.zhanweiNode.active = false
|
||||
let data = this.levelData[idx]
|
||||
//头像
|
||||
let headPath = `headLevel/${data.icon}`
|
||||
ResManager.I.changeBundleSpriteFrame(node.head1.getComponent(Sprite), headPath, "Raw")
|
||||
//解锁状态
|
||||
node.lockNode.active = data.is_unlock ? false : true
|
||||
node.unlockNode.active = data.is_unlock ? true : false
|
||||
if (data.is_unlock) {
|
||||
//分数
|
||||
Utils.setString(node.labScore, data.score)
|
||||
//星级
|
||||
if (data.star == 3) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_11", "Zhujiemian")
|
||||
} else if (data.star == 2) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_10", "Zhujiemian")
|
||||
} else if (data.star == 1) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_9", "Zhujiemian")
|
||||
} else {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_8", "Zhujiemian")
|
||||
}
|
||||
//满星效果
|
||||
node.l_manxing.active = data.star == 3 ? true : false
|
||||
if (data.star == 3) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_bg.getComponent(Sprite), "zjm_6", "Zhujiemian")
|
||||
} else {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_bg.getComponent(Sprite), "zjm_5", "Zhujiemian")
|
||||
}
|
||||
}
|
||||
GButton.BandClick(node, ()=>{
|
||||
this.changeLevel(idx)
|
||||
}, this)
|
||||
}
|
||||
|
||||
|
||||
//切换关卡
|
||||
changeLevel(idx:number, force:boolean = false) {
|
||||
if (this.curLevelIdx == idx && !force) {
|
||||
return
|
||||
}
|
||||
this.curLevelIdx = idx
|
||||
let data = this.levelData[idx]
|
||||
//名字
|
||||
Utils.setString(this._nodeTab.labNpcName, data.characterName)
|
||||
//介绍
|
||||
Utils.setString(this._nodeTab.labNpcTalk, data.description)
|
||||
|
||||
let bgPath = data.bgImage
|
||||
let rolePath = data.characterFullLengthPortrait
|
||||
Utils.sendInnerMsg(InnerMsgCode.SceneLayerBgUp, {bgPath:bgPath, rolePath:rolePath})
|
||||
}
|
||||
|
||||
|
||||
//开始游戏
|
||||
onStartClick() {
|
||||
Utils.Log("点击开始游戏");
|
||||
|
||||
this.finishGuide()
|
||||
|
||||
if (this.curLevelIdx == 0) {
|
||||
console.error("当前关卡为0,此关卡是占位用的")
|
||||
return
|
||||
}
|
||||
let data = this.levelData[this.curLevelIdx]
|
||||
//未解锁
|
||||
if (data.is_unlock != true) {
|
||||
SubManager.ShowPrompt("关卡未解锁")
|
||||
return
|
||||
}
|
||||
|
||||
if (HttpUnit.GetXiangqinTickets() <= 0) {
|
||||
SubManager.ShowPrompt("今日相亲次数已用完");
|
||||
return;
|
||||
}
|
||||
|
||||
let level_id = data.id
|
||||
GameManager.CurLevelId = level_id
|
||||
GameManager.ClearStepScore()
|
||||
GameManager.ClearTalkRecord()
|
||||
HttpUnit.ins.levelStart({level_id:level_id}, (data) => {
|
||||
this.setUIVisible(false)
|
||||
GameManager.CurLevelData = data.level
|
||||
GameManager.RecordId = data.record_id
|
||||
GameManager.I.connetSorcket(data.record_id) //连接socket
|
||||
ViewManager.I.openBundlesView("UI/StartUI/Talk_UI")
|
||||
})
|
||||
}
|
||||
|
||||
//增加相亲次数
|
||||
onAddTZClick() {
|
||||
ViewManager.I.openBundlesView("UI/StartUI/TalkAdDialog", {
|
||||
type: E_AD_TARGET.xiangqin, //加相亲次数
|
||||
content: "每天只有 5 次相亲次数,请谨慎使用。分享游戏,观看广告都可以获得 3 次相亲次数奖励,该奖励每日限领一次,每日 5:00 刷新相亲次数以及奖励获取次数。",
|
||||
adCallback: ()=>{
|
||||
SDKManager.show_reward_video_ad(this.node.uuid, 1)
|
||||
},
|
||||
shareCallback: ()=>{
|
||||
SDKManager.show_reward_share(this.node.uuid, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//设置
|
||||
onSettingClick() {
|
||||
ViewManager.I.openBundlesView("UI/StartUI/Setting_UI")
|
||||
}
|
||||
|
||||
//gm
|
||||
onGMClick() {
|
||||
ViewManager.I.openBundlesView("UI/GM_UI")
|
||||
}
|
||||
|
||||
//点击抖音侧边栏按钮
|
||||
onBDSidebarClick() {
|
||||
if (!SDKManager.isByteDance()) {
|
||||
//不是抖音平台
|
||||
return
|
||||
}
|
||||
|
||||
ViewManager.I.openBundlesView("UI/StartUI/BDSidebar_UI")
|
||||
}
|
||||
|
||||
|
||||
//region 引导相关
|
||||
private _guideInterval: number = 0.5 //引导间隔
|
||||
//重置引导节点显示
|
||||
private resetGuide() {
|
||||
this._nodeTab.guideStep1.active = false
|
||||
this._nodeTab.guideStep2.active = false
|
||||
this._nodeTab.guideHandNode.active = false
|
||||
this._nodeTab.btnStart.parent = this._nodeTab.startParent1
|
||||
}
|
||||
//检查引导
|
||||
private checkGuide() {
|
||||
if (PlayerDataManager.I.GuideMainFinished) {
|
||||
return
|
||||
}
|
||||
this.doGuideStep1()
|
||||
}
|
||||
//引导步骤1 显示介绍弹窗
|
||||
private doGuideStep1() {
|
||||
GameRootUI.DisableOper(this._guideInterval)
|
||||
this.scheduleOnce(() => {
|
||||
this._nodeTab.guideStep1.active = true
|
||||
GButton.RemoveAndBandClick(this._nodeTab.btnGs1Ok, this.onGuide1OkClick, this);
|
||||
},this._guideInterval)
|
||||
|
||||
}
|
||||
//引导步骤2 显示手
|
||||
private doGuideStep2() {
|
||||
GameRootUI.DisableOper(this._guideInterval)
|
||||
this.scheduleOnce(() => {
|
||||
this._nodeTab.guideStep2.active = true
|
||||
this._nodeTab.guideHandNode.active = true
|
||||
this._nodeTab.btnStart.parent = this._nodeTab.startParent2
|
||||
},this._guideInterval)
|
||||
}
|
||||
//引导完成
|
||||
private finishGuide() {
|
||||
if (PlayerDataManager.I.GuideMainFinished) {
|
||||
return
|
||||
}
|
||||
PlayerDataManager.I.SetGuideMainFinish(true)
|
||||
this.resetGuide()
|
||||
}
|
||||
|
||||
onGuide1OkClick() {
|
||||
this._nodeTab.guideStep1.active = false
|
||||
this.doGuideStep2()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
import { _decorator, Component, instantiate, isValid, Label, Material, Node, Prefab, Sprite, tween, UIOpacity, v3 } from 'cc';
|
||||
import Utils from '../../Main/Common/Utils';
|
||||
import HXZ_ScrollViewList from '../../Main/Common/ScrollViewList';
|
||||
import GameManager from '../../Main/Manager/GameManager';
|
||||
import { I_HuiyiInfo } from '../../Main/Config/CommonConfig';
|
||||
import ResManager from '../../Main/Manager/ResManager';
|
||||
import { GButton } from '../../Main/Common/GButton';
|
||||
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
|
||||
import SubManager from '../SubManager';
|
||||
import HttpUnit from '../../Main/Common/HttpUnit';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**图鉴 - 私房珍藏 */
|
||||
@ccclass('tj_zhencang')
|
||||
export class tj_zhencang extends Component {
|
||||
|
||||
private itemClone!: any;
|
||||
@property(HXZ_ScrollViewList)
|
||||
Item_List: HXZ_ScrollViewList = null!; // 回忆列表
|
||||
@property(Prefab)
|
||||
Item_Temp: Prefab = null!;//被克隆的模板
|
||||
|
||||
private _nodeTab:any = {}
|
||||
private huiyiDataList: any[] = []
|
||||
private nextPage = 1 // 当前页数,每10个记录为一页
|
||||
|
||||
protected onLoad(): void {
|
||||
Utils.parseNode(this.node, this._nodeTab)
|
||||
|
||||
this.itemClone = instantiate(this.Item_Temp);
|
||||
this.Item_List.setTemplateItem(this.itemClone);
|
||||
|
||||
}
|
||||
start() {
|
||||
this._nodeTab.EmptyNode.active = false;
|
||||
this.getNextPage()
|
||||
|
||||
//已读红点 珍藏
|
||||
let isshow = HttpUnit.IsHaveZhencangRedpoint()
|
||||
if (isshow) {
|
||||
HttpUnit.ins.readRedpointZhencang({}, (data) => {
|
||||
if (data) {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
//刷新列表
|
||||
getNextPage() {
|
||||
HttpUnit.ins.getZhencangList({limit:10, page:this.nextPage, type:1}, (data) => {
|
||||
if (data) {
|
||||
if (data && data.data && data.data.length > 0) {
|
||||
this.nextPage++
|
||||
this.huiyiDataList = this.huiyiDataList.concat(data.data)
|
||||
let len = Math.ceil(this.huiyiDataList.length / 2);
|
||||
this.Item_List.numItems = len
|
||||
} else {
|
||||
if (this.nextPage == 1) {
|
||||
this._nodeTab.EmptyNode.active = true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//region 列表渲染
|
||||
onRenderItemList(node: any, idx: number) {
|
||||
if(!isValid(node)) {return}
|
||||
if (!node.inited) {
|
||||
node.inited = true;
|
||||
Utils.parseNode(node);
|
||||
|
||||
let opa1:UIOpacity = node.zcItem1.getComponent(UIOpacity)
|
||||
let opa2:UIOpacity = node.zcItem2.getComponent(UIOpacity)
|
||||
|
||||
opa1.opacity = 0
|
||||
tween(opa1)
|
||||
.delay(0.1)
|
||||
.to(0.2, {opacity: 255})
|
||||
.start()
|
||||
|
||||
opa2.opacity = 0
|
||||
tween(opa2)
|
||||
.delay(0.15)
|
||||
.to(0.2, {opacity: 255})
|
||||
.start()
|
||||
}
|
||||
|
||||
let startIdx = idx * 2
|
||||
this.refreshHuiyiCell(node.zcItem1, startIdx)
|
||||
this.refreshHuiyiCell(node.zcItem2, startIdx+1)
|
||||
|
||||
//翻到底部加载下一页
|
||||
if (idx >= this.huiyiDataList.length-1) {
|
||||
this.getNextPage()
|
||||
}
|
||||
}
|
||||
//刷新单个节点
|
||||
private refreshHuiyiCell(zcItem:any, idx:number) {
|
||||
let data = this.huiyiDataList[idx]
|
||||
if (!data) {
|
||||
zcItem.active = false
|
||||
return
|
||||
}
|
||||
zcItem.active = true
|
||||
if (!zcItem.inited) {
|
||||
zcItem.inited = true;
|
||||
Utils.parseNode(zcItem);
|
||||
}
|
||||
|
||||
|
||||
GButton.RemoveAndBandClick(zcItem, ()=>{
|
||||
Utils.sendInnerMsg(InnerMsgCode.UI_Tj_huiyi_Pic, {hyItem:zcItem, talk:"123"})
|
||||
}, this, 0, null, null, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "e67e8530-b047-4263-8fe7-0cf6d8a6c1a0",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "e67e8530-b047-4263-8fe7-0cf6d8a6c1a0@6c48a",
|
||||
"displayName": "maki_anna_stage_icon",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "e67e8530-b047-4263-8fe7-0cf6d8a6c1a0",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "e67e8530-b047-4263-8fe7-0cf6d8a6c1a0@f9941",
|
||||
"displayName": "maki_anna_stage_icon",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 174,
|
||||
"height": 174,
|
||||
"rawWidth": 174,
|
||||
"rawHeight": 174,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-87,
|
||||
-87,
|
||||
0,
|
||||
87,
|
||||
-87,
|
||||
0,
|
||||
-87,
|
||||
87,
|
||||
0,
|
||||
87,
|
||||
87,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
174,
|
||||
174,
|
||||
174,
|
||||
0,
|
||||
0,
|
||||
174,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-87,
|
||||
-87,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
87,
|
||||
87,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "e67e8530-b047-4263-8fe7-0cf6d8a6c1a0@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "e67e8530-b047-4263-8fe7-0cf6d8a6c1a0@6c48a"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
import { _decorator, instantiate, isValid, Label, Node, Prefab, Sprite } from 'cc';
|
||||
import { GButton } from '../../Main/Common/GButton';
|
||||
import AudioManager from '../../Main/Manager/AudioManager';
|
||||
import Utils from '../../Main/Common/Utils';
|
||||
import { ViewManager } from '../../Main/Manager/ViewManager';
|
||||
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
|
||||
import li_BaseView from '../../Main/Common/li_BaseView';
|
||||
import GameRootUI from '../../Main/Common/GameRootUI';
|
||||
import ResManager from '../../Main/Manager/ResManager';
|
||||
import HttpUnit from '../../Main/Common/HttpUnit';
|
||||
import { SDKManager } from '../../Main/Channel/SDKManager';
|
||||
import ScrollViewList from '../../Main/Common/ScrollViewList';
|
||||
import GameManager from '../../Main/Manager/GameManager';
|
||||
import { I_LevelConfig } from '../../Main/Config/CommonConfig';
|
||||
import SubManager from '../SubManager';
|
||||
import { ByteDanceSDK } from '../../Main/Channel/bdSDK';
|
||||
import GlobalValue from '../../Main/Common/GlobalValue';
|
||||
import PlayerDataManager from '../../Main/Manager/PlayerDataManager';
|
||||
import { E_AD_TARGET } from './TalkAdDialog';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//主界面
|
||||
@ccclass('Start_UI')
|
||||
export class Start_UI extends li_BaseView {
|
||||
@property(ScrollViewList)
|
||||
private Level_List: ScrollViewList = null
|
||||
@property(Prefab)
|
||||
private Level_Item: Prefab = null
|
||||
private itemClone: any = null
|
||||
|
||||
private _nodeTab: any = {};
|
||||
private _data;
|
||||
private levelData: I_LevelConfig[] = []; //关卡数据
|
||||
private curLevelIdx: number = 0; //当前关卡Idx
|
||||
|
||||
//----重写父类接口---------------------------------------
|
||||
onLoadCT() {
|
||||
this.registerListenner();
|
||||
Utils.parseNode(this.node, this._nodeTab)
|
||||
this.itemClone = instantiate(this.Level_Item)
|
||||
this.Level_List.setTemplateItem(this.itemClone)
|
||||
Utils.setString(this._nodeTab.labNpcName, "")
|
||||
Utils.setString(this._nodeTab.labNpcTalk, "")
|
||||
}
|
||||
openUIDataCT(data: any): void {
|
||||
this._data = data
|
||||
}
|
||||
|
||||
|
||||
registerListenner() {
|
||||
Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
|
||||
Utils.addInnerEL(InnerMsgCode.UI_Talk_Back, this, this.resiveTalkBack)
|
||||
Utils.addInnerEL(InnerMsgCode.UI_BD_Sidebar, this, this.resiveBDSidebar)
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
|
||||
GButton.BandClick(this._nodeTab.btnStart, this.onStartClick, this, 10002);
|
||||
GButton.BandClick(this._nodeTab.btnAddTZCount, this.onAddTZClick, this);
|
||||
GButton.BandClick(this._nodeTab.btnSetting, this.onSettingClick, this);
|
||||
GButton.BandClick(this._nodeTab.btnBDSidebar, this.onBDSidebarClick, this);
|
||||
GButton.BandClick(this._nodeTab.btnGM, this.onGMClick, this);
|
||||
|
||||
SDKManager.register_video_reward(this.node.uuid, (tag:number)=>{
|
||||
console.log("视频广告回调", tag)
|
||||
if (tag == 1) {
|
||||
// 加次数
|
||||
HttpUnit.ins.setUserAd({type:1}, (data) => {
|
||||
SubManager.ShowPrompt("观看视频成功,获得相亲次数")
|
||||
this.refreshXiangqinTicket()
|
||||
})
|
||||
}
|
||||
})
|
||||
SDKManager.register_share_reward(this.node.uuid, (tag:number)=>{
|
||||
console.log("分享回调", tag)
|
||||
if (tag == 1) {
|
||||
// 加次数
|
||||
HttpUnit.ins.setUserShare({type:1}, (data) => {
|
||||
SubManager.ShowPrompt("分享成功,获得相亲次数")
|
||||
this.refreshXiangqinTicket()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
AudioManager.I.PlayMusic(1, true) //背景乐
|
||||
GameRootUI.InitDisableOperUI(false)
|
||||
GameRootUI.InitCrossUI(false)
|
||||
this.setUIVisible(true)
|
||||
|
||||
//设置按钮
|
||||
if (GlobalValue.GMSwtitch) {
|
||||
this._nodeTab.btnSetting.active = true
|
||||
this._nodeTab.btnGM.active = true
|
||||
} else {
|
||||
this._nodeTab.btnSetting.active = false
|
||||
this._nodeTab.btnGM.active = false
|
||||
}
|
||||
|
||||
//抖音侧边栏
|
||||
this._nodeTab.btnBDSidebar.active = false
|
||||
if (SDKManager.isByteDance()) {
|
||||
this.refreshBdSidebarUI()
|
||||
ByteDanceSDK.CheckSidebarState((state) =>{
|
||||
if (state == true) {
|
||||
this.refreshBdSidebarUI()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//判断玩家权限是否已获取
|
||||
if (!HttpUnit.IsLogin()) {
|
||||
HttpUnit.ins.login((loginData) => {
|
||||
console.log("主界面: 获取授权并登录成功!")
|
||||
this.userInited()
|
||||
})
|
||||
} else {
|
||||
this.userInited()
|
||||
}
|
||||
|
||||
//判断是否需要显示引导
|
||||
this.resetGuide()
|
||||
this.checkGuide()
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//GM界面关闭消息
|
||||
resiveGMClose(data) {
|
||||
Utils.Log("收到GM界面关闭消息")
|
||||
}
|
||||
|
||||
//退出聊天消息
|
||||
resiveTalkBack(data) {
|
||||
Utils.Log("收到退出聊天消息")
|
||||
this.setUIVisible(true)
|
||||
this.refreshLevelList()
|
||||
HttpUnit.ins.getUserData((userData) => {
|
||||
this.refreshXiangqinTicket()
|
||||
})
|
||||
}
|
||||
|
||||
//抖音侧边栏消息
|
||||
resiveBDSidebar(data) {
|
||||
this.refreshBdSidebarUI()
|
||||
}
|
||||
|
||||
|
||||
//增加相亲次数
|
||||
private doAddXiangqinCnt(add:number = 1) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//显示主界面UI
|
||||
setUIVisible(vis: boolean) {
|
||||
this._nodeTab.UIRoot.active = vis
|
||||
}
|
||||
|
||||
//刷新抖音侧边栏按钮显示状态
|
||||
refreshBdSidebarUI() {
|
||||
if (!SDKManager.isByteDance()) {
|
||||
//不是抖音平台,不显示
|
||||
this._nodeTab.btnBDSidebar.active = false
|
||||
return
|
||||
}
|
||||
|
||||
let stage = ByteDanceSDK.SidebarState
|
||||
if (stage == 1) {
|
||||
//前往
|
||||
this._nodeTab.btnBDSidebar.active = true
|
||||
Utils.setString(this._nodeTab.labBDSidebar, "前往抖音侧边栏")
|
||||
} else if (stage == 2) {
|
||||
//领奖
|
||||
this._nodeTab.btnBDSidebar.active = true
|
||||
Utils.setString(this._nodeTab.labBDSidebar, "领取抖音侧边栏")
|
||||
} else {
|
||||
//版本不支持
|
||||
this._nodeTab.btnBDSidebar.active = false
|
||||
}
|
||||
}
|
||||
|
||||
//刷新玩家信息完毕
|
||||
userInited() {
|
||||
this.refreshSdkUI()
|
||||
this.refreshLevelList()
|
||||
this.refreshXiangqinTicket()
|
||||
}
|
||||
|
||||
//刷新剩余相亲次数
|
||||
private refreshXiangqinTicket() {
|
||||
let xqnum = HttpUnit.GetXiangqinTickets()
|
||||
Utils.setString(this._nodeTab.labTZCount, "今日剩余相亲次数:" + xqnum)
|
||||
Utils.setString(this._nodeTab.labBtnTZCount, "" + xqnum)
|
||||
}
|
||||
|
||||
//刷新关卡列表
|
||||
private refreshLevelList() {
|
||||
HttpUnit.ins.getLevelList((levelList) => {
|
||||
if (levelList) {
|
||||
GameManager.SetLevelCfg(levelList)
|
||||
this.levelData = levelList
|
||||
this.levelData.unshift({} as any) //在最前面插入一个占位数据,用于数组排版显示
|
||||
this.Level_List.numItems = this.levelData.length
|
||||
if (this.curLevelIdx < 1) {
|
||||
this.curLevelIdx = 1
|
||||
}
|
||||
this.changeLevel(this.curLevelIdx, true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//刷新SDK相关的UI
|
||||
refreshSdkUI() {
|
||||
console.log("主界面:刷新SDK相关的UI...")
|
||||
SDKManager.getUserInfo((data) => {
|
||||
//头像
|
||||
let spt = this._nodeTab.headIcon.getComponent(Sprite)
|
||||
ResManager.I.changeRemoteSpriteFrame(spt, data.avatarUrl)
|
||||
//名字
|
||||
let nickName = this._nodeTab.nickName.getComponent(Label)
|
||||
nickName.string = data.nickName
|
||||
console.log("主界面 设置头像和名字:", data.avatarUrl, data.nickName)
|
||||
})
|
||||
//刷新id
|
||||
let id = HttpUnit.GetID()
|
||||
Utils.setString(this._nodeTab.userId, `ID:${id}`)
|
||||
}
|
||||
|
||||
|
||||
//关卡列表渲染
|
||||
onRenderItemList(node: any, idx: number) {
|
||||
if(!isValid(node)) {return}
|
||||
if (!node.inited) {
|
||||
node.inited = true;
|
||||
Utils.parseNode(node);
|
||||
}
|
||||
|
||||
GButton.RemoveClick(node)
|
||||
|
||||
//第一个是占位用的
|
||||
if (idx == 0) {
|
||||
node.l_rotateN.active = false
|
||||
node.zhanweiNode.active = true
|
||||
return
|
||||
}
|
||||
|
||||
node.l_rotateN.active = true
|
||||
node.zhanweiNode.active = false
|
||||
let data = this.levelData[idx]
|
||||
//头像
|
||||
let headPath = `headLevel/${data.icon}`
|
||||
ResManager.I.changeBundleSpriteFrame(node.head1.getComponent(Sprite), headPath, "Raw")
|
||||
//解锁状态
|
||||
node.lockNode.active = data.is_unlock ? false : true
|
||||
node.unlockNode.active = data.is_unlock ? true : false
|
||||
if (data.is_unlock) {
|
||||
//分数
|
||||
Utils.setString(node.labScore, data.score)
|
||||
//星级
|
||||
if (data.star == 3) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_11", "Zhujiemian")
|
||||
} else if (data.star == 2) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_10", "Zhujiemian")
|
||||
} else if (data.star == 1) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_9", "Zhujiemian")
|
||||
} else {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_xingji.getComponent(Sprite), "zjm_8", "Zhujiemian")
|
||||
}
|
||||
//满星效果
|
||||
node.l_manxing.active = data.star == 3 ? true : false
|
||||
if (data.star == 3) {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_bg.getComponent(Sprite), "zjm_6", "Zhujiemian")
|
||||
} else {
|
||||
ResManager.I.changeBundleSpriteFrame(node.l_bg.getComponent(Sprite), "zjm_5", "Zhujiemian")
|
||||
}
|
||||
}
|
||||
GButton.BandClick(node, ()=>{
|
||||
this.changeLevel(idx)
|
||||
}, this)
|
||||
}
|
||||
|
||||
|
||||
//切换关卡
|
||||
changeLevel(idx:number, force:boolean = false) {
|
||||
if (this.curLevelIdx == idx && !force) {
|
||||
return
|
||||
}
|
||||
this.curLevelIdx = idx
|
||||
let data = this.levelData[idx]
|
||||
//名字
|
||||
Utils.setString(this._nodeTab.labNpcName, data.characterName)
|
||||
//介绍
|
||||
Utils.setString(this._nodeTab.labNpcTalk, data.description)
|
||||
|
||||
let bgPath = data.bgImage
|
||||
let rolePath = data.characterFullLengthPortrait
|
||||
Utils.sendInnerMsg(InnerMsgCode.SceneLayerBgUp, {bgPath:bgPath, rolePath:rolePath})
|
||||
}
|
||||
|
||||
|
||||
//开始游戏
|
||||
onStartClick() {
|
||||
Utils.Log("点击开始游戏");
|
||||
|
||||
this.finishGuide()
|
||||
|
||||
if (this.curLevelIdx == 0) {
|
||||
console.error("当前关卡为0,此关卡是占位用的")
|
||||
return
|
||||
}
|
||||
let data = this.levelData[this.curLevelIdx]
|
||||
//未解锁
|
||||
if (data.is_unlock != true) {
|
||||
SubManager.ShowPrompt("关卡未解锁")
|
||||
return
|
||||
}
|
||||
|
||||
if (HttpUnit.GetXiangqinTickets() <= 0) {
|
||||
SubManager.ShowPrompt("今日相亲次数已用完");
|
||||
return;
|
||||
}
|
||||
|
||||
let level_id = data.id
|
||||
GameManager.CurLevelId = level_id
|
||||
GameManager.ClearStepScore()
|
||||
GameManager.ClearTalkRecord()
|
||||
HttpUnit.ins.levelStart({level_id:level_id}, (data) => {
|
||||
this.setUIVisible(false)
|
||||
GameManager.CurLevelData = data.level
|
||||
GameManager.RecordId = data.record_id
|
||||
GameManager.I.connetSorcket(data.record_id) //连接socket
|
||||
ViewManager.I.openBundlesView("UI/StartUI/Talk_UI")
|
||||
})
|
||||
}
|
||||
|
||||
//增加相亲次数
|
||||
onAddTZClick() {
|
||||
ViewManager.I.openBundlesView("UI/StartUI/TalkAdDialog", {
|
||||
type: E_AD_TARGET.xiangqin, //加相亲次数
|
||||
content: "每天只有 5 次相亲次数,请谨慎使用。分享游戏,观看广告都可以获得 3 次相亲次数奖励,该奖励每日限领一次,每日 5:00 刷新相亲次数以及奖励获取次数。",
|
||||
adCallback: ()=>{
|
||||
SDKManager.show_reward_video_ad(this.node.uuid, 1)
|
||||
},
|
||||
shareCallback: ()=>{
|
||||
SDKManager.show_reward_share(this.node.uuid, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//设置
|
||||
onSettingClick() {
|
||||
ViewManager.I.openBundlesView("UI/StartUI/Setting_UI")
|
||||
}
|
||||
|
||||
//gm
|
||||
onGMClick() {
|
||||
ViewManager.I.openBundlesView("UI/GM_UI")
|
||||
}
|
||||
|
||||
//点击抖音侧边栏按钮
|
||||
onBDSidebarClick() {
|
||||
if (!SDKManager.isByteDance()) {
|
||||
//不是抖音平台
|
||||
return
|
||||
}
|
||||
|
||||
ViewManager.I.openBundlesView("UI/StartUI/BDSidebar_UI")
|
||||
}
|
||||
|
||||
|
||||
//region 引导相关
|
||||
private _guideInterval: number = 0.5 //引导间隔
|
||||
//重置引导节点显示
|
||||
private resetGuide() {
|
||||
this._nodeTab.guideStep1.active = false
|
||||
this._nodeTab.guideStep2.active = false
|
||||
this._nodeTab.guideHandNode.active = false
|
||||
this._nodeTab.btnStart.parent = this._nodeTab.startParent1
|
||||
}
|
||||
//检查引导
|
||||
private checkGuide() {
|
||||
if (PlayerDataManager.I.GuideMainFinished) {
|
||||
return
|
||||
}
|
||||
this.doGuideStep1()
|
||||
}
|
||||
//引导步骤1 显示介绍弹窗
|
||||
private doGuideStep1() {
|
||||
GameRootUI.DisableOper(this._guideInterval)
|
||||
this.scheduleOnce(() => {
|
||||
this._nodeTab.guideStep1.active = true
|
||||
GButton.RemoveAndBandClick(this._nodeTab.btnGs1Ok, this.onGuide1OkClick, this);
|
||||
},this._guideInterval)
|
||||
|
||||
}
|
||||
//引导步骤2 显示手
|
||||
private doGuideStep2() {
|
||||
GameRootUI.DisableOper(this._guideInterval)
|
||||
this.scheduleOnce(() => {
|
||||
this._nodeTab.guideStep2.active = true
|
||||
this._nodeTab.guideHandNode.active = true
|
||||
this._nodeTab.btnStart.parent = this._nodeTab.startParent2
|
||||
},this._guideInterval)
|
||||
}
|
||||
//引导完成
|
||||
private finishGuide() {
|
||||
if (PlayerDataManager.I.GuideMainFinished) {
|
||||
return
|
||||
}
|
||||
PlayerDataManager.I.SetGuideMainFinish(true)
|
||||
this.resetGuide()
|
||||
}
|
||||
|
||||
onGuide1OkClick() {
|
||||
this._nodeTab.guideStep1.active = false
|
||||
this.doGuideStep2()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "b7b1d9cf-afdf-496e-b041-5c38165b91cd",
|
||||
"files": [
|
||||
".jpg",
|
||||
".json"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "b7b1d9cf-afdf-496e-b041-5c38165b91cd@6c48a",
|
||||
"displayName": "mengli_0_cg",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "b7b1d9cf-afdf-496e-b041-5c38165b91cd",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "b7b1d9cf-afdf-496e-b041-5c38165b91cd@f9941",
|
||||
"displayName": "mengli_0_cg",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 996,
|
||||
"height": 1280,
|
||||
"rawWidth": 996,
|
||||
"rawHeight": 1280,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-498,
|
||||
-640,
|
||||
0,
|
||||
498,
|
||||
-640,
|
||||
0,
|
||||
-498,
|
||||
640,
|
||||
0,
|
||||
498,
|
||||
640,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
1280,
|
||||
996,
|
||||
1280,
|
||||
0,
|
||||
0,
|
||||
996,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-498,
|
||||
-640,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
498,
|
||||
640,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "b7b1d9cf-afdf-496e-b041-5c38165b91cd@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": false,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "b7b1d9cf-afdf-496e-b041-5c38165b91cd@6c48a"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Reference in New Issue
Block a user