咸鱼的反击
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

75 lines
2.6 KiB

// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import { ryw_Event } from "../../FrameWork/Event/EventEnum";
import EventMgr from "../../FrameWork/Event/EventMgr";
import User from "../../FrameWork/User/User";
import Common5 from "../../Platform/th/Common5";
import { MainTaskIdEnum } from "../JuQingChat/TaskManager";
const {ccclass, property} = cc._decorator;
@ccclass
export default class HuiJiaChaKan extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua,()=>{
this.roomStateChange()
},this)
this.roomStateChange2()
}
setAnim(node, anim, loop = false){
node.getComponent(sp.Skeleton).setAnimation(0,anim,loop)
}
roomStateChange2(){
let roomGoodStatus = User.getRoomGoodStatus()
if(roomGoodStatus >= 27){
this.node.getChildByName('妹妹').active = false
this.node.getChildByName('洛夕颜').active = false
}
let taskArray = User.getCurTaskId()
let taskId = taskArray[0]
if(taskId>=MainTaskIdEnum.MainTask_547){
this.node.getChildByName('妹妹站立').active = true
this.node.getChildByName('女正常').active = true
Common5.playRemoteSpine(this.node.getChildByName('妹妹站立'), 'Spine/roomSpine/妹妹站立', '妹妹站立','animation')
Common5.playRemoteSpine(this.node.getChildByName('女正常'),'Spine/roomSpine', '女','女待机')
}else if(taskId>=MainTaskIdEnum.MainTask_546){
this.node.getChildByName('妹妹站立').active = true
Common5.playRemoteSpine(this.node.getChildByName('妹妹站立'), 'Spine/roomSpine/妹妹站立', '妹妹站立','animation')
}
}
roomStateChange(){
let roomGoodStatus = User.getRoomGoodStatus()
if(roomGoodStatus >= 27){
User.setRoomGoodStatus(28)
this.node.getChildByName('妹妹').active = true
this.node.getChildByName('洛夕颜').active = true
this.setAnim( this.node.getChildByName('妹妹'),'妹妹瞬移')
this.setAnim(this.node.getChildByName('洛夕颜'),'洛夕颜瞬移')
}
}
// update (dt) {}
}