public Poker(Transform _root, Vector3 _pos) { GameObject _go = DDZMain.Instantiate(ResourcesManage.dictionary["poker"] as GameObject); obj = _go; trans = _go.transform; trans.SetParent(_root); trans.localPosition = _pos; trans.localScale = Vector3.one; trans.localEulerAngles = Vector3.zero; img = obj.GetComponent <Image> (); UIEventListener.Get(_go).onClick = (g, e) => { if (!isClickEvent) { return; } SetSelectPoker(); }; UIEventListener.Get(_go).onDrag = (g, v, e) => { if (!isClickEvent) { return; } if (tempSelect) { tempSelect = false; SetSelectPoker(); } }; UIEventListener.Get(_go).onClickDown = (g, e) => { if (!isClickEvent) { return; } Tools.isLock = true; tempSelect = true; }; UIEventListener.Get(_go).onClickUp = (g, e) => { if (!isClickEvent) { return; } Tools.isLock = false; tempSelect = false; }; UIEventListener.Get(_go).onEnter = (g) => { if (!isClickEvent) { return; } if (Tools.isLock) { SetSelectPoker(); } }; Hide(); }
public static Sprite GetPokerSprite(int _id) { if (pokerImgs == null) { GameObject go = DDZMain.Instantiate(dictionary["pokerImg"] as GameObject); pokerImgs = go.transform; } try { return(pokerImgs.Find(_id.ToString()).GetComponent <SpriteRenderer>().sprite); } catch (System.Exception ex) { Debug.Log(ex.Message + " _id ==" + _id); throw; } }
void Awake() { ddzMain = this; this.UIInit(); UIGameOperPanel.Self.ShowGameStart(); }