How I can create a Javascript object in a unity Script?

The examples that i've saw are well:

function office(city, country) { = city; = country;

This code, not works in Unity. The error is: city is not a member of MyScript

How I can create an object correctly?


For that, you'd need to name the script office, and add the variables to the class.

var city;
var country;

function office (city, country) { = city; = country;