Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        EventTriggerListener.Get(ShootBtn.gameObject).onClick   = OnButtonClick;
        EventTriggerListener.Get(JumpBtn.gameObject).onClick    = OnButtonClick;
        EventTriggerListener.Get(GrenadeBtn.gameObject).onClick = OnButtonClick;

        EventTriggerListener.Get(ShootBtn.gameObject).onDown   = OnButtonDown;
        EventTriggerListener.Get(JumpBtn.gameObject).onDown    = OnButtonDown;
        EventTriggerListener.Get(GrenadeBtn.gameObject).onDown = OnButtonDown;

        EventTriggerListener.Get(ShootBtn.gameObject).onPress   = OnButtonPress;
        EventTriggerListener.Get(JumpBtn.gameObject).onPress    = OnButtonPress;
        EventTriggerListener.Get(GrenadeBtn.gameObject).onPress = OnButtonPress;

        EventTriggerListener.Get(ShootBtn.gameObject).onUp   = OnButtonUp;
        EventTriggerListener.Get(JumpBtn.gameObject).onUp    = OnButtonUp;
        EventTriggerListener.Get(GrenadeBtn.gameObject).onUp = OnButtonUp;
    }
Exemplo n.º 2
0
    public static void addButtonClickEffect(Button button)
    {
        if (button.transition == Selectable.Transition.ColorTint || button.transition == Selectable.Transition.None)
        {
            GameObject btn = button.gameObject;
            EventTriggerListener.Get(btn).onDown = (bt) =>
            {
                bt.transform.DOKill();
                bt.transform.DOScale(((Vector3)PPP.getPropertyOriginal(bt.transform, "localScale")) * 0.9f, 0.1f);
            };

            EventTriggerListener.Get(btn).onUp = (bt) =>
            {
                bt.transform.DOKill();
                bt.transform.DOScale((Vector3)PPP.getPropertyOriginal(bt.transform, "localScale"), 0.1f);
            };
        }
    }
Exemplo n.º 3
0
        public UIShareChangeItem(GameObject go)
        {
            _lbcode = go.GetComponentEx<Text> (go.name);
            _lbsharename = go.GetComponentEx<Text> (Layout.lb_sharename);
            _lbsharepay = go.GetComponentEx<Text> (Layout.lb_sharepay);
            _lbcurrentprise = go.GetComponentEx<Text> (Layout.lb_currentPrice);
            _lbsharenum = go.GetComponentEx<Text> (Layout.lb_sharenum);
            _lbchangeMoney = go.GetComponentEx<Text> (Layout.lb_changeMoney);
            _btnselect = go.GetComponentEx<Button> (Layout.btn_select);
            EventTriggerListener.Get (_btnselect.gameObject).onClick += _SelectHandler;

            _oldColor = _lbcode.color;
            _oldShareNameColor = _lbsharename.color;
            _oldSharePayColor = _lbsharepay.color;
            _oldCurrentpriseColor = _lbcurrentprise.color;
            _oldShareNumColor = _lbsharenum.color;
            _oldChangeMoneyColor = _lbchangeMoney.color;
        }
Exemplo n.º 4
0
    private void UpdateSelectCount(GameObject obj, int selectCount)
    {
        Button descBtn = obj.GetComponent <Button>("cancel_btn");

        EventTriggerListener.Get(descBtn.gameObject).onClick = OnDescBtnClick;
        descBtn.gameObject.SetActive(selectCount > 0);
        Image img = obj.GetComponent <Image>("count_tip");

        if (img)
        {
            img.enabled = selectCount > 0;
        }
        Text selectCountText = obj.GetComponent <Text>("count_tip/mark");

        selectCountText.supportRichText = true;
        selectCountText.gameObject.SetActive(selectCount > 0);
        Util.SetText(selectCountText, Util.Format(ConfigText.GetDefalutString(TextForMatType.EquipIntentyUI, 18), selectCount));
    }
Exemplo n.º 5
0
 private void _OnShowBottom()
 {
     EventTriggerListener.Get(_btnSure.gameObject).onClick   += _onSureHandler;
     EventTriggerListener.Get(_btnCancle.gameObject).onClick += _onCancleHandler;
     EventTriggerListener.Get(_btnBorrow.gameObject).onClick += _OnClickBorrowHandler;
     if (_controller.cardData.fateType != 3)
     {
         _fateShowBorrow = true;
         _ChangeSizeForBoarrow();
         _btnBorrow.SetActiveEx(false);
     }
     else
     {
         _btnCancle.SetActiveEx(false);
         var tmpPosition = _btnSure.transform.localRotation;
         _btnSure.transform.localPosition = new Vector3(0, tmpPosition.y, tmpPosition.z);
     }
 }
Exemplo n.º 6
0
    public void SetListener()
    {
        if (Ready_Btn)
        {
            EventTriggerListener.Get(Ready_Btn).onPointerClick = o =>
            {
                NetworkNew.Instance.ReadyGameRequest(DataManager.Instance.RoomDataManager.CurRoomId);
            };
        }

        if (Setting_Btn)
        {
            EventTriggerListener.Get(Setting_Btn.gameObject).onPointerClick = o =>
            {
                PanelManager.Instance.OpenPanel <SettingDialog>(CommonDef.SettingDialog);
            };
        }
    }
Exemplo n.º 7
0
    private void CreateCustomNode(HexQuest quest)
    {
        QuestNodeUI nodeQuest = customPrefab;

        if (quest.id != 1)
        {
            nodeQuest = Instantiate <QuestNodeUI>(customPrefab);
            nodeQuest.transform.SetParent(customPrefab.transform.parent, false);
        }
        nodeQuest.gameObject.SetActive(true);
        nodeQuest.InitData(quest);

        EventTriggerListener.Get(nodeQuest.gameObject).onClick =
            (go) => {
            CustomModel.Instance.crtQuest = quest;
            UIManager.Instance.OpenUI("CustomView");
        };
    }
Exemplo n.º 8
0
        private void _onShowCenter()
        {
            EventTriggerListener.Get(btn_sure.gameObject).onClick       += _onBtnSureHandler;
            EventTriggerListener.Get(btn_sureModify.gameObject).onClick += _onBtnSureHandler;
            EventTriggerListener.Get(btn_getRegist.gameObject).onClick  += _onBtnGetIdentifyHandler;
            EventTriggerListener.Get(btn_close.gameObject).onClick      += _OnBtnCloseHandler;

            this._SetSureBtnWord();

            if (_controller.isShowTime())
            {
                ShowTimeCount();
            }
            else
            {
                HideTimeCount();
            }
        }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        isOpen         = false;
        characterClose = transform.FindChild("CharacterClose").GetComponent <Image>();
        EventTriggerListener.Get(characterClose.gameObject).onClick = OnCloseClick;
        text = new Text[7];

        text[0] = transform.FindChild("CharacterName").GetComponent <Text>();
        text[1] = transform.FindChild("CharacterHp").GetComponent <Text>();
        text[2] = transform.FindChild("CharacterDem").GetComponent <Text>();
        text[3] = transform.FindChild("CharacterDef").GetComponent <Text>();
        text[4] = transform.FindChild("CharacterExp").GetComponent <Text>();
        text[5] = transform.FindChild("CharacterCoin").GetComponent <Text>();
        text[6] = transform.FindChild("CharacterLevle").GetComponent <Text>();
        UpdateShowUI();

        PlayerInfo.OnInfoChangedEvent += Show;
    }
Exemplo n.º 10
0
    private void Awake()
    {
        prefabQuest.gameObject.SetActive(false);
        GroundView.SetGridPos(homeBtn, 8, 12);
        GroundView.SetGridPos(newButton, 5, 6);
        EventTriggerListener.Get(homeBtn.gameObject).onClick = OnClickHomeBtn;

        prefabQuestNew.onValueChanged.AddListener(OnSelectNewHander);

        listSliderUtil.SetHorizontalSlid(ListHorizontalSliderHander);

        CustomModel.Instance.updateNodeEvent = OnNodeUpdate;

        EventTriggerListener.Get(newButton.gameObject).onClick = OnNewButtonClick;

        InitQuestList();
        CreateCustomList();
    }
Exemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        idle         = gameObject.FindInChildren("idle");
        talk         = gameObject.FindInChildren("talk");
        walk         = gameObject.FindInChildren("walk");
        hello        = gameObject.FindInChildren("hello");
        change_cloth = gameObject.FindInChildren("change_cloth");
        change_shoe  = gameObject.FindInChildren("change_shoe");
        dress_idle   = gameObject.FindInChildren("dress_idle");

        EventTriggerListener.Get(idle).onClicks.Add(idle_Click);
        EventTriggerListener.Get(talk).onClicks.Add(talk_Click);
        EventTriggerListener.Get(walk).onClicks.Add(walk_Click);
        EventTriggerListener.Get(hello).onClicks.Add(hello_Click);
        EventTriggerListener.Get(change_cloth).onClicks.Add(change_cloth_Click);
        EventTriggerListener.Get(change_shoe).onClicks.Add(change_shoe_Click);
        EventTriggerListener.Get(dress_idle).onClicks.Add(dress_idle_Click);
    }
Exemplo n.º 12
0
        public void create(GameObject tabs, GameObject main, int selectedIdx = 0, int hideType = 0, bool isClicked = false)
        {
            m_hideType  = hideType;
            m_isClicked = isClicked;
            int length = tabs.transform.childCount;

            _tabs = new List <Button>();
            for (int i = 0; i < length; i++)
            {
                _tabs.Add(tabs.transform.GetChild(i).GetComponent <Button>());
                EventTriggerListener.Get(_tabs[i].gameObject).onClick = onClick;
            }

            if (selectedIdx >= 0)
            {
                setSelectedIndex(selectedIdx, true);
            }
        }
Exemplo n.º 13
0
    protected override void InitUI()
    {
        base.InitUI();
        this.m_spBackgroundImage = base.FindTransform("BackgroundImage").GetComponent <RawImage>();
        this.m_vlg          = base.FindTransform("attrs").GetComponent <VerticalLayoutGroup>();
        this.NodeBackground = base.FindTransform("NodeBackground");
        this.actorRawImage  = base.FindTransform("RawImageModel").GetComponent <RawImage>();
        RTManager.Instance.SetModelRawImage1(this.actorRawImage, false);
        EventTriggerListener expr_7F = EventTriggerListener.Get(base.FindTransform("ImageTouchPlace").get_gameObject());

        expr_7F.onDrag = (EventTriggerListener.VoidDelegateData)Delegate.Combine(expr_7F.onDrag, new EventTriggerListener.VoidDelegateData(RTManager.Instance.OnDragImageTouchPlace1));
        UIAnimatorEventReceiver component = base.FindTransform("PanelRoot").GetComponent <UIAnimatorEventReceiver>();

        component.CallBackOfEnd = new Action(this.animEndOfUpgrade);
        UIAnimatorDisableWhenNoactive component2 = base.FindTransform("PanelRoot").GetComponent <UIAnimatorDisableWhenNoactive>();

        component2.DisableCallBack = new Action(this.animEndOfUpgrade);
    }
Exemplo n.º 14
0
    public override void InitUIData()
    {
        Inst = this;
        base.InitUIData();

        if (ObjectSelf.GetInstance().HeroContainerBag.GetHeroList().Count > 0)
        {
            m_CurCard    = ObjectSelf.GetInstance().HeroContainerBag.GetHeroList() [0];
            m_HeroLayout = selfTransform.Find("HeroList/HeroLayout").GetComponent <LoopLayout> ();

            m_HeroLayout.cellCount       = ObjectSelf.GetInstance().HeroContainerBag.GetHeroList().Count;
            m_HeroLayout.updateCellEvent = UpdateHeroCellItem;
            m_HeroLayout.Reload();
        }

        m_BtnGroups = selfTransform.Find("Mainbutton").gameObject;

        //
        m_AttrPanel = selfTransform.Find("AttrPanel").gameObject;

        //
        m_HeroType   = selfTransform.Find("Left/Img_Race").GetComponent <Image> ();
        m_BrightStar = selfTransform.Find("Left/HeroStar/BrightStar").gameObject;

        // 模型
        m_Point         = GameObject.Find("pos").transform;
        m_ModelRotaeBtn = selfTransform.FindChild("ModelRotaeBtn").gameObject;
        EventTriggerListener.Get(m_ModelRotaeBtn).onDown = OnRotateDown;
        EventTriggerListener.Get(m_ModelRotaeBtn).onUp   = OnRotatUp;


        m_BackBtn = selfTransform.FindChild("TopPanel/TopTittle/BackBtn").GetComponent <Button> ();
        m_BackBtn.onClick.AddListener(OnClickBackBtn);

        // 显示 3D 模型
        Show3DModel(ObjectSelf.GetInstance().HeroContainerBag.GetHeroList() [0]);

        //
        InitTextString();

        m_EquipmentLayout = selfTransform.Find("EquipmentPanel/EquipmentLayout").gameObject;

        GameEventDispatcher.Inst.addEventListener(GameEventID.Net_RefreshHero, OnRefreshHero);
    }
Exemplo n.º 15
0
        private void _OnShowCenter()
        {
            if (_controller.isShowBlackBg == true)
            {
                img_bg.color = new Color(0, 0, 0, 1);
            }



            EventTriggerListener.Get(btn_feelshare.gameObject).onClick += _FeelingShareHandler;
            EventTriggerListener.Get(btn_feelself.gameObject).onClick  += _FeelSelfHandler;
            EventTriggerListener.Get(btn_feelsend.gameObject).onClick  += _FeelSendHandler;

            _btnList = new FeelingItem[10];
            for (var i = 0; i < 10; i++)
            {
                if (i == 0)
                {
                    _btnList[0] = new FeelingItem();
                    _btnList[0].Init(this.btn_item.gameObject, _OnClickQuestionCallBack);
                    QuestionAction += _btnList[0].MovePanel;
                }
                else
                {
                    var transform = this.btn_item.transform.parent;
                    var tmpObj    = GameObject.Instantiate <Button>(this.btn_item);
                    tmpObj.transform.SetParent(transform);
                    tmpObj.transform.position   = Vector3.one;
                    tmpObj.transform.localScale = Vector3.one;

                    var tmpItem = new FeelingItem();
                    tmpItem.Init(tmpObj.gameObject, _OnClickQuestionCallBack);
                    QuestionAction += tmpItem.MovePanel;
                    _btnList[i]     = tmpItem;
                }
                //_btnList[i].name = "item" + i;
                //EventTriggerListener.Get(_btnList[i].gameObject).onClick += _ClickItemHandler;
                //_btnList[i].onClick.AddListener(_ClickItemHandler);
            }

            this._scrollRect.SetActiveEx(false);
            _FeelingShareHandler(null);
        }
Exemplo n.º 16
0
    protected override void OnAppear(int sequence, int openOrder, WindowContext context)
    {
        if (isFirst)
        {
            isFirst = false;
            if (GameData.PlayerInfoModel == null)
            {
                FirstGameObject.SetActive(true);
                EventTriggerListener.Get(CreatePlayerInfoButton.gameObject).SetEventHandle(EnumTouchEventType.OnClick,
                                                                                           (a, b, c) =>
                {
                    //点击之后发送注册角色消息
                    PlayerInfoModel playerInfo = new PlayerInfoModel();
                    playerInfo.ID        = 0;
                    playerInfo.HeadImg   = "1.png";
                    playerInfo.RoleName  = CreatePlayerName.text;
                    playerInfo.CoinNum   = 200;
                    playerInfo.EXP       = 1;
                    playerInfo.LV        = 1;
                    playerInfo.AccountID = GameData.AccountData.ID;
                    playerInfo.FriendID  = "";
                    playerInfo.HeroID    = "";
                    playerInfo.Power     = 0;
                    playerInfo.WinNum    = 0;
                    playerInfo.LostNum   = 0;
                    playerInfo.RunNum    = 0;

                    //发送数据模型
//                        Singleton<PhotonManager>.Instance.SendReguest((byte)OperationCode.PlayerInfo, (byte)PlayerInfoOpCode.Create, CommonTool.Serialize<PlayerInfoModel>(playerInfo));
                    SetCreateButton(false);
                });
            }
            else
            {
                FirstGameObject.SetActive(false);
                ShowInfo();
            }
        }
        else
        {
            ShowInfo();
        }
    }
Exemplo n.º 17
0
    // Use this for initialization
    void Start()
    {
        panel_main_ui         = this.transform.FindChild("main_ui").gameObject;
        panel_login           = new ui_login(this.transform.FindChild("main_ui/login"));
        panel_register        = new ui_register(this.transform.FindChild("main_ui/register"));
        panel_bindwallet      = new ui_bindwallet(this.transform.FindChild("main_ui/bindwallet"));
        panel_wallet_password = new ui_walletPassword(this.transform.FindChild("main_ui/wallet_password"));
        panel_main            = new ui_main(this.transform.FindChild("main_ui/main"));
        panel_notice          = new ui_notice(this.transform.FindChild("main_ui/notice"));
        panel_roleinfo        = new ui_roleinfo(this.transform.FindChild("main_ui/roleinfo"));
        panel_address_code    = new ui_addressCode(this.transform.FindChild("main_ui/adressCode"));
        panel_findPassword    = new ui_findPassword(this.transform.FindChild("main_ui/findPassword"));

        btn_main = this.transform.FindChild("btn_main").GetComponent <Button>();
        btn_main.onClick.AddListener(onMainPanelCtr);
        panel_main_ui.transform.FindChild("btn_bg").GetComponent <Button>().onClick.AddListener(onMainPanelCtr);
        EventTriggerListener.Get(btn_main.gameObject).onDrag    = OnDrag;
        EventTriggerListener.Get(btn_main.gameObject).onDragOut = OnDragOut;
    }
Exemplo n.º 18
0
    public override void InitUIData()
    {
        base.InitUIData();
        m_OpenStateObj    = selfTransform.FindChild("OpenStateObj").gameObject;
        m_NotOpenStateObj = selfTransform.FindChild("NotOpenStateObj").gameObject;
        m_OpenState       = selfTransform.FindChild("SelectHeroInfo/OpenState").gameObject;
        m_HeroIcon        = selfTransform.FindChild("SelectHeroInfo/Icon").GetComponent <Image>();
        m_ProgressBar     = selfTransform.FindChild("OpenStateObj/CloneBar").GetComponent <Slider>();
        m_CanHeroCloneIds = ObjectSelf.GetInstance().GetHeroCloneList();

        mEventTrigger = EventTriggerListener.Get(m_InjectBtn.gameObject);
        mEventTrigger.InitPressInterval = 0.1f;
        mEventTrigger.needResetInterval = true;
        mEventTrigger.onPress           = OnProgressForward;
        mEventTrigger.onDown            = OnProgressDown;
        mEventTrigger.onUp = OnProgressBack;

        //EventTriggerListener.Get(m_InjectBtn.gameObject).pressInterval = 0.1f;
    }
Exemplo n.º 19
0
        private void _OnShowBottom()
        {
            _btnserver.SetActiveEx(false);

            //Audio.AudioManager.Instance.StartMusic ();
            Audio.AudioManager.Instance.StartMusic();
            EventTriggerListener.Get(_btnLogin.gameObject).onClick       += _OnLoginHandler;
            EventTriggerListener.Get(_btnWeChatLogin.gameObject).onClick += _OnWeChatLoginHandler;
            EventTriggerListener.Get(_btnRegist.gameObject).onClick      += _OnRegistHandler;

            EventTriggerListener.Get(_btnModify.gameObject).onClick += _OnModifyHandler;
            EventTriggerListener.Get(_btnserver.gameObject).onClick += _OnShowServerHandler;
            EventTriggerListener.Get(_btnfankui.gameObject).onClick += _OnfankuiHandler;

            EventTriggerListener.Get(btn_showPhone.gameObject).onClick       += _OnShowPhoneBaordHandler;
            EventTriggerListener.Get(btn_closePhoneBoard.gameObject).onClick += _OnClosePhoneBoardHandler;

            _currentSever = System.Convert.ToString(_localConfig.LoadValue("curServer", ""));

            _loginUsername.text = System.Convert.ToString(_localConfig.LoadValue(savedPhone, ""));

            _loginPassword.text = System.Convert.ToString(_localConfig.LoadValue(GameModel.GetInstance.UserPassword, ""));

            //EventTriggerListener.Get (btn_login.gameObject).onClick+=_OnLoginHandler;
            //var squence = DOTween.Sequence ();
            //squence.Append (img_tipword.transform.DOLocalMoveY (-240, 1f));
            //squence.Append (img_tipword.transform.DOLocalMoveY (-200,1f));
            //squence.SetLoops(int.MaxValue);

            NetWorkScript.getInstance();

            if (_currentSever == "")
            {
                //SetServerName ("请选择服务器",false);
            }
            _HidePhoneBoard();

            LitJson.JsonData data = new LitJson.JsonData();
            data["versionCode"] = GameModel.GetInstance.version;
            //data.ToJson()
            HttpRequestManager.GetInstance().GetCheckVersionNew(data.ToJson());
            //HttpRequestManager.GetInstance ().GetCheckVersionOld ();
        }
Exemplo n.º 20
0
        /// <summary>
        /// 创建.
        /// </summary>
        /// <param name="count">数量.</param>
        public void Build(int count)
        {
            if (defaultState && selectedState)
            {
                m_PageItemWidth  = defaultState.bounds.size.x * 100f;
                m_PageItemHeight = defaultState.bounds.size.y * 100f;

                foreach (Transform child in transform)
                {
                    Destroy(child.gameObject);
                }

                float total_width = (m_PageItemWidth + space) * (count - 1);

                for (int i = 0; i < count; i++)
                {
                    Image img = (new GameObject()).AddComponent <Image>();
                    if (interactive)
                    {
                        EventTriggerListener.Get(img.gameObject).OnClick += OnPageItemClick;
                    }
                    if (i != m_prevPage)
                    {
                        img.sprite = defaultState;
                    }
                    else
                    {
                        img.sprite = selectedState;
                    }
                    if (material != null)
                    {
                        img.material = material;
                    }
                    RectTransform rectTrans = (RectTransform)img.transform;
                    rectTrans.sizeDelta = new Vector2(m_PageItemWidth, m_PageItemHeight);
                    float size = m_PageItemWidth;
                    rectTrans.SetParent(transform);
                    rectTrans.name             = "PageItem";
                    rectTrans.localScale       = Vector3.one;
                    rectTrans.anchoredPosition = new Vector2((size + space) * i - total_width / 2f, 0);
                }
            }
        }
Exemplo n.º 21
0
 void Start()
 {
     button1 = GameObject.Find("Canvas/Image/zhuban").GetComponent <Button>();
     EventTriggerListener.Get(button1.gameObject).onClick = OnButtonClick;
     button2 = GameObject.Find("Canvas/Image/neicun").GetComponent <Button>();
     EventTriggerListener.Get(button2.gameObject).onClick = OnButtonClick;
     button3 = GameObject.Find("Canvas/Image/cpu").GetComponent <Button>();
     EventTriggerListener.Get(button3.gameObject).onClick = OnButtonClick;
     button4 = GameObject.Find("Canvas/Image/yingpan").GetComponent <Button>();
     EventTriggerListener.Get(button4.gameObject).onClick = OnButtonClick;
     button5 = GameObject.Find("Canvas/Image/dianyuan").GetComponent <Button>();
     EventTriggerListener.Get(button5.gameObject).onClick = OnButtonClick;
     button6 = GameObject.Find("Canvas/Image/sanreqi").GetComponent <Button>();
     EventTriggerListener.Get(button6.gameObject).onClick = OnButtonClick;
     button7 = GameObject.Find("Canvas/Image/xianka").GetComponent <Button>();
     EventTriggerListener.Get(button7.gameObject).onClick = OnButtonClick;
     button8 = GameObject.Find("Canvas/Image/fanhui").GetComponent <Button>();
     EventTriggerListener.Get(button8.gameObject).onClick = OnButtonClick;
 }
Exemplo n.º 22
0
        private void _OnShowCenter()
        {
            EventTriggerListener.Get(btn_sure.gameObject).onClick += _OnSureHandler;
            if (null != _controller)
            {
                _conditionType = _controller.showConditionType;

                if (_conditionType == 1)
                {
                    lb_title.text = txt_successtitle;
                    lb_infor.text = txt_successInfor;

                    if (null != img_title)
                    {
                        img_title.Load(lb_path);
                    }
                }
            }
        }
Exemplo n.º 23
0
    private void SetGuideUiItemActive(bool active)
    {
        if (m_effectTrans)
        {
            m_effectTrans.gameObject.SetActive(active);
        }

        //if the m_findedHotTrans change active , to be on the safe side,we need to register the click callback manually
        if (m_hotTrans && !m_currentItem.hasCondition)
        {
            //bool m_addEvent = m_findedHotTrans.GetComponent<EventTriggerListener>() != null;
            //Logger.LogDetail("name is {0} active is {1}  add event is {2}", m_findedHotTrans.name, active, m_addEvent);
            if (active && !m_addEvent)
            {
                m_addEvent = true;
                EventTriggerListener.Get(m_hotTrans.gameObject).onClick += OnHotAreaClick;
            }
        }
    }
Exemplo n.º 24
0
    private Vector3 Torque;                                                              //旋转力数值


    public override void InitUIData()
    {
        inst        = this;
        titleTxt    = transform.FindChild("Image/Text").GetComponent <Text>();
        nameTxt     = transform.FindChild("SkinDetail/skinName").GetComponent <Text>();
        previewTxt  = transform.FindChild("SkinDetail/Text").GetComponent <Text>();
        model       = transform.FindChild("ModelImg").gameObject;
        Point       = GameObject.Find("pos").transform;
        closeBtn    = transform.FindChild("CloseBtn").GetComponent <Button>();
        closeBtnTxt = transform.FindChild("CloseBtn/Text").GetComponent <Text>();
        attriObj    = transform.FindChild("SkinDetail/Attris").gameObject;
        attriItem   = transform.FindChild("Items/AttriPair").gameObject;

        ModelRotaeBtn = transform.FindChild("ModelRotaeBtn").gameObject;
        EventTriggerListener.Get(ModelRotaeBtn).onDown = OnRotateDown;
        EventTriggerListener.Get(ModelRotaeBtn).onUp   = OnRotatUp;

        closeBtn.onClick.AddListener(CloseUI);
    }
Exemplo n.º 25
0
        private void _OnShowTop()
        {
            _timeStart();

            _cardTransform.localScale = Vector3.zero;

            _cardTransform.DOScale(1, _duringTime).SetDelay(_dalayTime);//.SetEase(Ease.OutBounce) ;
            EventTriggerListener.Get(btn_closeShow.gameObject).onClick = _CloseShowHandler;
            isOnlyShow = _controller.IsOnlyShow;

            if (isOnlyShow == false)
            {
                btn_closeShow.SetActiveEx(false);
            }
            else
            {
                _bottom.SetActiveEx(false);
            }
        }
Exemplo n.º 26
0
        public override void onClosed()
        {
            closeSubWins();

            if (m_proAvatar != null)
            {
                m_proAvatar.dispose();
                m_proAvatar = null;
            }

            m_handle = null;
            instance = null;
            //if (m_skmesh_camera != null)
            //{
            //    GameObject.Destroy(m_skmesh_camera);
            //    m_skmesh_camera = null;
            //}
            if (m_player_camera != null)
            {
                GameObject.Destroy(m_player_camera);
                m_player_camera = null;
            }
            if (m_npc_camera != null)
            {
                GameObject.Destroy(m_npc_camera);
                m_npc_camera = null;
            }
            if (m_anim_usr != null)
            {
                Destroy(m_selfObj);
                m_selfObj  = null;
                m_anim_usr = null;
            }

            if (m_npc_obj != null)
            {
                Destroy(m_npc_obj.gameObject);
                m_npc_obj = null;
            }
            EventTriggerListener.Get(gameObject).clearAllListener();
            base.onClosed();
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL);
        }
Exemplo n.º 27
0
        public void create(GameObject tabs, GameObject main, int selectedIdx = 0, int hideType = 0, bool isClicked = false)
        {
            this.m_hideType  = hideType;
            this.m_isClicked = isClicked;
            int childCount = tabs.transform.childCount;

            this._tabs = new List <Button>();
            for (int i = 0; i < childCount; i++)
            {
                this._tabs.Add(tabs.transform.GetChild(i).GetComponent <Button>());
                EventTriggerListener.Get(this._tabs[i].gameObject).onClick = new EventTriggerListener.VoidDelegate(this.onClick);
            }
            bool flag = selectedIdx >= 0;

            if (flag)
            {
                this.setSelectedIndex(selectedIdx, true);
            }
        }
Exemplo n.º 28
0
            public void InitInfo(GameObject obj, PlayerInfo playerInfo, Action endCallBack = null)
            {
                _obj         = obj;
                _playerInfo  = playerInfo;
                _endCallBack = endCallBack;
                isEnd        = false;

                _objnotgetpacket = obj.GetComponentEx <Transform>(Layout.obj_notgetpacket);
                _objgetpacket    = obj.GetComponentEx <Transform>(Layout.obj_getpacket);
                _objgetpacket.SetActiveEx(false);

                _lbgetprompt    = obj.GetComponentEx <Text>(Layout.obj_notgetpacket + Layout.lb_getprompt);
                _lbgetCashCount = obj.GetComponentEx <Text>(Layout.obj_getpacket + Layout.lb_getCashCount);

                _btnopen = obj.GetComponentEx <Button>(Layout.obj_notgetpacket + Layout.btn_open);
                EventTriggerListener.Get(_btnopen.gameObject).onClick = _OnOpenPacketHandler;

                _lbgetprompt.text = prompt.Replace("XXX", _playerInfo.playerName);
            }
Exemplo n.º 29
0
        private void _OnBtnShow()
        {
            if (_controller.kindStr == "buildFateCell")
            {
                this.buildFateCell();
            }
            else if (_controller.kindStr == "buildRiskCell")
            {
                this.buildRiskCell();
            }
            else if (_controller.kindStr == "buildOpportunityCell")
            {
                this.buildOpportunityCell();
            }
            else if (_controller.kindStr == "buildInvestmentCell")
            {
                this.buildInvestmentCell();
            }
            else if (_controller.kindStr == "buildQualityLifeCell")
            {
                this.buildQualityLifeCell();
            }
            else if (_controller.kindStr == "buildRelaxkCell")
            {
                this.buildRelaxkCell();
            }
            else if (_controller.kindStr == "buildChanceCell")
            {
                this.buildChanceCell();
            }

            EventTriggerListener.Get(_btnBig.gameObject).onClick         += _OnBtnBigClick;
            EventTriggerListener.Get(_btnSmall.gameObject).onClick       += _OnBtnSmallClick;
            EventTriggerListener.Get(_btnFate.gameObject).onClick        += _OnBtnFateClick;
            EventTriggerListener.Get(_btnInvestment.gameObject).onClick  += _OnBtnInvestmentClick;
            EventTriggerListener.Get(_btnLook.gameObject).onClick        += _OnBtnLookClick;
            EventTriggerListener.Get(_btnQuality.gameObject).onClick     += _OnBtnQualityClick;
            EventTriggerListener.Get(_btnRichLeisure.gameObject).onClick += _OnBtnRichLeisureClick;
            EventTriggerListener.Get(_btnRisk.gameObject).onClick        += _OnBtnRiskClick;
            EventTriggerListener.Get(_btnClose.gameObject).onClick       += _OnBtnCloseClick;

            setBtnState();
        }
Exemplo n.º 30
0
    public override void Init(string panelName, params object[] args)
    {
        base.Init(panelName, args);
        prefabPath     = "PropsPanel";
        type           = PanelType.PropsPanel;
        initedObj.name = prefabPath;
        initedObj.AddComponent <IPanelDragable>();
        closeBtn      = objTrans.Find("PropsPanelTop_Bg/CloseBtn_Frame").gameObject;
        scrollContent = objTrans.Find("PropsPanel_Bg/Props_Scroll View/Viewport/Content");


        EventTriggerListener.Get(closeBtn).onClick = (obj) =>
        {
            KeyValuesUpdate kv = new KeyValuesUpdate("MenuItemClick", PanelType.PropsPanel);
            MessageCenter.instance.SendMessage(PanelType.MenuPanel.ToString(), kv);
        };
        MessageCenter.instance.AddMsgListener(type.ToString(), MsgHandle);
        SetProps(PlayerData.instance.selectedPlayerEntity);
    }