How access component from node?

How access component from node?


Component usually accessed through node.getComponent(cc.Camera);
what if node have multiple cc.Camera components as node.getComponent(cc.Camera); return only one cc.Camera component then how to access all cc.Camera components ?


I just got the solution, Iterate through 'node._components’ and detect cc.Camera components


I would suggest to use component properties, and have references to both cameras.
properties: {
camera1: cc.Camera,
camera2: cc.Camera