收藏
回答

腾讯欢乐麻将是怎么把unity3d整合进cocos引擎的

框架类型 问题类型 终端类型 操作系统 微信版本 基础库版本
小游戏 需求 客户端 6.6.6 0

大家看下这个胡牌的代码片段,求指导


HupaiHandler: [function (d, c) {
    cc._RFpush(c, "cca7fAQXd1KmJau7QsGStIy", "HupaiHandler");
    "use strict";
    var a = cc.Class({
        "extends": d("MonoBehaviour"),
        properties: {XiaohuAniCompleteCallback: null, DahuAniCompleteCallback: null},
        onLoad: function () {
            this._super();
            this.transform || this.yf()
        },
        Fi: function (b, a, f) {
            var e;
            f === UserActionType.DianHu ? (e = UnityEngine.Object.Uc(UnityEngine.nd.md("Art/Effects/FX_UI01_Hu_02")),
                AudioController.wa().Ae("hu", b)) : (e = UnityEngine.Object.Uc(UnityEngine.nd.md("Art/Effects/FX_UI01_Zimo_02")), AudioController.wa().Ae("hu_zimo", b));
            var c = UnityEngine.GameObject.Find("UI Root");
            if (UnityEngine.Object.Ca(c, null))return 1;
            b = Util.Ik("Player" + b, c);
            if (UnityEngine.Object.Ca(b, null))return 1;
            Util.lN(b.X(), e.X());
            e.X().ub(UnityEngine.Va.GE().$clone());
            Log.Info("PlayWordEffect return", ModuleType.Game);
            return a ? f === UserActionType.DianHu ? (a = e.da(UnityEngine.Animation), a.getItem("FX_UI01_hu_02").gJ(2),
                a.Play("FX_UI01_hu_02"), .5) : f === UserActionType.Hu ? (a = e.da(UnityEngine.Animation), a.getItem("FX_UI01_Zimo_02").gJ(2), a.Play("FX_UI01_Zimo_02"), .5) : 1 : 1
        },
        qSa: function (b) {
            var a = UnityEngine.Object.Uc(UnityEngine.nd.md("Art/Effects/FX_Scene01_dianpao_02"));
            AudioController.wa().wc("chihushandian", AudioLayers.Oneshot);
            a.X().CR(new UnityEngine.Va.$ctor2(b.X().Pi().x, b.X().Pi().y + .02, b.X().Pi().z));
            a.ea(!0);
            Log.Info("PlayHuEffet return", ModuleType.Game);
            return 1.5
        },
        pSa: function (b, a, f, c) {
            void 0 === f && (f = 0);
            void 0 ===
            c && (c = 10);
            Device.GetInstance().gettype() > DeviceType.Low ? (b = f === MatchType.None ? this.Fi(b, !1, c) : this.Fi(b, !0, c), VPTimer.Xe(b, Bridge.fn.cacheBind(this, this.rSa), a)) : this.sZ()
        },
        rSa: function (b) {
            UnityEngine.Object.aa(b, null) && Device.GetInstance().gettype() > DeviceType.Low ? (b = this.qSa(b), VPTimer.Ib(b + 1, Bridge.fn.cacheBind(this, this.sZ))) : VPTimer.Ib(1, Bridge.fn.cacheBind(this, this.sZ))
        },
        x_b: function (b, a, f, c) {
            void 0 === f && (f = 0);
            void 0 === c && (c = 10);
            this.pSa(b, a, f, c)
        },
        sZ: function () {
            Log.Info("XiaoHuAniComplete",
                ModuleType.Game);
            Bridge.staticEquals(this.XiaohuAniCompleteCallback, null) || this.XiaohuAniCompleteCallback()
        },
        vgb: function () {
            Bridge.staticEquals(this.DahuAniCompleteCallback, null) || this.DahuAniCompleteCallback()
        }
    });
    window.HupaiHandler = a;
    cc._RFpop()
}, {MonoBehaviour: "MonoBehaviour"}],


回答关注问题邀请回答
收藏
登录 后发表内容