[add] Array<cc.Component.EventHandler> AddListener
This commit is contained in:
		@@ -14,8 +14,26 @@ declare interface Array<T> {
 | 
			
		||||
     * @param key 需排序的key(優先順序左到右)(沒有就放空)
 | 
			
		||||
     */
 | 
			
		||||
    ObjectSort(asc?: boolean[], key?: string[]): any[];
 | 
			
		||||
    /**
 | 
			
		||||
     * 設計給Array<cc.Component.EventHandler>使用
 | 
			
		||||
     * Add a non persistent listener to the UnityEvent.
 | 
			
		||||
     * @param call Callback function.
 | 
			
		||||
     */
 | 
			
		||||
    AddListener(call: Function): void;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Array.prototype.AddListener || Object.defineProperty(Array.prototype, "AddListener", {
 | 
			
		||||
    enumerable: false,
 | 
			
		||||
    value: function (call: Function): void {
 | 
			
		||||
        let EventHandler: cc.Component.EventHandler = new cc.Component.EventHandler();
 | 
			
		||||
        EventHandler.target = <any>"AddListener";
 | 
			
		||||
        EventHandler.component = "AddListener";
 | 
			
		||||
        EventHandler.handler = <any>call;
 | 
			
		||||
        this.push(EventHandler);
 | 
			
		||||
        console.log(`AddListener`);
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
Array.prototype.ExRemoveAt || Object.defineProperty(Array.prototype, "ExRemoveAt", {
 | 
			
		||||
    enumerable: false,
 | 
			
		||||
    value: function (index: number): any {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ declare namespace cc {
 | 
			
		||||
    export interface Node {
 | 
			
		||||
        /**
 | 
			
		||||
         * 設定世界座標
 | 
			
		||||
         * @param worldPoint 
 | 
			
		||||
         * @param worldPoint
 | 
			
		||||
         */
 | 
			
		||||
        SetWorldPosition(worldPoint: cc.Vec2): void;
 | 
			
		||||
        /**
 | 
			
		||||
@@ -12,7 +12,7 @@ declare namespace cc {
 | 
			
		||||
        GetWorldPosition(): cc.Vec2;
 | 
			
		||||
        /**
 | 
			
		||||
         * 設定長寬
 | 
			
		||||
         * @param size 
 | 
			
		||||
         * @param size
 | 
			
		||||
         */
 | 
			
		||||
        SetSizeDelta(size: cc.Vec2);
 | 
			
		||||
        /**
 | 
			
		||||
@@ -21,7 +21,7 @@ declare namespace cc {
 | 
			
		||||
        GetSizeDelta(): cc.Vec2;
 | 
			
		||||
        /**
 | 
			
		||||
         * 增加一個子物件
 | 
			
		||||
         * @param childObj 
 | 
			
		||||
         * @param childObj
 | 
			
		||||
         */
 | 
			
		||||
        ExAddChild(childObj: cc.Prefab | cc.Node, childActive?: boolean): cc.Node;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user