Undefined when loading script

Hi guys, little question:
we have created a class from cc.Component

cc.MapNodeRef = cc.Class({
extends: cc.Component,

properties: {
    prev: {
        default: null,
        type: cc.Node
    },
    next: {
        default: null,
        type: cc.Node
    },      
    sprite: {
        default: null,
        type: cc.Sprite
    },
    id: {
        default: 1
    }
},

onLoad() {
    this.sprite.active = false;
}

});

and we used this class inside another class as like here:

cc.Class({
extends: cc.Component,

properties: {
   
   nodes: {
       default: [],
       type: [cc.MapNodeRef]
   }
},

});

after this, we have this ‘warning’:

The ‘type’ attribute of ‘mapManager.nodes’ is undefined when loading script.

Is it a trouble have this ‘warning’ when we release the game?

Thanks for help,

Stefano

maybe instead of

type: [cc.MapNodeRef]

use

type: cc.MapNodeRef

This part of documentation may help:
https://docs.cocos2d-x.org/creator/manual/en/scripting/execution-order.html

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.