// Learn TypeScript: // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html import BattleScene from "../scenes/BattleScene"; const { ccclass, property } = cc._decorator; @ccclass export default class TestBall extends cc.Component { //#region LIFE-CYCLE CALLBACKS: // onLoad () {} start() { } // update (dt) {} onBeginContact(contact: cc.PhysicsContact, selfCollider: cc.Collider, otherCollider: cc.Collider) { // cc.director.getScene().getChildByName('Canvas').getComponent(BattleScene).onTestBallCollision(contact, selfCollider, otherCollider); } onEndContact(contact: cc.PhysicsContact, selfCollider: cc.Collider, otherCollider: cc.Collider) { cc.director.getScene().getChildByName('Canvas').getComponent(BattleScene).onTestBallCollision(contact, selfCollider, otherCollider); } //#endregion //#region public method //#endregion //#region event //#endregion //#region private method //#endregion }