112 lines
2.1 KiB
C#
112 lines
2.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Toolset.UI;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class CarouselMenuALL : MonoBehaviour
|
|
{
|
|
public Button sb_bt;//É豸
|
|
public Button bk_bt;//°å¿¨
|
|
public Button fs_bt;//·çÉÈ
|
|
public Button dc_bt;//µç³Ø
|
|
|
|
public CarouselMenu carouselMenu;
|
|
public Button left_bt;
|
|
public Button right_bt;
|
|
|
|
public List<GameObject> gameObjects;
|
|
|
|
public GameObject sb_game;
|
|
public GameObject bk_game;
|
|
public GameObject fs_game;
|
|
public GameObject dc_game;
|
|
|
|
private void Awake()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
init();
|
|
}
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
sb_bt.onClick.AddListener(() =>
|
|
{
|
|
sb_bt_onClick();
|
|
});
|
|
bk_bt.onClick.AddListener(() =>
|
|
{
|
|
bk_bt_onClick();
|
|
});
|
|
fs_bt.onClick.AddListener(() =>
|
|
{
|
|
fs_bt_onClick();
|
|
});
|
|
dc_bt.onClick.AddListener(() =>
|
|
{
|
|
dc_bt_onClick();
|
|
});
|
|
|
|
left_bt.onClick.AddListener(() =>
|
|
{
|
|
carouselMenu.Btn_Left(left_bt);
|
|
});
|
|
right_bt.onClick.AddListener(() =>
|
|
{
|
|
carouselMenu.Btn_Right(right_bt);
|
|
});
|
|
}
|
|
|
|
public void sb_bt_onClick()
|
|
{
|
|
gameObjects_cls();
|
|
sb_game.SetActive(true);
|
|
|
|
}
|
|
public void bk_bt_onClick()
|
|
{
|
|
gameObjects_cls();
|
|
bk_game.SetActive(true);
|
|
}
|
|
public void fs_bt_onClick()
|
|
{
|
|
gameObjects_cls();
|
|
fs_game.SetActive(true);
|
|
}
|
|
public void dc_bt_onClick()
|
|
{
|
|
gameObjects_cls();
|
|
dc_game.SetActive(true);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public void gameObjects_cls()
|
|
{
|
|
for (int i = 0; i < gameObjects.Count; i++)
|
|
{
|
|
gameObjects[i].SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void init()
|
|
{
|
|
sb_bt.Select();
|
|
sb_bt_onClick();
|
|
}
|
|
|
|
public void setCarouselMenu(CarouselMenu menu)
|
|
{
|
|
carouselMenu = menu;
|
|
}
|
|
}
|