Cocos Creator 3D开发入门----CocosCreator3D篮球.zip

上传者: ccnu027cs | 上传时间: 2021-09-13 11:03:32 | 文件大小: 1.06MB | 文件类型: ZIP
Cocos Creator 3D开发入门----CocosCreator3D篮球.zip


import { _decorator, Component, Node, RigidBodyComponent, PhysicMaterial, ColliderComponent } from "cc";
const { ccclass, property } = _decorator;

@ccclass("PhyMat")
export class PhyMat extends Component {

@property
private friction: number = 0; // 摩擦力

@property
private restitution: number = 0; // 弹力

/* class member could be defined like this */
// dummy = '';

/* use `property` decorator if your want the member to be serializable */
// @property
// serializableDummy = 0;

onLoad(): void{
let comps: Array = this.node.getComponents(ColliderComponent) as Array;

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.
// }
}

文件下载

资源详情

[{"title":"( 66 个子文件 1.06MB ) Cocos Creator 3D开发入门----CocosCreator3D篮球.zip","children":[{"title":"profiles","children":[{"title":"packages","children":[{"title":"scene.json <span style='color:#111;'> 1.50KB </span>","children":null,"spread":false},{"title":"assets.json <span style='color:#111;'> 503B </span>","children":null,"spread":false},{"title":"hierarchy.json <span style='color:#111;'> 271B </span>","children":null,"spread":false},{"title":"builder.json <span style='color:#111;'> 1.78KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"tsconfig.json <span style='color:#111;'> 150B </span>","children":null,"spread":false},{"title":"assets","children":[{"title":"scenes.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"scripts","children":[{"title":"PhyMat.ts.meta <span style='color:#111;'> 317B </span>","children":null,"spread":false},{"title":"PhyMat.ts <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false},{"title":"BallCtrl.ts.meta <span style='color:#111;'> 319B </span>","children":null,"spread":false},{"title":"BallCtrl.ts <span style='color:#111;'> 4.34KB </span>","children":null,"spread":false}],"spread":true},{"title":"res.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"GUI","children":[{"title":"mission_progress.png.meta <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false},{"title":"mission_progress.png <span style='color:#111;'> 773B </span>","children":null,"spread":false},{"title":"lv_bar.png <span style='color:#111;'> 338B </span>","children":null,"spread":false},{"title":"lv_bar.png.meta <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false}],"spread":true},{"title":"scene3D","children":[{"title":"basketball.jpg.meta <span style='color:#111;'> 969B </span>","children":null,"spread":false},{"title":"Goal.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"mats.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"plane.png.meta <span style='color:#111;'> 964B </span>","children":null,"spread":false},{"title":"Goal","children":[{"title":"GoalPost2.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"goal_base.mtl <span style='color:#111;'> 558B </span>","children":null,"spread":false},{"title":"GoalHoop.mtl <span style='color:#111;'> 528B </span>","children":null,"spread":false},{"title":"GoalPost2.mtl <span style='color:#111;'> 559B </span>","children":null,"spread":false},{"title":"Goal.fbx.meta <span style='color:#111;'> 2.92KB </span>","children":null,"spread":false},{"title":"GoalHoop.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"Backboard256.png.meta <span style='color:#111;'> 971B </span>","children":null,"spread":false},{"title":"Goal.fbx <span style='color:#111;'> 1.15MB </span>","children":null,"spread":false},{"title":"Goal_root.prefab <span style='color:#111;'> 29.52KB </span>","children":null,"spread":false},{"title":"GoalHoop.fbx <span style='color:#111;'> 2.83MB </span>","children":null,"spread":false},{"title":"goal_base.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"goalbord_mat.mtl <span style='color:#111;'> 561B </span>","children":null,"spread":false},{"title":"GoalHoop.fbx.meta <span style='color:#111;'> 2.53KB </span>","children":null,"spread":false},{"title":"Goal_root.prefab.meta <span style='color:#111;'> 228B </span>","children":null,"spread":false},{"title":"Backboard256.png <span style='color:#111;'> 2.66KB </span>","children":null,"spread":false},{"title":"goalbord_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false}],"spread":false},{"title":"test","children":[{"title":"ground-001.jpg.meta <span style='color:#111;'> 969B </span>","children":null,"spread":false},{"title":"test_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"target_mat.mtl <span style='color:#111;'> 530B </span>","children":null,"spread":false},{"title":"qrcode.mtl <span style='color:#111;'> 530B </span>","children":null,"spread":false},{"title":"target_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"target.jpg <span style='color:#111;'> 36.84KB </span>","children":null,"spread":false},{"title":"qrcode.jpg.meta <span style='color:#111;'> 965B </span>","children":null,"spread":false},{"title":"qrcode.jpg <span style='color:#111;'> 149.05KB </span>","children":null,"spread":false},{"title":"test_mat.mtl <span style='color:#111;'> 530B </span>","children":null,"spread":false},{"title":"ground.jpg.meta <span style='color:#111;'> 965B </span>","children":null,"spread":false},{"title":"ground-001.jpg <span style='color:#111;'> 89.84KB </span>","children":null,"spread":false},{"title":"qrcode.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"target.jpg.meta <span style='color:#111;'> 965B </span>","children":null,"spread":false},{"title":"ground.jpg <span style='color:#111;'> 25.71KB </span>","children":null,"spread":false}],"spread":false},{"title":"plane.png <span style='color:#111;'> 145.57KB </span>","children":null,"spread":false},{"title":"basketball.jpg <span style='color:#111;'> 12.84KB </span>","children":null,"spread":false},{"title":"mats","children":[{"title":"ball_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"ground_mat.mtl <span style='color:#111;'> 657B </span>","children":null,"spread":false},{"title":"ground_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"ball_mat.mtl <span style='color:#111;'> 559B </span>","children":null,"spread":false}],"spread":false},{"title":"test.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false}],"spread":true},{"title":"GUI.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"scene3D.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false}],"spread":true},{"title":"scenes","children":[{"title":"test.scene <span style='color:#111;'> 6.65KB </span>","children":null,"spread":false},{"title":"game.scene <span style='color:#111;'> 50.39KB </span>","children":null,"spread":false},{"title":"test.scene.meta <span style='color:#111;'> 227B </span>","children":null,"spread":false},{"title":"game.scene.meta <span style='color:#111;'> 227B </span>","children":null,"spread":false}],"spread":true},{"title":"scripts.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false}],"spread":true},{"title":"settings","children":[{"title":"packages","children":[{"title":"builder.json <span style='color:#111;'> 3B </span>","children":null,"spread":false},{"title":"project-setting.json <span style='color:#111;'> 145B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"package.json <span style='color:#111;'> 46B </span>","children":null,"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明