大约有 178 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0038 秒)
...本。 > **脚本类**: ```typescript export default class MouseScript extends Laya.Script3D{ constructor(){super();} //物体必须拥有碰撞组件(Collider) //当被鼠标点击 onMouseDown(e){ //console.log("点击到了我box",owner.name); //从父容器销毁我自己 this.owner.removeS...
来源: Laya2.0_文档 发布时间: 20210715
...部代码如下所示: ```typescript export default class ImageRunTime extends Laya.Image{ constructor(){ super(); this.scaleTime = 100; //设置组件的中心点 this.anchorX = this.anchorY = 0.5; //添加鼠标按下事件侦听。按时时缩小按钮。 this.on(Laya.Event.MOUSE_DOWN,this,this...
来源: Laya2.0_文档 发布时间: 20210715
...st { regClass, property } = Laya; @regClass() export class TextAreaControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextArea } ) public txtarea: Laya.TextArea; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建...
来源: Laya3.0_文档 发布时间: 20251010
...{ regClass, property } = Laya; @regClass() export default class DirectMove extends Laya.Script { declare owner: Laya.Sprite3D; private characterController: Laya.CharacterController; onAwake(): void { // 获取 角色控制器 组件并赋值给 characterController this.characterController = this.own...
来源: Laya3.0_文档 发布时间: 20251010
...flash.display.StageScaleMode; import flash.events.Event; public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); this.stage.s...
来源: Laya_社区 发布时间: 20151106
... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Panel }) public panel: Laya.Panel; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.panel.pos(100, 100); t...
来源: Laya3.0_文档 发布时间: 20251010
...本。 > **脚本类**: ```typescript export default class MouseScript extends Laya.Script3D{ private meshsp:Laya.MeshSprite3D; constructor(){super();} /** * 覆写3D对象组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(){ this.meshsp ...
来源: Laya2.0_文档 发布时间: 20210715
... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.VBox }) public vbox: Laya.VBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.vbox.pos(100, 100); this....
来源: Laya3.0_文档 发布时间: 20251010
... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.HBox }) public hbox: Laya.HBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.hbox.pos(100, 100); this....
来源: Laya3.0_文档 发布时间: 20251010
... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Radio }) public radio: Laya.Radio; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.radio.skin = "atlas/co...
来源: Laya3.0_文档 发布时间: 20251010