Ok, huge edit:
So I’ve been trying to convert my main menu from MouseOver to controller (gamepad) control for selecting choices. After a night of pulling my hair out, there’s been considerable progress, but haven’t quite gotten over the hump yet. Essentially the menu has three separate 3d text objects, each one with a unique (but similar) script. When object 1 is color - highlighted, the variables for objects 2 and three are false. When the directional pad is pressed, script 2 (attached to object 2) changes the variable for 1 to be false, while script 1 turns 2’s variable on. Those work fine, but when changing from 2 to 3 the color on three doesn’t change. I’m hoping that someone might be able to see what I’m doing wrong. I tried shutting off the variable for 2 in three, like I did for 1 in two, but that just prevents 2 from turning on. Here are the three scripts. Thanks for any guidance, and God bless.
Script 1:
var isQuitButton = false;
static var text1 = true;
renderer.material.color = Color.blue;
function Update () {
if(text1 == true)
if(Text2Control.text2 == false)
if(Text3Control.text3 == false)
if(Input.GetButtonDown("Action"))
Application.LoadLevel(3);
if(Input.GetAxis("Vertical"))
ColorOff();
}
function ColorOff()
{
renderer.material.color = Color.white;
//change the color of the text
Debug.Log(" script 1 is off");
Text2Control.text2 = true;
}
Script 2
static var text2 = false;
function Update () {
if(text2 == true)
if(TextControl.text1 == false)
if(Text3Control.text3 == false)
renderer.material.color = Color.blue;
if(Input.GetButtonDown("Action"))
Application.LoadLevel(2);
if(Input.GetAxis("Vertical"))
ColorOff();
}
function ColorOff()
{
renderer.material.color = Color.white;
Debug.Log(" script 2 is off");
//change the color of the text
TextControl.text1 = false;
}
function OnButtonDown()
{
if(Input.GetButtonDown("Action"))
{
Application.LoadLevel(3);
}
}
Script 3
static var text3 = false;
function Update () {
if(text3 == true)
if(TextControl.text1 == false)
if(Text2Control.text2 == false)
renderer.material.color = Color.blue;
if(Input.GetAxis("Vertical"))
ColorOff();
}
function ColorOff()
{
renderer.material.color = Color.white;
Debug.Log(" script 3 is off");
//change the color of the text
//Text2Control.text2 = false;
}
function OnButtonDown()
{
if(Input.GetButtonDown("Action"))
{
Application.LoadLevel(3);
}
}