Esempio n. 1
0
    protected override void OnOpen(object param = null)
    {
        base.OnOpen(param);
        AddEventListener();
        AddEventDelegate();

        mWingItemUIList[CurPageNum - 1].IsTryOn = false;
        mWingItemUIList[CurPageNum - 1].mView.SetActive(true);
        mPreviewSprite.gameObject.SetActive(false);
        mCharacterPreview.RotationY = 180;
        upDownAniHandler();

        if (mCharacterPreview != null)
        {
            mCharacterPreview.Enable = false;
        }

        if (mWingItemUIList.Count < mWingMoudle.GetWingPageCount())
        {
            for (int i = mWingItemUIList.Count + 1; i <= mWingMoudle.GetWingPageCount(); ++i)
            {
                CreateWingItem(i);
            }

            winggrid.GetComponent <UIGrid>().repositionNow = true;
        }
        else if (mWingItemUIList.Count > mWingMoudle.GetWingPageCount())
        {
            foreach (var wingItemUi in mWingItemUIList)
            {
                wingItemUi.Clear();
            }

            mWingItemUIList.Clear();
            Init();
        }
        mCharacterPreview.BackgroundSprite = mPreviewSprite;
        mCharacterPreview.SetTargetSprite(mPreviewSprite);
        mCharacterPreview.SetCameraOrthographicSize(1.5f);
        mCharacterPreview.RotationY = 180;
        upDownAniHandler();
        mIsDirty = true;
    }
Esempio n. 2
0
    private void InitUI()
    {
        EventSystem.Instance.addEventListener(CropsEvent.TAB_INDEX, SetTabIndex);
        EventSystem.Instance.addEventListener(CropsEvent.BUY_CROPS, OnCropsBuyHandler);
        EventSystem.Instance.addEventListener(CropsEvent.CHANGE_CROPS, OnChangeHandler);
        EventSystem.Instance.addEventListener(CropsEvent.RISE_STARS, OnRiseStarsHandler);
        EventDelegate.Add(mBtnCampBuy.onClick, OnBtnBuyCropsHandler);
        EventDelegate.Add(mBtnMainCrops.onClick, OnBtnSetMainCropsHandler);
        EventDelegate.Add(mBtnSubCrops.onClick, OnBtnSetSubCropsHandler);
        EventDelegate.Add(mBtnRiseStars.onClick, OnBtnRiseStarsHandler);
        UIEventListener.Get(mBtnSkill1.gameObject).onPress = OnBtnSkill1Press;
        UIEventListener.Get(mBtnSkill2.gameObject).onPress = OnBtnSkill2Press;
        UIEventListener.Get(mBtnSkill3.gameObject).onPress = OnBtnSkill3Press;

        InitCampUI();
        InitRiseStarsUI();

        mPreview.SetTargetSprite(mPreveiwSprite);
        mPreview.SetCameraOrthographicSize(1.5f);
        mPreview.RotationY = 180;
    }
Esempio n. 3
0
    protected override void OnOpen(object param = null)
    {
        base.OnOpen(param);
        mModule = ModuleManager.Instance.FindModule <FashionModule>();
        IDictionaryEnumerator enumerator = mItemDic.GetEnumerator();

        while (enumerator.MoveNext())
        {
            FashionItemUI item = enumerator.Value as FashionItemUI;
            item.clickCallBack = ItemClickCallBack;
        }
        EventDelegate.Add(mAddStarBtn.onClick, OnAddStartClick);
        EventDelegate.Add(mWearBtn.onClick, OnEquipClick);
        EventDelegate.Add(mBuyBtn.onClick, OnBuyBtnClick);
        EventSystem.Instance.addEventListener(FashionEvent.FASHION_ACTIVE, OnRespondActive);
        EventSystem.Instance.addEventListener(FashionEvent.FASHION_EQUIP, OnRespondEquip);
        mSelectedId = SelectedId;
        RefreshListPanel();
        if (mCharacterPreview != null)
        {
            mCharacterPreview.Enable = true;
        }

        Player player = PlayerController.Instance.GetControlObj() as Player;

        if (player != null)
        {
            mCharacterPreview.BackgroundSprite = mPreview;
            mCharacterPreview.SetTargetSprite(mPreview);
            mCharacterPreview.SetCameraOrthographicSize(1.2f);
            mCharacterPreview.RotationY = 180;
            mCharacterPreview.Pos       = new Vector3(-0.25f, 0, 0);
            mCharacterPreview.SetupCharacter(player.ModelID, null, -1, 0);
            PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>();
            mCharacterPreview.ChangeWeapon(pdm.GetMainWeaponId());
        }
    }
Esempio n. 4
0
    protected override void OnLoad()
    {
        base.OnLoad();

        mButtonReadMe       = FindComponent <UIButton>("mainContainer/Center/ReadMe");
        mButtonLeftBtn      = FindComponent <UIButton>("mainContainer/Center/PageLeft");
        mButtonRightBtn     = FindComponent <UIButton>("mainContainer/Center/PageRight");
        mLabelMyFight       = FindComponent <UILabel>("mainContainer/Bottom/MyFigh");
        mLabelMyFightTxt    = FindComponent <UILabel>("mainContainer/Bottom/MyFightTxt");
        mLabelRecomFight    = FindComponent <UILabel>("mainContainer/Bottom/RecomFight");
        mLabelScrib         = FindComponent <UILabel>("mainContainer/Bottom/Scrib");
        mLabelState         = FindComponent <UILabel>("mainContainer/Bottom/State/Label");
        mButtonOk           = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/OkBtn");
        mButtonSweep        = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/Sweep");
        mButtonBack         = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/Back");
        mButtonDoAgain      = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/DoAgain");
        mButtonRank         = FindComponent <UIButton>("mainContainer/Bottom/Paihang");
        mScrolV             = FindComponent <UIScrollView>("mainContainer/Center/Scroll View");
        mGridDrop           = FindComponent <UIGrid>("mainContainer/Bottom/DropGrid");
        mBtnGrid            = FindComponent <UIGrid>("mainContainer/Bottom/BtnGrid");
        mGridFloor          = FindComponent <UIGrid>("mainContainer/Center/Scroll View/Grid");
        mSpriteAchieveOne   = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve1");
        mSpriteAchieveTwo   = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve2");
        mSpriteAchieveThree = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve3");
        mLabelWeekScore     = FindComponent <UILabel>("mainContainer/Bottom/WeekScoreNum");
        mFirstDrop          = FindChild("mainContainer/Bottom/DropGrid/FirstDrop");
        mNormalDrop         = FindChild("mainContainer/Bottom/DropGrid/SecondDrop");
        mBackGround         = FindChild("BackGround");
        mExamRankItem       = FindChild("ViewItem");
        mExamRankItem.SetActive(false);
        mRankTween             = FindComponent <UIPlayTween>("rankContainer");
        mMainTween             = FindComponent <UIPlayTween>("mainContainer");
        mRankLeftTween         = FindComponent <TweenPosition>("rankContainer/left");
        mRankRightTween        = FindComponent <TweenPosition>("rankContainer/right");
        mMainTweenPos          = FindComponent <TweenPosition>("mainContainer");
        mMainTween.resetOnPlay = true;
        mRankTween.resetOnPlay = true;

        mRankNum       = FindComponent <UILabel>("rankContainer/right/ranknum");
        mPlayerName    = FindComponent <UILabel>("rankContainer/right/playername");
        mRankTimer     = FindComponent <UILabel>("rankContainer/right/awardIcon/timer");
        mShowAwardBtn  = FindComponent <UIButton>("rankContainer/right/awardIcon");
        mGoToChalBtn   = FindComponent <UIButton>("rankContainer/right/GotoChallenge");
        mSelfScore     = FindComponent <UILabel>("rankContainer/right/scorebg/Label");
        mScoreTip      = FindComponent <UILabel>("rankContainer/right/tip");
        mPreview       = FindComponent <UISprite>("rankContainer/right/Preview");
        mDizuo         = FindComponent <UISprite>("rankContainer/right/dizuo");
        mRankGuid      = FindComponent <UIGrid>("rankContainer/left/scrollView/itemguid");
        mRanAwardPanel = new ChaRankAwardUI(FindChild("RankAwardPanel"));
        mRanAwardPanel.mGameObject.SetActive(false);


        mExamChallengeBtn = FindChild("floorinfo");
        mExamChallengeBtn.gameObject.SetActive(false);
        mChalModule = ModuleManager.Instance.FindModule <ChallengeModule>();

        mCharacterPreview = new UICharacterPreview();
        mCharacterPreview.BackgroundSprite = mDizuo;
        mCharacterPreview.SetTargetSprite(mPreview);
        mCharacterPreview.SetCameraOrthographicSize(1.2f);
        mCharacterPreview.RotationY = 180;
        mCharacterPreview.Pos       = new Vector3(0, 0.3f, 0);
        mCharacterPreview.Enable    = true;
        //初始化
        InitUI();
    }