• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 168 项符合查询结果, 库内数据总量为 30,897 项。 (搜索耗时: 0.0038 秒)

131. Cannot read property 'rayCast' of undefined [ 52%]

...operty 'rayCast' of undefined export default class indexscene extends Laya.Script { constructor(){ super(); this.rotation = new Laya.Vector3(0, 0.01, 0); this.point = new Laya.Vector2(); this.ray = new Laya.Ray(new Laya.Vector3(),new Laya.Vector3()); //1.开启第四个参数 let config3D = new Laya...

来源: Laya_社区 发布时间: 20200903

132. 引用外部脚本的方式 · LayaAir3.3 · 引擎文档 · LAYABOX [ 52%]

...一路回车。 package name:项目名字; version: 版本号; description: 对项目的描述; entry point: 项目的入口文件; test command:项目启动的时候要用什么命令来执行脚本文件; git repository:如果要将项目上传到git中的话,那么就需...

来源: Laya3.0_文档 发布时间: 20250214

133. 2.0版本可用的CameraMoveScript.ts [ 52%]

2.0版本可用的CameraMoveScript.ts 引擎源码:点这里仅仅给找不到这个文件,或者使用这个文件无效果的小伙伴,还原一个2.0,跟示例里效果一样的文件:   /** * ... * @author */ export class CameraMoveScript extends Laya.Script {      /** @private ...

来源: Laya_社区 发布时间: 20200707

134. 2D自由形态光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 52%]

...{ regClass } = Laya; @regClass() export class LightEffectDemo extends Laya.Script { declare owner: Laya.Sprite; private lightComp: Laya.FreeformLight2D; private rotateSpeed: number = 2; // 增加旋转速度 private scaleTime: number = 0; private scaleSpeed: number = 3; // 增加缩放速度 private...

来源: Laya3.0_文档 发布时间: 20250214

135. 2D精灵光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 52%]

...lass, property } = Laya; @regClass() export class SpriteLight extends Laya.Script { @property({type: Laya.Sprite}) private spriteLight: Laya.Sprite; @property({type: Laya.Sprite}) private directLight: Laya.Sprite; @property({type: Laya.Sprite}) private background: Laya.Sprite; //组件被启用后...

来源: Laya3.0_文档 发布时间: 20250214

136. 项目入口说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 51%]

...义组件脚本的基础使用流程 自定义的组件脚本继承自Laya.Script类,定义了组件的事件方法和自身生命周期方法。 动图2-1演示了如何给Scene2D节点添加自定义的组件脚本。在属性设置面板中,点击增加组件->新建组件脚本,然后...

来源: Laya3.0_文档 发布时间: 20250103

137. 动画实例在调用含有名字参数的时候获取不到边界 [ 51%]

...***136 • 2020-09-11 16:34 export default class Scene_Battle extends Laya.Script{ playerUnitReady:number; enemyUnitReady:number; private playerUnit:Laya.Animation[]; private enemyUnit:Laya.Animation[]; constructor(){ super(); Laya.stage.alignH= Laya.Stage.ALIGN_CENTER; Laya.stage.alignV = Laya.Stag...

来源: Laya_社区 发布时间: 20200910

138. 精灵 · LayaAir3.3 · 引擎文档 · LAYABOX [ 48%]

...代码: 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

139. TiledMap地图 · LayaAir3.3 · 引擎文档 · LAYABOX [ 47%]

... { 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.designWidth, Lay...

来源: Laya3.0_文档 发布时间: 20240910

140. 支付宝小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 47%]

...例如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake()...

来源: Laya3.0_文档 发布时间: 20250103