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

上传者: ccnu027cs | 上传时间: 2022-04-19 10:39:24 | 文件大小: 83KB | 文件类型: ZIP
体育类游戏,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 = 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":"( 44 个子文件 83KB ) 体育类游戏,3D 足球射门 ,Cocos Creator 3D 实现,附源码Creator3D_football.zip","children":[{"title":"settings","children":[{"title":"packages","children":[{"title":"project-setting.json <span style='color:#111;'> 145B </span>","children":null,"spread":false},{"title":"builder.json <span style='color:#111;'> 3B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"tsconfig.json <span style='color:#111;'> 150B </span>","children":null,"spread":false},{"title":"package.json <span style='color:#111;'> 51B </span>","children":null,"spread":false},{"title":"assets","children":[{"title":"resources","children":[{"title":"mat.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"scenes","children":[{"title":"game.scene <span style='color:#111;'> 37.35KB </span>","children":null,"spread":false},{"title":"game.scene.meta <span style='color:#111;'> 227B </span>","children":null,"spread":false}],"spread":true},{"title":"mat","children":[{"title":"ground_mat.mtl <span style='color:#111;'> 530B </span>","children":null,"spread":false},{"title":"ball_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"net_left_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"net_top_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"net_left_mat.mtl <span style='color:#111;'> 688B </span>","children":null,"spread":false},{"title":"white_mat.mtl <span style='color:#111;'> 427B </span>","children":null,"spread":false},{"title":"net_top_mat.mtl <span style='color:#111;'> 690B </span>","children":null,"spread":false},{"title":"net_back_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"net_back_mat.mtl <span style='color:#111;'> 690B </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;'> 687B </span>","children":null,"spread":false},{"title":"white_mat.mtl.meta <span style='color:#111;'> 229B </span>","children":null,"spread":false}],"spread":false},{"title":"prefab","children":[{"title":"gate.prefab.meta <span style='color:#111;'> 228B </span>","children":null,"spread":false},{"title":"gate.prefab <span style='color:#111;'> 24.03KB </span>","children":null,"spread":false}],"spread":true},{"title":"scenes.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"res.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"ground.jpg.meta <span style='color:#111;'> 965B </span>","children":null,"spread":false},{"title":"net_w.png <span style='color:#111;'> 20.23KB </span>","children":null,"spread":false},{"title":"ground.jpg <span style='color:#111;'> 42.98KB </span>","children":null,"spread":false},{"title":"net_w.png.meta <span style='color:#111;'> 964B </span>","children":null,"spread":false},{"title":"net.png <span style='color:#111;'> 20.23KB </span>","children":null,"spread":false},{"title":"ball.png <span style='color:#111;'> 33.15KB </span>","children":null,"spread":false},{"title":"ball.png.meta <span style='color:#111;'> 963B </span>","children":null,"spread":false},{"title":"net.png.meta <span style='color:#111;'> 962B </span>","children":null,"spread":false}],"spread":true},{"title":"prefab.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false}],"spread":true},{"title":"scripts.meta <span style='color:#111;'> 207B </span>","children":null,"spread":false},{"title":"resources.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;'> 978B </span>","children":null,"spread":false},{"title":"Ball.ts <span style='color:#111;'> 2.15KB </span>","children":null,"spread":false},{"title":"Ball.ts.meta <span style='color:#111;'> 315B </span>","children":null,"spread":false},{"title":"Direct.ts <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"Direct.ts.meta <span style='color:#111;'> 317B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"profiles","children":[{"title":"packages","children":[{"title":"hierarchy.json <span style='color:#111;'> 125B </span>","children":null,"spread":false},{"title":"scene.json <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false},{"title":"assets.json <span style='color:#111;'> 321B </span>","children":null,"spread":false},{"title":"builder.json <span style='color:#111;'> 3B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • construct271828 :
    好东西, 下载了, 可以正常使用, 非常的不错
    2022-03-23

免责申明

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