Exemplo n.º 1
0
 void Init()
 {
     if (isRead)
     {
         return;
     }
     isRead = true;
     //npc展示
     NpcObj = GameObject.Instantiate(NPCPrefab) as GameObject;
     NpcObj.transform.parent        = NPCCamera.transform.Find("ModelParent");
     NpcObj.transform.localPosition = NpcPos;
     NpcObj.transform.localRotation = Quaternion.Euler(0, 197f, 0);
     NpcObj.transform.localScale    = Vector3.one;
     DefaultAnim = "LadyTIdle01";            //NpcObj.animation.clip.name;
     NpcObj.animation.CrossFade(DefaultAnim);
     btnBack.SetCallBackFuntion(OnClickBackEvent);
     btnRefreshNextTimes.SetCallBackFuntion(OnClickNextTimesEvent);
     btnArrowLeft.SetCallBackFuntion(OnClickLeftEvent);
     btnArrowRight.SetCallBackFuntion(OnClickRightEvent);
     btnInfo.SetPressCallBack(OnPressInfoEvent);
     downTimeNameLabel.text = LanguageTextManager.GetString("IDS_I29_6");
     CreateListItem();
     NetServiceManager.Instance.TradeService.SendCarryShopUI_CS(0);
     UIEventManager.Instance.RegisterUIEvent(UIEventType.RcvCarryShopUIDataEvent, OnRcvCarryShopUIDataEvent);
     UIEventManager.Instance.RegisterUIEvent(UIEventType.RcvCarryShopBuyEvent, OnRcvCarryShopBuyEvent);
     UIEventManager.Instance.RegisterUIEvent(UIEventType.RcvCarryShopUnLockEvent, OnRcvCarryShopUnLockEvent);
 }
Exemplo n.º 2
0
        void Awake()
        {
            m_PackRightBtnManager = CreatObjectToNGUI.InstantiateObj(RightBtnManagerPrefab, transform).GetComponent <PackRightBtnManager>();
            m_PackRightBtnManager.transform.localPosition = RightBtnHidPos;
            BesetSuccessEff1   = CreatObjectToNGUI.InstantiateObj(BesetSuccessEff1_profab, transform);
            SwallowSuccessEff1 = CreatObjectToNGUI.InstantiateObj(SwallowSuccessEff1_prefab, transform);
            SwallowSuccessEff1.transform.localPosition = new Vector3(0, 0, -25);
            BesetSuccessEff1.SetActive(false);
            SwallowSuccessEff1.SetActive(false);
            //返回按钮点击
            BackBtn.SetCallBackFuntion((obj) =>
            {
                SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Cancel");

                this.Close();
            });
            //返回按钮按下/松开效果
            BackBtn.SetPressCallBack((isPressed) =>
            {
                BackBtn.spriteSwithList.ApplyAllItem(P => P.ChangeSprite(isPressed ? 2 : 1));
            });
            m_createInstance = true;
            var commonPanel = NGUITools.AddChild(gameObject, CommonPanelTitle_Prefab);

            commonPanel.transform.localPosition = CommonPanelTitle_Prefab.transform.localPosition;
            commonPanel.GetComponent <CommonPanelTitle>().TweenShow();
            //RegisterEventHandler ();
            TaskGuideBtnRegister();
        }
Exemplo n.º 3
0
        void Awake()
        {
            m_EctypeIncoBoardInitialPos = EctypeInfoBoard.localPosition;
            //按钮事件
            CaptainDisbandButton.SetCallBackFuntion(OnCaptainDisbandClick, null);

            CaptainStartButton.SetCallBackFuntion(OnCaptainStartClick, null);
            MemberLeaveButton.SetCallBackFuntion(OnMemberLeaveClick, null);
            MemberReadyButton.SetCallBackFuntion(OnMemberReadyClick, null);
            MemberCancelReadyButton.SetCallBackFuntion(OnMemeberCancelReadyClick, null);
            PosOneInviteButton.SetCallBackFuntion(OnPosOneInviteClick, null);

            Button_Recruit.SetCallBackFuntion(OnRecruitButtonClick, null);
            Button_Chat.SetCallBackFuntion(OnChatButtonClick, null);

            Button_HidePanel.SetCallBackFuntion(OnHidePanelClick, null);

            Button_ViewEctype.SetPressCallBack(OnViewEctypeClick);
            Button_ViewRewards.SetPressCallBack(OnViewRewardsClick);

            TaskGuideBtnRegister();

            //队伍频道聊天窗
            //GameObject chatPanel = UI.CreatObjectToNGUI.InstantiateObj(ChatPanelTeamPrefab,transform);
            GameObject chatPanel = (GameObject)Instantiate(ChatPanelTeamPrefab);

            chatPanel.transform.parent        = transform;
            chatPanel.transform.localPosition = Vector3.back * 1000;
            chatPanel.transform.localScale    = Vector3.one;
            m_ChatPanel_Team = chatPanel.GetComponent <ChatPanel_Team>();
        }
Exemplo n.º 4
0
        void Awake()
        {
            BsetItem           = CreatObjectToNGUI.InstantiateObj(BesetItem_prafab, Item_point).GetComponent <JewelBset_ContainerItem>();
            BsetItem.CanCancel = true;
            buttonCallBack.SetCallBackFuntion(obj => {
                SoundManager.Instance.PlaySoundEffect("Sound_Button_Stone_Click");
                if (fielInfo != null)
                {
                    EquiptSlotType place       = (EquiptSlotType)int.Parse((fielInfo.LocalItemData as EquipmentData)._vectEquipLoc);
                    List <JewelInfo> jewelInfo = PlayerDataManager.Instance.GetJewelInfo(place);
                    if (_holeIndex == HoleIndex.FirstHole)
                    {
                        if (jewelInfo[0].JewelID != 0)
                        {
                            if (ContainerInfomanager.Instance.PackIsFull())
                            {
                                MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_I9_20"), 1);
                            }
                            else
                            {
                                NetServiceManager.Instance.EquipStrengthenService.SendRequestGoodsOperateRemoveCommand(fielInfo.sSyncContainerGoods_SC.uidGoods, 1);
                            }

                            //JewelBesetManager.GetInstance().ShowRemoveJewel1Effect();
                            //JewelBesetManager.GetInstance().RemoveQueue.Enqueue(1);
                        }
                        else
                        {
                            //Debug.Log(place);
                            JewelBesetManager.GetInstance().UpdateChoseJewelList_Beset(fielInfo, 1);
                            JewelBesetManager.GetInstance().ChangeSubUistate(JewelState.JewelChose_Beset);
                        }
                    }
                    else
                    {
                        if (jewelInfo[1].JewelID != 0)
                        {
                            if (ContainerInfomanager.Instance.PackIsFull())
                            {
                                MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_I9_20"), 1);
                            }
                            else
                            {
                                NetServiceManager.Instance.EquipStrengthenService.SendRequestGoodsOperateRemoveCommand(fielInfo.sSyncContainerGoods_SC.uidGoods, 2);
                            }

                            //JewelBesetManager.GetInstance().ShowRemoveJewel2Effect();
                            //JewelBesetManager.GetInstance().RemoveQueue.Enqueue(2);
                        }
                        else
                        {
                            JewelBesetManager.GetInstance().UpdateChoseJewelList_Beset(fielInfo, 2);
                            JewelBesetManager.GetInstance().ChangeSubUistate(JewelState.JewelChose_Beset);
                        }
                    }
                    JewelBesetManager.GetInstance().DisableAllHoleButton();
                }
            });
            buttonCallBack.SetPressCallBack(OnButtonPress);
        }
Exemplo n.º 5
0
    void Awake()
    {
        ThumbBtn.SetPressCallBack(OnPress);
        //ThumbBtn.SetDragCallback(OnValueChange);

        Slider.onValueChange += OnValueChange;
        ThumbTra              = ThumbBtn.transform;
    }
Exemplo n.º 6
0
 void Awake()
 {
     tipsLable1.SetText(LanguageTextManager.GetString("IDS_I30_1"));
     tipsLable2.SetText(LanguageTextManager.GetString("IDS_I30_2"));
     Btn.SetPressCallBack(OnPress);
     Fpos  = transform.localPosition;
     scale = transform.localScale;
 }
Exemplo n.º 7
0
 void Awake()
 {
     BackBtn.SetCallBackFuntion(OnBackButtonClick);
     BackBtn.SetPressCallBack(OnBackButtonPress);
     SC_EmailTabManager      = CreatObjectToNGUI.InstantiateObj(EmailTabManager_prefab, transform).GetComponent <EmaiTabManager>();
     SC_EmaiBottomBtnmanager = CreatObjectToNGUI.InstantiateObj(EmaiBottomBtnmanager_prefab, transform).GetComponent <EmaiBottomBtnmanager>();
     //TraceUtil.Log(SystemModel.wanglei,"ssd");
     TaskGuideBtnRegister();
 }
Exemplo n.º 8
0
 //private bool m_skillUpgrading=false;
 // Use this for initialization
 void Awake()
 {
     SkillLevIDS.text    = LanguageTextManager.GetString("IDS_I7_9");
     m_tweenPosComponent = GetComponent <TweenPosition>();
     SkillUpgradeBtn.SetCallBackFuntion(UpgradeSkill);
     SkillBreakDescBtn.SetPressCallBack(SkillBreakDesc);
     RegisterEventHandler();
     //TaskGuideBtnRegister();
 }
Exemplo n.º 9
0
        void Awake()
        {
            var playerData = PlayerManager.Instance.FindHeroDataModel();

            RewardItemButton.SetCallBackFuntion(OnRewardItemClick);
            m_CrusadeList = EctypeConfigManager.Instance.EctypeSelectConfigList.Values.Where(p => p.lEctypeType == 9).ToList();          //首领讨伐副本 lEctypeType = 9
            bool isCreate = true;
            int  index    = 0;

            m_CrusadeList.ApplyAllItem(p => {
                p._vectContainer.ApplyAllItem(k => {
                    if (isCreate)
                    {
                        index++;
                        GameObject ectype = UI.CreatObjectToNGUI.InstantiateObj(CrusadeLeaderItemPrefab, Grid.transform);
                        EctypeContainerData ectypeContainerData = EctypeConfigManager.Instance.EctypeContainerConfigList[k];
                        CrusadeLeaderItem crusadeLeaderItem     = ectype.GetComponent <CrusadeLeaderItem>();
                        crusadeLeaderItem.Init(p._EctypeIconPrefab, ectypeContainerData, playerData.UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL, OnSelectEctypeClick, index);
                        ectype.RegisterBtnMappingId(p._lEctypeID, UIType.Crusade, BtnMapId_Sub.Crusade_EctypeItem);
                        m_ectypeItemList.Add(k, crusadeLeaderItem);
                        if (ectypeContainerData.lMinActorLevel > playerData.UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL)
                        {
                            isCreate = false;
                        }
                    }
                });
            });
            Grid.Reposition();

            GameObject commonTitle = UI.CreatObjectToNGUI.InstantiateObj(CommonPanelTitlePrefab, CommonPanelTitlePoint);

            m_CommonPanelTitle         = commonTitle.GetComponent <BaseCommonPanelTitle>();
            m_CommonPanelTitle.HidePos = new Vector3(100, 0, 0);
            m_CommonPanelTitle.ShowPos = Vector3.zero;
            m_CommonPanelTitle.Init(CommonTitleType.Power, CommonTitleType.GoldIngot);

            Button_Exit.SetCallBackFuntion(OnExitClick, null);
            Button_ViewDrops.SetPressCallBack(OnViewRewardsClick);
            Button_Start.SetCallBackFuntion(OnStartClick, null);
            Button_CreateTeam.SetCallBackFuntion(OnCreateTeamClick, null);
            Button_FindTeam.SetCallBackFuntion(OnFindTeamClick, null);
            Button_QuickJoin.SetCallBackFuntion(OnQuickJoinClick, null);

            Button_Receive.SetCallBackFuntion(OnReceiveFirstRewardClick, null);
            Button_RandomEctype.SetCallBackFuntion(OnRandomEctypeClick, null);
            Button_CancelRandomEctype.SetCallBackFuntion(OnCancelRandomEctypeClick, null);
            Button_CancelRandomEctype.gameObject.SetActive(false);


            LeaderListPanelPos  = LeaderListPanel.transform.localPosition;
            CrusadeInfoPanelPos = CrusadeInfoPanel.transform.localPosition;

            TaskGuideBtnRegister();

            RegisterEventHandler();
        }
Exemplo n.º 10
0
 void Awake()
 {
     IsJoystick = GameManager.Instance.UseJoyStick;
     AttackBtn.gameObject.SetActive(IsJoystick);
     JoyStickBtn.gameObject.SetActive(IsJoystick);
     AttackBtn.SetPressCallBack(OnAtkBtnPressed);
     if (IsJoystick)
     {
         BattleUIManager.Instance.RememberRegiste(AttackBtn.gameObject, SkillBtnRemember.RememberBtnType.NormalSkillBtn);
     }
     RecoveSprite.fillAmount = 1f;
 }
Exemplo n.º 11
0
    void Awake()
    {
        BackButton.SetCallBackFuntion(OnBackButtonClick);
        NextButton.SetCallBackFuntion(OnNextButtonClick);
        PerButton.SetCallBackFuntion(OnPerButtonClick);
        AwardButton.SetCallBackFuntion(OnAwardButtonClick);
        RulesButton.SetPressCallBack(OnRulesButtonPress);
        RegisterEventHandler();
        CreatListPanel();

        RulesLabel.text = LanguageTextManager.GetString("IDS_I38_16").Replace("\\n", "\n");
    }
Exemplo n.º 12
0
    void Awake()
    {
        m_posAnim = GetComponent <TweenPosition>();
        m_challengeBtnSpriteSwitch = ChallengeBtn.GetComponentInChildren <SpriteSwith>();
        //按下/抬起 效果切换
        ChallengeBtn.SetPressCallBack(flag => { if (ChallengeBtn.Enable)
                                                {
                                                    m_challengeBtnSpriteSwitch.ChangeSprite(flag?2:1);
                                                }
                                      });

        ChallengeBtn.SetCallBackFuntion(obj =>
        {
            SoundManager.Instance.PlaySoundEffect("Sound_Button_DefenceLevelStart");
            //var selectEct = EctypeConfigManager.Instance.EctypeSelectConfigList.Values.SingleOrDefault(P => P._vectContainer.Contains(m_selectedDefenceItem.EctypeContainerData.lEctypeContainerID));
            int remainNum = 0;
            int.TryParse(m_selectedDefenceItem.RemainNum.text, out remainNum);
            //挑战防守副本,判断体力和次数
            if (remainNum <= 0)
            {
                //次数用完
                UI.MessageBox.Instance.ShowTips(1, LanguageTextManager.GetString("IDS_I15_3"), 1);
            }
            else if (NotEnoughtActivity(int.Parse(m_selectedDefenceItem.ConsumeNum.text)))
            {
                //体力不足,接入副本中的体力不足
                PopupObjManager.Instance.ShowAddVigour();
            }
            else
            {
                Action action = () => {
                    JudgeAndExitTeam();                             //add by lee
                    SMSGEctypeRequestCreate_CS sMSGEctypeRequestCreate_CS = new SMSGEctypeRequestCreate_CS()
                    {
                        dwEctypeContainerID = m_selectedDefenceItem.EctypeContainerData.lEctypeContainerID
                    };
                    TraceUtil.Log(SystemModel.Jiang, "发送加入副本请求:" + sMSGEctypeRequestCreate_CS.dwEctypeContainerID);
                    NetServiceManager.Instance.EctypeService.SendEctypeGuideCreate(sMSGEctypeRequestCreate_CS);
                };

                if (TeamManager.Instance.IsTeamExist())
                {
                    TeamManager.Instance.ShowLeaveTeamTip(action);
                }
                else
                {
                    action();
                }
            }
        });
        TaskGuideBtnRegister();
    }
Exemplo n.º 13
0
        void Awake()
        {
            AddBtn.SetPressCallBack(OnAddBtnPress);
            AddBtn.SetCallBackFuntion(OnAddBtnClick);
            CutBtn.SetPressCallBack(OnCutBtnPress);
            CutBtn.SetCallBackFuntion(OnCutBtnClick);
            SureBtn.SetCallBackFuntion(OnSureButtonClick);
            CancelBtn.SetCallBackFuntion(OnCancelButtonClick);

            SureBtn.SetButtonText(LanguageTextManager.GetString("IDS_H2_55"));
            CancelBtn.SetButtonText(LanguageTextManager.GetString("IDS_H2_28"));
            ClosePanel();
        }
Exemplo n.º 14
0
 void Awake()
 {
     ViewDropBtn.SetPressCallBack(OnDropItemDesBtnPress);
     EctypeDesBtn.SetPressCallBack(OnEctypeDesBtnPress);
     SingleJoyBtn.SetCallBackFuntion(OnSingleJoinBtnClick);
     SingleJoyBtn.SetPressCallBack(OnSingleJoinBtnPress);
     TeamJoyBtn.SetCallBackFuntion(OnTeamJoinBtnClick);
     SweepBtn.SetCallBackFuntion(OnSweepBtnClick);
     SweepBtn.SetPressCallBack(OnSweepBtnPress);
     sweepHLight.SetActive(false);
     TaskGuideBtnRegister();
     sweepEff.SetActive(false);
     UIEventManager.Instance.RegisterUIEvent(UIEventType.EctypeNormalDataUpdate, OnEctypeNormalOpenListUpdateEvent);
 }
Exemplo n.º 15
0
 void Awake()
 {
     //返回按钮点击
     BackBtn.SetCallBackFuntion((obj) =>
     {
         SoundManager.Instance.PlaySoundEffect("Sound_Button_DefenceLevelBack");
         NetServiceManager.Instance.EctypeService.SendEctypeRequestReturnCity(PlayerManager.Instance.FindHeroDataModel().UID);
     });
     //返回按钮按下/松开效果
     BackBtn.SetPressCallBack((isPressed) =>
     {
         BackBtn.spriteSwithList.ApplyAllItem(P => P.ChangeSprite(isPressed?2:1));
     });
 }
Exemplo n.º 16
0
        public void InitPanel(int PositionID, EctypeContainerData LocalEctypeData, TrialsEctypePanelList myParent)
        {
            ShowEctypeGetAtrributeBtn.SetCallBackFuntion(OnShowGetAtbBtnClick);
            GoButton.SetPressCallBack(OnPress);
            transform.localPosition = new Vector3((PositionID - 2) * 250, 0, 0);
            this.myParent           = myParent;
            this.LocalEctypeData    = LocalEctypeData;
            CreatBackgroundPoint.ClearChild();
            CreatObjectToNGUI.InstantiateObj(EctypeIconDataBase.GetIconData(LocalEctypeData.lEctypeContainerID, LocalEctypeData.lDifficulty).EctypeIconPrefab, CreatBackgroundPoint);
            //Background.spriteName = LocalEctypeData.lEctypeIcon;
            LockLevelLabel.SetText(string.Format("{0}\n{1}", LanguageTextManager.GetString("IDS_H1_483"), string.Format(LanguageTextManager.GetString("IDS_H1_484"), LocalEctypeData.lMinActorLevel)));
            SetPanelLockActive(true);

            //TODO GuideBtnManager.Instance.RegGuideButton(ShowEctypeGetAtrributeBtn.gameObject, UIType.TrialsEctypePanel, SubType.ShowAtrribute, out m_guideBtnID[0]);
            //TODO GuideBtnManager.Instance.RegGuideButton(GoButton.gameObject, UIType.TrialsEctypePanel, SubType.GoButton, out m_guideBtnID[1]);
        }
Exemplo n.º 17
0
 public void Init(PackBtnType packBtnType, Action <PackBtnType> clickHandle)
 {
     m_packBtnType   = packBtnType;
     gameObject.name = string.Format("{0}{1}", (int)packBtnType, packBtnType);
     ChangeSprite(m_packBtnType);
     //监听点击,向上冒泡
     m_callBack.SetCallBackFuntion((obj) => { if (clickHandle != null)
                                              {
                                                  clickHandle(packBtnType);
                                              }
                                   }, m_packBtnType);
     //按下去或松开 效果
     m_callBack.SetPressCallBack((isPressed) =>
     {
         ChangeSprite(isPressed);
     });
 }
Exemplo n.º 18
0
 void Init()
 {
     if (isRead)
     {
         return;
     }
     isRead = true;
     itemPrefab.SetActive(false);
     goodsLabel.text      = LanguageTextManager.GetString("IDS_I27_1");
     prefessionLabel.text = LanguageTextManager.GetString("IDS_I27_2");
     typeLabel.text       = LanguageTextManager.GetString("IDS_I27_3");
     priceLabel.text      = LanguageTextManager.GetString("IDS_I27_4");
     buyerLabel.text      = LanguageTextManager.GetString("IDS_I27_5");
     buyLabel.text        = LanguageTextManager.GetString("IDS_I27_6");
     btnBack.SetCallBackFuntion(OnClickBackEvent);
     btnInfo.SetPressCallBack(OnPressInfoEvent);
     UIEventManager.Instance.RegisterUIEvent(UIEventType.ReceiveServerAuctionData, OnReceiveAuctionDataHandler);
     UIEventManager.Instance.RegisterUIEvent(UIEventType.ReceiveServerAuctionResult, OnReceiveAuctionResultHandler);
     downTimeNameLabel.text = LanguageTextManager.GetString("IDS_I27_7");
 }
Exemplo n.º 19
0
    // Use this for initialization
    void Awake()
    {
        //返回按钮点击
        BackBtn.SetCallBackFuntion((obj) =>
        {
            SoundManager.Instance.PlaySoundEffect("Sound_Button_Task_Leave");
            this.Close();
        });
        //返回按钮按下/松开效果
        BackBtn.SetPressCallBack((isPressed) =>
        {
            BackBtn.spriteSwithList.ApplyAllItem(P => P.ChangeSprite(isPressed ? 2 : 1));
        });
        m_createInstance = true;
        var commonPanel = NGUITools.AddChild(gameObject, CommonPanelTitle_Prefab);

        commonPanel.transform.localPosition = CommonPanelTitle_Prefab.transform.localPosition;
        m_commonPanelTitle = commonPanel.GetComponent <BaseCommonPanelTitle>();
        m_commonPanelTitle.Init(CommonTitleType.Money, CommonTitleType.GoldIngot);
        RegisterEventHandler();
        TaskGuideBtnRegister();
    }
Exemplo n.º 20
0
    // Use this for initialization
    void Awake()
    {
        //返回按钮点击
        BackBtn.SetCallBackFuntion((obj) =>
        {
            SoundManager.Instance.PlaySoundEffect("Sound_Button_DefenceLevelBack");
            this.Close();
        });
        //返回按钮按下/松开效果
        BackBtn.SetPressCallBack((isPressed) =>
        {
            BackBtn.spriteSwithList.ApplyAllItem(P => P.ChangeSprite(isPressed?2:1));
        });
        var commonPanel = NGUITools.AddChild(CommonTitlePoint, CommonPanelTitle_Prefab);

        m_commonPanelTitle         = commonPanel.GetComponent <BaseCommonPanelTitle>();
        m_commonPanelTitle.HidePos = new Vector3(100, 0, 0);
        m_commonPanelTitle.ShowPos = Vector3.zero;
        m_commonPanelTitle.Init(CommonTitleType.Power, CommonTitleType.GoldIngot);
        //RegisterEventHandler();
        TaskGuideBtnRegister();
    }