大约有 10 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0047 秒)
...,使用Android Studio打开项目,在类JSBridge中添加下列函数: public static String testString(String value) { Log.d("JSBridge", "java: " + value); return "LayaBox"; } public static double testNumber(double value) { Log.d("JSBridge", "java: " + value); return 512; } public static boolean...
来源: Laya3.0_文档 发布时间: 20250422
... 在app/src/main/java/demo/HandleMessageUtils.java添加消息处理代码 public static String handleSyncMessage(String eventName, String data) { Log.d(LOG_TAG, eventName +" " + data); if (eventName.equals("syncMessage")) { return "sync message from platform"; } return "default sync result"; } publ...
来源: Laya3.0_文档 发布时间: 20251010
...() export class Script extends Laya.Script { //共享材质,用于合批 public batchMat: Laya.Material; //颜色数目 private _colorNums = 20; //精灵数目 private _spriteNums = 200; private _createColorBufferData() { //随机给20个颜色值 let colorBuffer = new Float32Array(20 * 4); for (v...
来源: Laya3.0_文档 发布时间: 20251010
...ort class NewScript extends Laya.Script { @property({ type: Laya.Button }) public uiBtn: Laya.Button; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.uiBtn.on(Laya.Event.CLICK, this, () =&g...
来源: Laya3.0_文档 发布时间: 20251010
... property } = Laya; @regClass() export class UI_List extends Laya.Script { public _list: Laya.List; constructor() { super(); } onAwake(): void { var list: Laya.List = new Laya.List(); list.itemRender = Item; list.repeatX = 1; list.repeatY = 4; list.x = (Laya.stage.width - Item.WID) / 2; list.y = (La...
来源: Laya3.0_文档 发布时间: 20251010
...ds Laya.Script { @property({ type : Laya.Node, inspector: "MyTestField" }) public node: Laya.Node; } 3、实际效果: 六、自定义面板 可以通过以下方式给编辑器增加一个面板 @IEditor.panel("test", { title: "Test", icon : "editorResources/20230710-161955.png" }) export class T...
来源: Laya3.0_文档 发布时间: 20251010
..."__InPool"; constructor() { } private static _instance: Pool = new Pool(); public static getInstance() { return this._instance; } //通过名字找到对应的对象池 getPoolBySign(sign:string): any { return this._poolDic[sign] || (this._poolDic[sign] = []); }; //回收 recover(sign:string, item:a...
来源: Laya3.0_文档 发布时间: 20251010
..."__InPool"; constructor() { } private static _instance: Pool = new Pool(); public static getInstance() { return this._instance; } //通过名字找到对应的对象池 getPoolBySign(sign:string): any { return this._poolDic[sign] || (this._poolDic[sign] = []); }; //回收 recover(sign:string, item:a...
来源: Laya3.0_文档 发布时间: 20250104
...arget: Laya.Sprite3D; @property({type:Laya.UI3D}) private ui3d: Laya.UI3D; public animator: Laya.Animator; onEnable() { // 广告牌模式 this.ui3d.billboard = true; //获得状态机 this.animator = this.target.getComponent<Laya.Animator>(Laya.Animator); } } 最后来看看运行效果: ...
来源: Laya3.0_文档 发布时间: 20251010
...HttpRequestExtension extends Laya.HttpRequest { constructor() { super(); } public send(url:string,data:any=null,method:string="get", responseType:string="text", headers:any=null):void{ super.send(url,data,method,responseType,headers); this._http.upload.onprogress= function(e:any):void { //上传进...
来源: Laya3.0_文档 发布时间: 20250104