Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

官方绵羊案例中CollisionProxy脚本是什么意思呀

$
0
0

@758482981 写道:

function onCollisionEnter (other) {
this.realListener.onCollisionEnter(other);
}
function onCollisionStay (other) {
this.realListener.onCollisionStay(other);
}
function onCollisionExit (other) {
this.realListener.onCollisionExit(other);
}

cc.Class({
extends: cc.Component,

properties: {
    realListener: cc.Component
},

onLoad () {
    this.onCollisionEnter = null;
    this.onCollisionStay = null;
    this.onCollisionExit = null;
    if (this.realListener) {
        if (this.realListener.onCollisionEnter) {
            this.onCollisionEnter = onCollisionEnter;
        }
        if (this.realListener.onCollisionStay) {
            this.onCollisionStay = onCollisionStay;
        }
        if (this.realListener.onCollisionExit) {
            this.onCollisionExit = onCollisionExit;
        }
    }
}

});

帖子: 3

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>