大约有 178 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0060 秒)
...: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方...
来源: Laya3.0_文档 发布时间: 20251010
....addChild(this.text); } } //激活启动类 new Main(); class MonkeyScript extends Laya.Script3D{ private _scene:Laya.Scene3D; private _text:Laya.Text; private _camera:Laya.Camera; private rotation:Laya.Vector3; private lastPosition:Laya.Vector2; priva...
来源: Laya_社区 发布时间: 20190531
...ild(this.text); } } //激活启动类 new MultiTouch(); class MonkeyScript extends Laya.Script3D{ private _scene:Laya.Scene3D; private _text:Laya.Text; private _camera:Laya.Camera; private rotation:Laya.Vector3; private lastPosition:Laya.Vector2; priva...
来源: Laya_社区 发布时间: 20190605
...ipt /** * TypeScript语言的3D脚本示例 */ export default class TSDemo extends Laya.Script3D { constructor() { super(); } } ``` > 2D脚本与3D脚本不要混用,如果是用IDE创建的脚本模板,需要将继承的2D脚本类(Laya.Script)改为3D脚本类(Laya.Script3D), ###### ...
来源: Laya2.0_文档 发布时间: 20210715
...节点上添加2D拖尾渲染器的示例代码 */ export class NewScript extends Laya.Script { declare owner: Laya.Sprite; private _trail2D: Laya.Trail2DRender; //从场景文件中获取到的宽度曲线数据 private _widthCurve: any[]; //从场景文件中获取到的颜色渐变数据 private ...
来源: Laya3.0_文档 发布时间: 20251010
...错,这个时候借用下any吧,如: classA implements IA{ } classB extends classA{ } var items:IA = ; function(item:classB):void { //items.push(item);//报错,提示类型错误 //方案一 items.push(<any>item); //方案二 var temp:IA = <IA>item; items.push(temp); ...
来源: Laya_社区 发布时间: 20161109
...const { regClass, property } = Laya; @regClass() export class Mesh2DRender extends Laya.Script { @property({type: Laya.Sprite}) private layaMonkey: Laya.Sprite; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { Laya.loader.load("resources/layabox.png", Laya.Loader.IMA...
来源: Laya3.0_文档 发布时间: 20251120
....addChild(this.text); } } //激活启动类 new Main(); class MonkeyScript extends Laya.Script3D{ constructor(){ super(); this.scene = null; this.text = null; this.camera = null; this.lastPosition = new Laya.Vect...
来源: Laya_社区 发布时间: 20190531
...: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //共享材质,用于合批 public batchMat: Laya.Material; //颜色数目 private _colorNums = 20; //精灵数目 private _spriteNums = 200; private _createColorBufferData() { //随机给20个颜色值 ...
来源: Laya3.0_文档 发布时间: 20251010
...建,播放,暂停,销毁,清理对象池 export class Particle3D extends Sprite3D { private _isInited: boolean = false; private _filePath: string = null; private _particle: Laya.Sprite = null; private _shuriKenParticle3D: Array<ShuriKenParticle3D>= []; private _shurikenParticleSystem: ...
来源: Laya3.0_文档 发布时间: 20251010