get object by name code example
Example 1: unity get object by name
function Update() { var enemy : GameObject = GameObject.Find("enemy"); //perform operations on enemy here}
Example 2: get object name javascript
var a = {
name:'a',
'light': 'good',
'dark' : {
name: 'dark',
'black': 'bad',
'gray' : 'not so bad'
}
}
// This way you can do
console.log(a.name,a.dark.name);