// Use this for initialization
void Start()
{
if (UILinkHandler != null)
{
UIHandler = UILinkHandler.GetComponent<UIScript>();
if (!UIHandler.hasStarted)
{
UIHandler.Start();
}
}
if (blueButtonItem != null)
{
blueButtonCommand = blueButtonItem.GetComponent<CommandParent>();
blueButtonCommand.LinkInput(Color.blue);
if (UILinkHandler != null)
UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_BLUE, blueButtonCommand);
}
if (redButtonItem != null)
{
redButtonCommand = redButtonItem.GetComponent<CommandParent>();
redButtonCommand.LinkInput(Color.red);
if (UILinkHandler != null)
UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_RED, redButtonCommand);
}
if (yellowButtonItem != null)
{
yellowButtonCommand = yellowButtonItem.GetComponent<CommandParent>();
yellowButtonCommand.LinkInput(Color.yellow);
if (UILinkHandler != null)
UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_YELLOW, yellowButtonCommand);
}
if (greenButtonItem != null)
{
greenButtonCommand = greenButtonItem.GetComponent<CommandParent>();
greenButtonCommand.LinkInput(Color.green);
if (UILinkHandler != null)
UIHandler.linkButton(UIScript.UI_BUTTON.BUTTON_GREEN, greenButtonCommand);
}
}