“Instantiate Template PlayCanvas” Kode Jawaban

Instantiate Template PlayCanvas

GameManager.prototype.initialize = function() {
    //instantiate template
    var templateAsset = this.app.assets.get(templateAssetId);
    var instance = templateAsset.resource.instantiate();
    this.app.root.addChild(instance);
};
SamuraiR4cc00n

Instantiate Template PlayCanvas

GameManager.attributes.add('player', { type: 'asset', assetType: 'template'});

GameManager.prototype.initialize = function() {
    //instantiate player
     var newPlayer = this.player.resource.instantiate();
     this.app.root.addChild(newPlayer);
};
SamuraiR4cc00n

Jawaban yang mirip dengan “Instantiate Template PlayCanvas”

Pertanyaan yang mirip dengan “Instantiate Template PlayCanvas”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya