123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- const {SenceMap} = require("../utils/GameEnum");
- var SenceManager = cc.Class({
- extends: cc.Component,
- properties: {
- myInfoTop: cc.Node,
- myTabBottom: cc.Node,
- friendInfoTop: cc.Node,
- friendTabBottom: cc.Node,
- },
- init (game) {
- this.game = game;
- this.levelHome = game.levelHome
- this.friendHome = game.friendHome
- this.userInfo = game.userInfo
- this.friendSystem = game.friendSystem
- this.breakOut = game.breakOut
- this.jobChange = game.jobChange
- this.finder = game.finder
- },
- onLoad () {
- this.ctx = cc.find("Canvas");
- },
- start() {
- },
- enterUserInfo (uid) {
- // this.ctx.getChildByName(SenceMap.LevelHome).active = true
- // Global.GameEvent.fire(NotiKey.ShowUserInfomation, uid);
- },
- /**
- * 进入好友家园
- * @param {Number} uid 用户id
- */
- enterFriendHome (uid) {
- this.friendHome.initFriend(uid, 1, res => {
- let actionTop = cc.moveBy(0.4, cc.v2(0, -this.friendInfoTop.height))
- this.friendInfoTop.runAction(actionTop)
-
- let actionBottom = cc.moveBy(0.4, cc.v2(0, this.friendTabBottom.height))
- this.friendTabBottom.runAction(actionBottom)
- this.friendHome.node.active = true;
- })
- },
- /**
- * 离开好友家园
- * @param {Number} uid 用户id
- */
- outFriendHome (uid) {
- let actionTop = cc.moveBy(0.4, cc.v2(0, this.friendInfoTop.height))
- this.friendInfoTop.runAction(actionTop)
- let actionBottom = cc.moveBy(0.4, cc.v2(0, -this.friendTabBottom.height))
- this.friendTabBottom.runAction(actionBottom)
- this.friendHome.node.active = false;
- },
- /**
- * 进入我的家园
- */
- enterLevelHome () {
- let actionTop = cc.moveBy(0.4, cc.v2(0, -this.myInfoTop.height))
- this.myInfoTop.runAction(actionTop)
- let actionBottom = cc.moveBy(0.4, cc.v2(0, this.myTabBottom.height + 6))
- this.myTabBottom.runAction(actionBottom)
- this.levelHome.node.active = true;
- },
- /**
- * 离开我的家园
- */
- outLevelHome () {
- let actionTop = cc.moveBy(0.4, cc.v2(0, this.myInfoTop.height))
- this.myInfoTop.runAction(actionTop)
- let actionBottom = cc.moveBy(0.4, cc.v2(0, -(this.myTabBottom.height + 6)))
- this.myTabBottom.runAction(actionBottom)
- },
-
- enterSence (lastSenceName, senceName) {
- this.node.getChildByName(lastSenceName).active = false;
- this.node.getChildByName(senceName).active = true;
- switch (senceName) {
- case SenceMap.LevelHome:
-
- break;
- case SenceMap.UserPanel:
-
- break;
- case SenceMap.FriendSystem:
-
- break;
- case SenceMap.FriendHome:
-
- break;
- case SenceMap.BreakOut:
-
- break;
- case SenceMap.Finder:
-
- break;
- default:
- break;
- }
- },
- });
- module.exports.SenceManager = SenceManager;
|