cocos creator js properties寫法


1)以下划線_開頭的變量,在編輯器中是不會顯示的

properties: {
        tipLabel:      cc.Label,
        _stateStr:     '',
        _progress:     0.0,
        _splash:       null,
        _isLoading:    false,
    },

2)數組的寫法

 properties: {

        //手里的牌,自能自己看到
        cardPrefab : cc.Node,
        //碰杠以及最后結算的牌
        outCardPrefab : cc.Node,

        handRoot: cc.Node,
        fetchRoot: cc.Node,
         //碰杠數組
        gpRoots:{
            default:[],
            type:cc.Node,
        },
    },

3)其他腳本的引用

 properties: {
        gameController: require("Xlch_GameController"),
        cardManager: require("Xlch_GameCardManager"),
        editBox:cc.EditBox,
    },

4)其他腳本的引用(數組)

 properties: {
        players: {
            default: [],
            type: require("Xlch_PlayerBase"),
        },
    },

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM