大约有 148 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0048 秒)
...t Component = Laya.Component; import Nav2DAgent = Laya.Nav2DAgent; const { regClass, property } = Laya; @regClass() export class TestSprite extends Laya.Script { // 用于显示鼠标点击的位置 @property({ type: Laya.Sprite }) public hit: Sprite; private _temp: Sprite; private _allAgent: Nav2DA...
来源: Laya3.0_文档 发布时间: 20251010
...的 UniformBuffer 来优化渲染性能。 脚本代码如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //共享材质,用于合批 public batchMat: Laya.Material; //颜色数目 private _colorNums = 20; //精灵数目 private _spriteNums = 200; ...
来源: Laya3.0_文档 发布时间: 20251010
...像机添加了这个脚本。 (图6-2) 脚本的代码为: const { regClass, property } = Laya; @regClass() export class CameraMoveScript extends Laya.Script3D { /** @private */ protected _tempVector3: Laya.Vector3 = new Laya.Vector3(); protected lastMouseX: number = 0; protected lastMouseY: ...
来源: Laya3.0_文档 发布时间: 20251010
...代码如下: import { IndexRTBase } from "./IndexRT.generated"; const { regClass } = Laya; @regClass() export default class IndexRT extends IndexRTBase { onAwake(): void { //设置舞台设计宽高 Laya.stage.designWidth = 1080; Laya.stage.designHeight = 1920; //在引擎初始化之后改变舞...
来源: Laya3.0_文档 发布时间: 20251010
...角的移动,摄像机的位置也同步移动,代码如下: const { regClass, property } = Laya; @regClass() export default class CameraControll extends Laya.Script { @property( { type: Laya.Sprite3D } ) public target: Laya.Sprite3D; private camera: Laya.Camera; public distanceUp: number = 0....
来源: Laya3.0_文档 发布时间: 20251010
...以在脚本中监听到事件和参数了,脚本代码如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; constructor() { super(); } event1(p1:any, p2:any): void { console.log("event1",p1,p2); } } 在脚本中创建...
来源: Laya3.0_文档 发布时间: 20251118
...c.call(caller, item); } } pool.length = 0; } }; } 5.3 代码调用 const { regClass, property } = Laya; import { Particle3D } from "./Particle3D"; @regClass() export class Main extends Laya.Script { //粒子特效的路径 private filePath = "FireEffect"; onStart() { console.log("Game start"); //加...
来源: Laya3.0_文档 发布时间: 20251010
...c.call(caller, item); } } pool.length = 0; } }; } 5.3 代码调用 const { regClass, property } = Laya; import { Particle3D } from "./Particle3D"; @regClass() export class Main extends Laya.Script { //粒子特效的路径 private filePath = "FireEffect"; onStart() { console.log("Game start"); //加...
来源: Laya3.0_文档 发布时间: 20250104