using System.Collections.Generic; using UnityEngine; public class UniKeyboard : MonoBehaviour { public KeyCodeCore mKeyCodeCore = new KeyCodeCore(); #region public UILongClickButton btnP1; public UILongClickButton btnCoin1; public UILongClickButton btnA; public UILongClickButton btnB; public UILongClickButton btnC; public UILongClickButton btnD; //public UILongClickButton btnE; //public UILongClickButton btnF; public UILongClickButton btnAB; public UILongClickButton btnCD; public UILongClickButton btnABC; public Transform tfKeyPad; public FloatingJoystick mJoystick; #endregion public List mUIBtns = new List(); void Awake() { mJoystick = GameObject.Find("tfJoystick").GetComponent(); tfKeyPad = GameObject.Find("tfKeyPad").transform; btnP1 = GameObject.Find("btnP1").GetComponent(); btnCoin1 = GameObject.Find("btnCoin1").GetComponent(); btnA = GameObject.Find("btnA").GetComponent(); btnB = GameObject.Find("btnB").GetComponent(); btnC = GameObject.Find("btnC").GetComponent(); btnD = GameObject.Find("btnD").GetComponent(); //btnE = GameObject.Find("btnE")?.GetComponent(); //btnF = GameObject.Find("btnF")?.GetComponent(); btnAB = GameObject.Find("btnAB").GetComponent(); btnCD = GameObject.Find("btnCD").GetComponent(); btnABC = GameObject.Find("btnABC").GetComponent(); mUIBtns.Add(btnP1); mUIBtns.Add(btnCoin1); mUIBtns.Add(btnA); mUIBtns.Add(btnB); mUIBtns.Add(btnC); mUIBtns.Add(btnD); mUIBtns.Add(btnAB); mUIBtns.Add(btnCD); mUIBtns.Add(btnABC); //if (btnE != null) //{ // mUIBtns.Add(btnE); // btnE.gameObject.SetActive(false); //} //else //{ // mUIBtns.Add(btnF); // btnF.gameObject.SetActive(false); //} #if UNITY_STANDALONE_WIN || UNITY_EDITOR tfKeyPad.gameObject.SetActive(false); #endif mKeyCodeCore.Init(this,false); } void OnEnable() { } void Update() { mKeyCodeCore.UpdateLogic(); } }