大约有 175 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0036 秒)
...场景.ls示例代码如下(这里我们直接修改GameUI类)。 ```typescript package script { import ui.test.TestSceneUI; import laya.d3.core.scene.Scene3D; import laya.d3.core.Camera; import laya.display.Stage; /** * 本示例采用非脚本的方式实现,而使用继承页面基类,实现...
来源: Laya2.0_文档 发布时间: 20210715
....transform.rotate(new Laya.Vector3(0, 0.9, 0)); obj.addComponent(BoxControlScript); //旋转方向与角度设置 //var vect = new Laya.Vector3(0,1,0); //每10毫秒旋转一次 //Laya.timer.loop(10,null,function(){ //obj.transform.rotate(vect,false,false); //}); })); })); })(this); class BoxControl...
来源: Laya_社区 发布时间: 20200611
...去做相机跟踪 代码如下: export default class test extends Laya.Script { strWorldRoot:Laya.Sprite; constructor() { super(); } cameraPlayerOffset:Laya.Point=new Laya.Point(18,0); cameraOffset:Laya.Point=new Laya.Point(180,570); onEnable(): void { ...
来源: Laya_社区 发布时间: 20231123
... { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { private skeleton: SpineSkeleton; private index: number = -1; public pageWidth: number; public pageHeight: number; onStart() { console.log("Game start"); Laya.loader.load("resources/res/spineboy-pma.skel", Loader.SPIN...
来源: Laya_社区 发布时间: 20230703
...聚光)影响的数量。 > 开启并且修改多光源渲染参数 ```typescript var config:Config3D = new Config3D(); //开启多光源 config.enbaleMultiLight = true; //设置最大光源数 config.maxLightCount = 16; Laya3D.init(750, 1334, config); ``` > 关闭多光源渲染 ```typescript var c...
来源: Laya2.0_文档 发布时间: 20210714
...示例: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Sprite }) public sprite: Laya.Sprite; private spine: Laya.Spine2DRenderNode; private index: number = -1; //组件被激活后执行,此时所有节点和组件均已创建...
来源: Laya3.0_文档 发布时间: 20250104
... regClass, property } = Laya; @regClass() export class Main extends Laya.Script { @property({ type: Laya.Sprite }) public player: Laya.Sprite; @property({ type: Laya.Sprite }) public joystick: Laya.Sprite; @property({ type: Laya.Sprite }) public map: Laya.Sp...
来源: Laya_社区 发布时间: 20251125
...块编译宏使用,上面的写法看着有点累,可以参考下: /*[IF-SCRIPT-BEGIN] _model = model; var SHAKE_THRESHOLD = 100; var last_update = 0; var x = y = z = last_x = last_y = last_z = 0;; var canShake = 1; if (__JS__('window.DeviceMotionEvent')){__JS__('window').addEventListener("devicem...
来源: Laya_社区 发布时间: 20160110
射线检测报错,outHitInfo.sprite3D=null; 代码: class SceneScript extends Laya.Script{ private ray : Laya.Ray; private hit: Laya.RaycastHit; private phasorSprite3D:Laya.PhasorSpriter3D; private camera : Laya.Camera; private scene: Laya.Scene; public _load(owner : any):void{ this.scene ...
来源: Laya_社区 发布时间: 20181020
... { regClass, property } = Laya; @regClass() export class Demo extends Laya.Script { spine: Laya.Spine2DRenderNode; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { // 加载Spine动画数据资源(json文件),注意一定...
来源: Laya3.0_文档 发布时间: 20251128