![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CocosCreator3D
CocosCreator3D,TypeScript,功能脚本
橘长长长
这个人很懒,什么都留下了。
展开
-
CocosCreator3D 从相机位置发射射线
需要给被射线检测到的物体添加碰撞器,脚本挂载到相机即可import { _decorator, director, Component, Node, CanvasComponent, EventTouch, CameraComponent, ModelComponent, geometry, Touch, systemEvent, SystemEventType, PhysicsSystem, LabelComponent, Material } from "cc";import { BtnEven原创 2020-07-28 17:46:10 · 943 阅读 · 0 评论 -
CocosCreator3D鼠标拖拽相机旋转,第一人称旋转
直接挂载到相机即可//create by tengyunyangimport { _decorator, Component, math, UITransformComponent, EventTouch, Touch, Node, LabelComponent, CameraComponent, systemEvent } from "cc";const { ccclass, property } = _decorator;const { Vec2, Vec3, Quat } = math;原创 2020-07-28 17:42:29 · 2401 阅读 · 0 评论 -
CocosCreator3D Typescript事件系统
按钮事件: // 声明 @property(ButtonComponent) Btn: ButtonComponent | null = null; onLoad() { // 添加事件 this.BtnRigth.node.on('click', this.CallbackBtn, this);// 视景 } // 按钮具体功能 CallbackBtn(button: ButtonComponent) {原创 2020-07-28 17:38:00 · 560 阅读 · 0 评论