123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using UnityEngine;
- using UnityEngine.UI;
- namespace Mono
- {
- [UIBinding(prefab = "InputPanel")]
- public class InputPanel : UIPanel
- {
- public Button Btn_L;
- public Button Btn_R;
- public Button Btn_Start;
- public override void GetUIData()
- {
- Btn_L = UIData.Get<Button>("Btn_L");
- Btn_R = UIData.Get<Button>("Btn_R");
- Btn_Start = UIData.Get<Button>("Btn_Start");
- }
- public bool IsStart;
- public override void AddButtonEvent()
- {
- Btn_L.onClick.AddListener(() => { Player.Instance.MoveL(); });
- Btn_R.onClick.AddListener(() => { Player.Instance.MoveR(); });
- Btn_Start.onClick.AddListener(() =>
- {
- Btn_Start.gameObject.SetActive(false);
- Player.Instance.StartGame();
- });
- }
- public override void Show()
- {
- base.Show();
- CreatSceneAndPlayer();
- }
- public void CreatSceneAndPlayer()
- {
- GameObject prefab00 = Resources.Load<GameObject>("Game/Map");
- GameObject.Instantiate(prefab00);
- GameObject prefab01 = Resources.Load<GameObject>("Game/NPC");
- GameObject.Instantiate(prefab01);
- }
- public void GameOver()
- {
-
- }
- }
- }
|