体育类游戏,3D 足球射门 ,Cocos Creator 3D 实现,附源码Creator3D_football.zip

所需积分/C币:45 2019-12-13 09:29:44 83KB ZIP
34
收藏 收藏
举报

体育类游戏,3D 足球射门 ,Cocos Creator 3D 实现,附源码Creator3D_football.zip import { _decorator, Component, Node,ColliderComponent,PhysicMaterial } from "cc"; const { ccclass, property } = _decorator; @ccclass("PhyMat") export class PhyMat extends Component { @property private friction: number = 0; // 摩擦力 @property private restitution: number = 0; // 弹力 onLoad():void{ let comps: Array<ColliderComponent> = this.node.getComponents(ColliderComponent) as Array<ColliderComponent>; let mat = new PhysicMaterial(); mat.friction = this.friction; mat.restitution = this.restitution; for(let i = 0; i < comps.length; i++){ comps[i].material = mat; } } start () { // Your initialization goes here. } // update (deltaTime: number) { // // Your update function goes here. // } }

...展开详情
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
  • 签到新秀

    累计签到获取,不积跬步,无以至千里,继续坚持!
关注 私信 TA的资源
上传资源赚积分or赚钱
    最新推荐