public void Update() { //按键检测 if (Input.GetKeyDown(KeyCode.LeftArrow) || JoyListener.UGetLeftDown) { LeftButton.OnSelected(true); OnButtinClicked(0); } if (Input.GetKeyDown(KeyCode.RightArrow) || JoyListener.UGetRightDown) { RightButton.OnSelected(true); OnButtinClicked(1); } if (Input.GetKeyUp(KeyCode.LeftArrow) || JoyListener.UGetLeftUp) { LeftButton.OnSelected(false); } if (Input.GetKeyUp(KeyCode.RightArrow) || JoyListener.UGetRightUp) { RightButton.OnSelected(false); } if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown("B") || Input.GetButtonDown("A")) { OnButtinClicked(2); } }
public void OnEnable() { Selected = false; YesBT.OnSelected(false); NoButton.OnSelected(true); YesBT.ButtinId = 0; NoButton.ButtinId = 1; }
public void OnEnable() { BackButton.ButtinId = 0; BackButton.OnSelected(true); }
// Use this for initialization void Start() { BackButton.ParentMenu = this; BackButton.OnSelected(true); BackButton.ButtinId = 0; }