[LayaAir 2.0]2.0里面的组件(Laya.Script)的prop其中几个类型应该怎么设置
								SNumber,Res,Runtime,Vec,Vector,ActionButton
这几个类型做测试都失败了,想问一下这几个类型改怎么使用,有没有范例
我这里提供一下其他的类型的范例供大家参考
 
																				这几个类型做测试都失败了,想问一下这几个类型改怎么使用,有没有范例
我这里提供一下其他的类型的范例供大家参考
export default class TestScript extends Laya.Script {
    /** @prop {name:intType, tips:"整数类型示例", type:Int, default:1000}*/
    public intType: number = 1000;
    /** @prop {name:numType, tips:"数字类型示例", type:Number, default:1000}*/
    public numType: number = 1000;
    /** @prop {name:strType, tips:"字符串类型示例", type:String, default:"hello laya"}*/
    public strType: string = "hello laya";
    /** @prop {name:boolType, tips:"布尔类型示例", type:Bool, default:true}*/
    public boolType: boolean = true;
    /** @prop {name:optionType, tips:"", type:Option, option:"aaa,bbb,true", default:"bbb"}*/
    public optionType:string = "bbb";
    
    //EditOption 貌似不能设置默认值
    /** @prop {name:editOptionType, tips:"", type:EditOption, option:"aaa,bbb,true", default:"bbb"}*/
    public editOptionType:string = "bbb";
    /** @prop {name:checkType, tips:"", type:Check}*/
    public checkType;
    /** @prop {name:colorType, tips:"", type:Color}*/
    public colorType;
    /** @prop {name:nodeType, tips:"", type:Node}*/
    public nodeType;
    /** @prop {name:prefabType, tips:"", type:Prefab}*/
    public prefabType;
    /** @prop {name:sizeGridType, tips:"", type:SizeGrid}*/
    public sizeGridType;
    /** @prop {name:colorArrayType, tips:"", type:ColorArray}*/
    public colorArrayType;
    
    /** @prop {name:nodesType, tips:"", type:Nodes}*/
    public nodesType;
    /** @prop {name:easeType, tips:"", type:Ease}*/
    public easeType;
    /** @prop {name:snumType, tips:"", type:SNumber, min:0, max:10, tick:1}*/
    // public snumType;
    /** @prop {name:resType, tips:"", type:Res}*/
    // public resType;
    /** @prop {name:runtimeType, tips:"", type:Runtime\}*/
    // public runtimeType;
    /** @prop {name:vecType, tips:"", type:Vec}*/
    // public vecType;
    /** @prop {name:vectorType, tips:"", type:Vector}*/
    // public vectorType;
    /** @prop {name:actionButtonType, tips:"", type:ActionButton}*/
    // public actionButtonType;
    
    
    constructor() { super(); }
    
    onEnable(): void {
    }
    onDisable(): void {
    }
}
															没有找到相关结果
									已邀请:
																	
							
2 个回复
Aar0n
赞同来自:
Aar0n
赞同来自:
public var abc:String = "";
文档没有明确表达出 使用方法,后续我们更新文档。