Beispiel #1
0
    protected override void OnOpen()
    {
        base.OnOpen();

        rewardShow        = GetComponent <RewardShow>  ("topLayer/tips");
        summonOnce        = GetComponent <Button>      ("main/summon_01/summon_Btn");
        summonTen         = GetComponent <Button>      ("main/summon_01/summon_Btn02");
        summonOnce2       = GetComponent <Button>      ("topLayer/tips/wish_goods/main/summon_01/summon_Btn");
        summonTen2        = GetComponent <Button>      ("topLayer/tips/wish_goods/main/summon_01/summon_Btn02");
        addStoneButton    = GetComponent <Button>      ("topLayer/stone/add");
        confirmButton     = GetComponent <Button>      ("popup/yes");
        costCountText     = GetComponent <Text>        ("main/summon_01/cost_txt/count");
        costCountText2    = GetComponent <Text>        ("topLayer/tips/wish_goods/main/summon_01/cost_txt/count");
        felling           = GetComponent <NpcMono>     ("content/npcInfo");
        mainContent       = GetComponent <Transform>   ("main");
        npcUIRoot         = GetComponent <Transform>   ("content/role_render/Root");
        stoneCountText    = GetComponent <Text>        ("topLayer/stone/text");
        _petSummonSuccess = GetComponent <PetSummonSSS> ("topLayer/tips/jipin");
        scrollView        = GetComponent <ScrollView>  ("dropInfo/info/inner/items");
        dropNode          = GetComponent <Transform>   ("dropInfo");
        maskButton        = GetComponent <Button>      ("mask");

        MultiLanguage();
        RefreshCost();

        confirmButton?.onClick.AddListener(OnBuyConfirm);
        summonOnce?.onClick.AddListener(OnSummonOnce);
        summonTen?.onClick.AddListener(OnSummonTen);
        summonOnce2?.onClick.AddListener(OnSummonOnce);
        summonTen2?.onClick.AddListener(OnSummonTen);
        maskButton?.onClick.AddListener(OnMaskClick);
        maskButton.SafeSetActive(false);
        CloseToNpc(true);

        rewardShow.Regirest(ItemIsPet, _petSummonSuccess);
        rewardShow.OnClose += OnFocus;
        rewardShow.onAnimEnd.AddListener(() =>
        {
            summonOnce2.transform.parent.SafeSetActive(!moduleGuide.inGuideProcess);
            addStoneButton.transform.parent.SafeSetActive(true);
        });
        rewardShow.SetBinder(new SummonTempleteBind());

        addStoneButton.onClick.AddListener(() =>
        {
            UpdateGemText(1);
        });

        new DataSource <PWishItemDropInfo>(modulePet.dropInfo, scrollView, SetDropItem);
    }
Beispiel #2
0
    protected override void OnOpen()
    {
        m_npc = null;

        GetComponent <NpcMono>("content/role_render")?.InitAction(c =>
        {
            m_npc = c;
            if (m_npc)
            {
                m_npc.AddEventListener(CreatureEvents.ENTER_STATE, OnNpcEnterState);
            }
        });

        m_btnSkipAnimation = GetComponent <Button>("mask");
        m_btnAddWishCoin   = GetComponent <Button>("topLayer/wishCoin/add");
        m_btnWish          = GetComponent <Button>("content/wish_Btn");
        m_btnWishTen       = GetComponent <Button>("content/wish_Btn02");
        m_ruleBtn          = GetComponent <Button>("content/activity_Btn");
        m_wish             = GetComponent <Transform>("content/wish_Btn").gameObject;
        m_popOK            = GetComponent <Button>("topLayer/popup/yes");
        m_sss          = GetComponent <WishItemInfoSSS>("topLayer/tips/jipin");
        m_itemTemplate = GetComponent <RectTransform>("content/dropInfo/info/inner/items/template").gameObject;
        m_ta           = GetComponent <TweenAlpha>("content");
        m_ta2          = GetComponent <TweenAlpha>("topLayer/wishCoin");
        m_tb           = GetComponent <TweenAlphaParticle>("content/wish_Btn/effect");
        m_tc           = GetComponent <TweenColor>("npc");
        m_tad          = GetComponent <TweenAlpha>("content/dropInfo");
        m_rewardShow   = GetComponent <RewardShow>("topLayer/tips");
        m_popUpContext = GetComponent <Text>("topLayer/popup/content1/info");

        m_btnWish2    = GetComponent <Button>("topLayer/tips/wish_goods/GameObject/wish_Btn");
        m_btnWishTen2 = GetComponent <Button>("topLayer/tips/wish_goods/GameObject/wish_Btn02");

        m_itemTemplate.SetActive(false);

        if (null != m_rewardShow)
        {
            m_rewardShow.OnClose += () =>
            {
                HighlightNpc(false);
                Module_Guide.AddSpecialTweenEndCondition();
                moduleGlobal.ShowGlobalTopRightBar(false);
            };
            m_rewardShow.onAnimEnd.AddListener(() =>
            {
                m_ta2.Play(false);
                m_btnWish2.transform.parent.SafeSetActive(!moduleGuide.inGuideProcess);
            });
        }
        m_popOK?.onClick.AddListener(() =>
        {
            if (wishTimes > 0)
            {
                moduleWish.ImFeelingLucky(wishTimes, true);
                wishTimes = 0;
            }
            else
            {
                moduleWish.BuyWishCoin(currentTimes, true);
            }
        });
        m_ruleBtn.onClick.AddListener(() => { m_wish.SetActive(false); });

        m_btnAddWishCoin?.onClick.AddListener(() =>
        {
            UpdateGemText(1, false);
        });

        m_btnWish?.onClick.AddListener(() => { OnWishClick(1); });
        m_btnWish2?.onClick.AddListener(() => { OnWishClick(1); });
        m_btnWishTen?.onClick.AddListener(() => { OnWishClick(10); });
        m_btnWishTen2?.onClick.AddListener(() => { OnWishClick(10); });

        m_btnSkipAnimation.SafeSetActive(false);
        m_btnSkipAnimation?.onClick.AddListener(() =>
        {
            m_skipAnimation = true;
            m_npc.stateMachine.TranslateToID(CREATURE_STATE_IDLE);
        });

        InitializeText();
        UpdateWishCoinText();

        m_rewardShow?.Regirest(IsSSS, m_sss);

        m_dropInfo = new DataSource <PWishItemDropInfo>(moduleWish.dropInfo, GetComponent <ScrollView>("content/dropInfo/info/inner/items"), SetDropItem);
    }