大约有 171 项符合查询结果, 库内数据总量为 30,897 项。 (搜索耗时: 0.0057 秒)
... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Sprite }) public sprite1: Laya.Sprite; @property({ type: Laya.Sprite }) public sprite2: Laya.Sprite; constructor() { super(); } /** * 组件被激活...
来源: Laya3.0_文档 发布时间: 20250103
...示例 const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { private tMap:Laya.TiledMap; onEnable() { //创建地图对象 this.tMap = new Laya.TiledMap(); //创建Rectangle实例,视口区域 var viewRect:Laya.Rectangle = new Laya.Rectangle(0, 0, Laya.stage.desi...
来源: Laya3.0_文档 发布时间: 20240910
...逻辑代码package game { import laya.display.Animation; public class Ani extends Animation { private var _isSlow:Boolean=true; public function Ani() { } public function get isSlow():Boolean { return _isSlow; } //isSlow:是否放慢速度 public function set isSlow(value:Boolean):void { _isSlow=v...
来源: Laya_社区 发布时间: 20161014
...所以绘制的图形也是在宽高范围内。 */ export class DrawLine extends Laya.Script { declare owner: Laya.Sprite; line2DRender: Laya.Line2DRender; lastMousePos: number[] = []; isDrawing: boolean = false; // 标记是否正在绘制 // 组件被激活后执行,此时所有节点和组件...
来源: Laya3.0_文档 发布时间: 20250214
...stLib"; const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { alert(testLib.nativeAdd(10, 11)); } } 因为LayaNative的扩展功能只支持Windows平台,所以只能通过Windows预览或发布为Windows项目才能得到正确的结果。运行效...
来源: Laya3.0_文档 发布时间: 20250214
... const { regClass, property } = Laya; @regClass() export class lightTest extends Laya.Script { declare owner: Laya.Sprite; @property({ type: Laya.Sprite }) light1: Laya.Sprite; @property({ type: Laya.Sprite }) mesh1: Laya.Sprite; @property({ type: Laya.Sprite }) mesh2: Laya.Sprite; private light1Ren...
来源: Laya3.0_文档 发布时间: 20250214
...发者可将脚本添加到2D场景中查看效果 */ export class Script extends Laya.Script { declare owner : Laya.Scene; area2D: Laya.Area2D; camera2D: Laya.Camera2D; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.creat...
来源: Laya3.0_文档 发布时间: 20250217
...直等于-1? -------------------------------- class RoleControlScript extends Laya.Script{ /*角色模型*/ public roleModel:Laya.Sprite3D; /*角色动画组件*/ public roleAni:Laya.Animator; /*角色当前动作*/ public currentAction:string = "stand"; /*角色动画是否完成*/ public aniCo...
来源: Laya_社区 发布时间: 20171113
...: /** * TypeScript语言的3D脚本示例 */ export default class TSDemo extends Laya.Script3D { constructor() { super(); } } 2D脚本与3D脚本不要混用,如果是用IDE创建的脚本模板,需要将继承的2D脚本类(Laya.Script)改为3D脚本类(Laya.Script3D), 添加物理...
来源: Laya3.0_文档 发布时间: 20250103
...: 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_文档 发布时间: 20250103