Hello, i have just downloaded unity 3.0 and imported my old project into it.it updated my project and when it opened my project i had to attach my scripts back to all my objects. now the problem is on my main menu. the problem is i have entered this following line in to my script:
menuItems[MenuItem].OnSelected(true);
this line of code is just informing my game object to select the first menu item when the game loads. now in unity 2.6 this worked fine but as soon as downloaded 3.0 this error message keeps coming up:
Assets/Standard Assets/Scripts/MenuManager.js(14,21): BCE0019: 'OnSelected' is not a member of 'UnityEditor.MenuItem'.
CAN ANYONE PLEASE HELP ME
here is the script that is making the first object selectable:
var menuItems: MenuItem[];
var MySong: AudioClip;
var MySong2: AudioClip;
var currentMenuItem: int = 0;
var KeyDelay: float = 0.25;
function Start()
{
AudioSource.PlayClipAtPoint(MySong2,transform.position);
var lastMenuItem: int = currentMenuItem;
menuItems[MenuItem].OnSelected(true);
while(true)
{
if(Input.GetAxis("Vertical") > 0.9)
{
AudioSource.PlayClipAtPoint(MySong,transform.position);
lastMenuItem = currentMenuItem;
currentMenuItem--;
if(currentMenuItem < 0) currentMenuItem = 0;
if(lastMenuItem!= currentMenuItem)
menuItems[lastMenuItem].OnSelected(false);
menuItems[currentMenuItem].OnSelected(true);
yield new WaitForSeconds(KeyDelay);
}
else if(Input.GetAxis("Vertical") < -0.9)
{
AudioSource.PlayClipAtPoint(MySong,transform.position);
lastMenuItem = currentMenuItem;
currentMenuItem++;
if(currentMenuItem >= menuItems.length) currentMenuItem = menuItems.length - 1;
if(lastMenuItem!= currentMenuItem)
menuItems[lastMenuItem].OnSelected(false);
menuItems[currentMenuItem].OnSelected(true);
yield new WaitForSeconds(KeyDelay);
}
yield;
if (Input.GetAxis("NewGame")){
Application.LoadLevel (1);
}
}
}