- Home /
4.6 UI Full controller support
So I have multiple canvas's in my scene and I can only have one first selected throughout all of the canvas's on one scene. I tried using:
using UnityEngine;
using UnityEngine.EventSystems;
using System.Collections;
public class FirstSelected : MonoBehaviour {
EventSystem eventSystem;
//public GameObject selected;
public GameObject gameObject;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
eventSystem.SetSelectedGameObject(gameObject);
}
}
but it didn't work correctly. Any ideas to help me achieve full UI controller support?
Dont think I fully understand exactly what your trying to do, do you mean like only 1 canvas becomes active and the others are hidden while that canvas is selected?
If so, then id put the canvas's into an array, and set them all up at design time, then in a loop, just turn off every canvas, then enable the canvas you want. $$anonymous$$aybe make a second variable to "remember" what canvas to enable from the array.
If that is wrong, could you please elaborate a little bit more?
Basically, lets say I have a canvas for pause with buttons and a canvas for options. I would like to press pause on controller to bring up the menu (I can do this) what I cant do is auto select the button so when I press down on controller, it will scroll through the buttons, also then when I press options, I cant interact with anything as nothing is selected
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
3 person controler. rotate and turn 0 Answers
Need help with controller script. 1 Answer
Animation Runtime Controller - Change through code? C# 0 Answers