public override void mAwake() { base.mAwake(); name_text = transform.Find("name").GetComponent <Text>(); EventTrigger.Get(gameObject).onClick = delegate(GameObject game) { Close(); }; LabelParent = transform.Find("Grid"); }
private void Awake() { mMask = transform.Find("Mask").gameObject; mContent = transform.Find("Content"); //遮罩事件 EventTrigger.Get(mMask).onClick = (obj) => { //那所有色块反过来 SetAllBlockState(true); //隐藏遮罩 mMask.SetActive(false); }; //获取所有色块 for (int idx = 0; idx < mContent.childCount; idx++) { Transform tmpBlock = mContent.Find(idx.ToString()); //先隐藏吧 //tmpBlock.gameObject.SetActive(false); blockList.Add(tmpBlock); blockState.Add(tmpBlock, false); //注册回调函数 EventTrigger.Get(tmpBlock.gameObject).onClick = (obj) => { ClickBlock(obj, blockList.IndexOf(obj.transform)); }; } //读取配置表数据 playData = PlayDataConfig.Instance.GetDataByID(GetPlayID()); }
private void Awake() { weChatBtn = transform.Find("WechatButton").gameObject; QQBtn = transform.Find("QQButton").gameObject; EventTrigger.Get(weChatBtn).onClick = ClickWeChat; EventTrigger.Get(QQBtn).onClick = ClickQQ; }
public override void mAwake() { base.mAwake(); errorText = transform.Find("message").GetComponent <Text>(); button = transform.Find("Button").gameObject; button.GetComponent <Button>().onClick.AddListener(delegate() { Close(); }); EventTrigger.Get(gameObject).onDown = (GameObject g) => { Close(); }; }
private void Awake() { //按钮事件 EventTrigger.Get(transform.Find("ButtonList/Home").gameObject).onClick = ClickHome; EventTrigger.Get(transform.Find("ButtonList/Level").gameObject).onClick = ClickLevel; EventTrigger.Get(transform.Find("ButtonList/Friend").gameObject).onClick = ClickFriend; EventTrigger.Get(transform.Find("ButtonList/Task").gameObject).onClick = ClickTask; EventTrigger.Get(transform.Find("ButtonList/More").gameObject).onClick = ClickMore; }
public IconItem(GameObject game, Action <IconItem> Click) { this.Click = Click; this.game = game; kuangImage = Find <Image>("kuang"); selectedImage = Find <Image>("selected"); iconImage = Find <Image>("icon"); nameText = Find <Text>("name"); EventTrigger.Get(game).onDown = OnClick; }
public override void mAwake() { base.mAwake(); moneyText = transform.Find("money/money/Text").GetComponent <Text>(); weightText = transform.Find("money/weight/Text").GetComponent <Text>(); buttonAty = new List <GameObject>(); foreach (Transform item in transform.Find("button")) { buttonAty.Add(item.gameObject); EventTrigger.Get(item.gameObject).onClick = (GameObject game) => { OnClick(game.name); }; } }
private void Awake() { //按钮回调 //体力+ EventTrigger.Get(transform.Find("Energy/Add").gameObject).onClick = ClickEnergyAdd; //钻石+ EventTrigger.Get(transform.Find("Gems/Add").gameObject).onClick = ClickGemsAdd; //等级 EventTrigger.Get(transform.Find("PlayerInfo/Level").gameObject).onClick = ClickLevel; //熟练度 EventTrigger.Get(transform.Find("PlayerInfo/Proficiency").gameObject).onClick = ClickProficiency; //开战 EventTrigger.Get(transform.Find("StartButton").gameObject).onClick = ClickStart; }
public override void OnOpen() { base.OnOpen(); //表情包 emoji_data[] emojiDatas = EmojiDataConfig.Instance.GetAllData(); emojiViewList.totalCount = emojiDatas.Length; emojiViewList.RegisterInitCallback((Transform obj, int index) => { Function.SetImageSprite(obj.Find("Image").GetComponent <Image>(), emojiDatas[index].Icon); EventTrigger.Get(obj.gameObject).onClick = (cObj) => { TipsManager.ShowTips(Language.GetTextByKey(1)); }; }); emojiViewList.RefillCells(); }
static int Get(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject)); EventTrigger o = EventTrigger.Get(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void Awake() { mContent3x3 = transform.Find("Content3x3"); mContent4x4 = transform.Find("Content4x4"); //获取所有色块 for (int idx = 0; idx < mContent3x3.childCount; idx++) { blockID3x3[idx] = idx; Transform tmpBlock = mContent3x3.Find(idx.ToString()); //先隐藏吧 blockList3x3.Add(tmpBlock); //注册回调函数 EventTrigger.Get(tmpBlock.gameObject).onClick = (obj) => { ClickBlock(3, obj, blockList3x3.IndexOf(obj.transform)); }; } for (int idx = 0; idx < mContent4x4.childCount; idx++) { blockID4x4[idx] = idx; Transform tmpBlock = mContent4x4.Find(idx.ToString()); //先隐藏吧 blockList4x4.Add(tmpBlock); //注册回调函数 EventTrigger.Get(tmpBlock.gameObject).onClick = (obj) => { ClickBlock(4, obj, blockList4x4.IndexOf(obj.transform)); }; } //读取配置表数据 playData = PlayDataConfig.Instance.GetDataByID(GetPlayID()); //读取所有颜色 allColor = new Color[playData.Param5.Count / 4]; for (int i = 0; i < playData.Param5.Count; i += 4) { allColor[i / 4] = (new Color(playData.Param5[i], playData.Param5[i + 1], playData.Param5[i + 2], playData.Param5[i + 3]) / 255f); } }
private void Awake() { mMask = transform.Find("Mask").gameObject; mContent = transform.Find("Content"); //获取所有色块 for (int idx = 0; idx < mContent.childCount; idx++) { Transform tmpBlock = mContent.Find(idx.ToString()); //先隐藏吧 tmpBlock.gameObject.SetActive(false); blockList.Add(tmpBlock); //注册回调函数 EventTrigger.Get(tmpBlock.gameObject).onClick = (obj) => { obj.transform.GetComponent <Flashing>().Play(() => { ClickBlock(obj, blockList.IndexOf(obj.transform)); }); }; } //读取配置表数据 playData = PlayDataConfig.Instance.GetDataByID(GetPlayID()); }