Esempio n. 1
0
 private void Awake()
 {
     m_VideoName.gameObject.SetActive(false);
     m_Descripe.gameObject.SetActive(false);
     m_Extrainfo.gameObject.SetActive(false);
     m_PlayBtn.GetComponent <Image>().enabled = false;
     hoverRegion = m_Thumnail.gameObject.GetComponent <ARInteractiveItem>();
 }
    public void Init(GuildLuckyNvShenShakeResult resultData)
    {
        this.shakeResultData = resultData;
        /** 初始化结果显示 */
        string [] resultStrs = shakeResultData.getResultsString();
        for (int i = 0; i < resultStrs.Length; i++)
        {
            eblowViews[i].Init(resultStrs[i]);
        }
        /** 初始化结果描述 */
        List <PrizeSample> rewards = ShakeEblowsRewardSampleManager.Instance().GetPrizeByResult(shakeResultData);

        awardDes.text = Language("GuildLuckyNvShen_15");
        foreach (PrizeSample p in rewards)
        {
            awardDes.text += p.getPrizeName() + "+" + p.num + ",";
        }
        awardDes.text = awardDes.text.Substring(0, awardDes.text.Length - 1);

        /** 初始化按钮显示 */
        GuildLuckyNvShenInfo info = GuildManagerment.Instance.getGuildLuckyNvShenInfo();

        if (info != null)
        {
            if (info.reShakeCount <= 0)
            {
                buttonReshake.textLabel.text = Language("GuildLuckyNvShen_17") + "(0)";
                buttonReshake.GetComponent <UIButton>().isEnabled = false;
            }
            else
            {
                buttonReshake.textLabel.text = Language("GuildLuckyNvShen_17") + "(" + info.reShakeCount + ")";
                buttonReshake.GetComponent <UIButton>().isEnabled = true;
            }
        }
        /** 初始化规则描述 */
        List <ShakeEblowsRewardSample> allSample = ShakeEblowsRewardSampleManager.Instance().GetNormalShakeEblowRewardSamples();

        shakeRewardContent.Init(allSample);
        shakeRewardContent.otherDes.text = Colors.RED + ShakeEblowsRewardSampleManager.Instance().GetFiveDiffSample().getPrizesDesc();

        /** 初始化加锁信息 */
        lockEblows(GuildLuckyNvShenWindow.lockString);
        //MaskWindow.UnlockUI();
    }
Esempio n. 3
0
 /// <summary>
 /// 初始化按钮状态
 /// </summary>
 public void initButton()
 {
     rightButton.fatherWindow      = this;
     leftButton.fatherWindow       = this;
     winnerIconButton.fatherWindow = this;
     rightButton.onClickEvent      = doRightEvent;
     leftButton.onClickEvent       = doLeftEvent;
     winnerIconButton.onClickEvent = doViewWinnerInfo;
     winnerIconButton.GetComponent <Collider> ().enabled = false;
     if (defaultBigId == 2)
     {
         rightButton.gameObject.SetActive(false);
     }
     if (defaultBigId == 0)
     {
         leftButton.gameObject.SetActive(false);
     }
 }
Esempio n. 4
0
    public void changePraiseButton(bool bo)
    {
        if (!bo)
        {
            onekeyPraiseButton.disableButton(true);
//			onekeyPraiseButton.GetComponent<Collider>().enabled = false;
        }
        else
        {
            onekeyPraiseButton.spriteBg.spriteName = "button_big2";
            onekeyPraiseButton.GetComponent <Collider>().enabled = true;
        }
    }
Esempio n. 5
0
    /// <summary>
    /// CLOSE
    /// </summary>
    /// <param name="gameObj"></param>
    public override void buttonEventBase(GameObject gameObj)
    {
        base.buttonEventBase(gameObj);
        if (gameObj.name == "close")
        {
            finishWindow();
        }
        else if (gameObj.name == "guideButton")
        {
            guideButton.GetComponent <BoxCollider>().enabled = false;
            button1.GetComponent <BoxCollider>().enabled     = true;
            button2.GetComponent <BoxCollider>().enabled     = true;
            button3.GetComponent <BoxCollider>().enabled     = true;
            button4.GetComponent <BoxCollider>().enabled     = true;
            GuideManager.Instance.doFriendlyGuideEvent();
        }
//        else if (Time.time - start_Time >= timeJ)
//        {
//            MaskWindow.UnlockUI();
//        }
    }
Esempio n. 6
0
    // Update is called once per frame
    void Update()
    {
        bool bInit = false;

        if (m_eStepPre != m_eStep)
        {
            m_eStepPre = m_eStep;
            bInit      = true;
        }

        switch (m_eStep)
        {
        case STEP.NONE:
            break;

        case STEP.INIT:
            if (bInit)
            {
                m_iParentTutorialId = PlayerPrefs.GetInt(Define.KEY_TUTORIAL_PARENT_ID);
                m_iChildTutorialId  = 1;
                m_iTutorialIndex    = 0;
            }
            m_eStep = STEP.END;
            foreach (CsvTutorialData data in DataManager.csv_tutorial)
            {
                if (data.tutorial_parent_id == m_iParentTutorialId)
                {
                    m_eStep = STEP.COMMAND;
                }
            }
            break;

        case STEP.CHECK:

            if (0 < m_CurrentData.next_tutorial_child_id)
            {
                //Debug.Log( string.Format( "{0}:{1}" , m_eStep , m_CurrentData.next_tutorial_child_id ));
                m_iChildTutorialId = m_CurrentData.next_tutorial_child_id;
                m_iTutorialIndex   = 0;
                m_iSpriteIndex     = 0;

                foreach (UtilSwitchSprite switch_sprite in m_SpriteList)
                {
                    switch_sprite.Clear();
                }
            }
            m_eStep = STEP.COMMAND;
            break;

        case STEP.COMMAND:
            if (bInit)
            {
                m_CurrentData = GetTutorialData(m_iParentTutorialId, m_iChildTutorialId, m_iTutorialIndex);

                //あんま良くないけどいったんここでインクリメント
                m_iTutorialIndex += 1;
            }
            m_eStepNext = GetStep(m_CurrentData);

            m_eStep = m_eStepNext;            //= GetStep (m_CurrentData);
            break;

        case STEP.INPUT_LIMITED:
            GameMain.Instance.TutorialInputLock = true;

            if (m_CurrentData.string_param.Equals("monster"))
            {
                m_RectAll.SetActive(false);
                m_RectMonster.SetActive(true);
            }
            else
            {
                m_RectAll.SetActive(true);
                m_RectMonster.SetActive(false);
            }

            m_eStep = STEP.CHECK;

            break;

        case STEP.WHITE:

            if (m_CurrentData.string_param.Equals("display"))
            {
                m_sprWhite.alpha = 0.3f;
            }
            else
            {
                m_sprWhite.alpha = 0.0f;
            }
            m_eStep = STEP.CHECK;
            break;

        case STEP.IMAGE:
            if (bInit)
            {
                UtilSwitchSprite switch_sprite = m_SpriteList [m_iSpriteIndex];
                switch_sprite.gameObject.SetActive(true);
                switch_sprite.GetComponent <Fuwafuwa> ().enabled   = false;
                switch_sprite.GetComponent <Chikachika> ().enabled = false;

                switch_sprite.SetSprite(m_CurrentData.string_param,
                                        m_CurrentData.param1,
                                        m_CurrentData.param2,
                                        m_CurrentData.param3);

                if (m_CurrentData.param4 == 1)
                {
                    switch_sprite.GetComponent <Chikachika> ().enabled = true;
                }
                else if (m_CurrentData.param4 == 2)
                {
                    switch_sprite.GetComponent <Fuwafuwa> ().enabled = true;
                }
                else
                {
                }
                m_iSpriteIndex += 1;
            }
            m_eStep = STEP.CHECK;

            break;

        case STEP.TOUCH_SCREEN:

            bool btsEnd = true;

            foreach (UtilSwitchSprite sws in m_SpriteList)
            {
                if (sws.IsIdle() == false)
                {
                    btsEnd = false;
                }
            }
            if (btsEnd)
            {
                if (Input.GetMouseButtonUp(0) && SpriteManager.Instance.IsIdle())
                {
                    m_eStep = STEP.CHECK;
                }
            }
            break;

        case STEP.TOUCH_RECT:
            if (bInit)
            {
                //m_btnHitRect.GetComponent<BoxCollider> ().bounds.center = new Vector3 ((float)m_CurrentData.param1, (float)m_CurrentData.param2, 0.0f);
                //m_btnHitRect.GetComponent<BoxCollider> ().bounds.size = new Vector3 ((float)m_CurrentData.param3, (float)m_CurrentData.param4, 0.0f);
                m_btnHitRect.GetComponent <BoxCollider> ().center = new Vector3((float)m_CurrentData.param1, (float)m_CurrentData.param2, -100.0f);
                m_btnHitRect.GetComponent <BoxCollider> ().size   = new Vector3((float)m_CurrentData.param3, (float)m_CurrentData.param4, 0.0f);
                m_btnHitRect.TriggerClear();
            }


            if (m_btnHitRect.ButtonPushed)
            {
                bool btsEnd2 = true;

                foreach (UtilSwitchSprite sws in m_SpriteList)
                {
                    if (sws.IsIdle() == false)
                    {
                        btsEnd2 = false;
                    }
                }
                m_btnHitRect.TriggerClear();
                if (btsEnd2)
                {
                    ActionTouchRect(m_CurrentData);
                    m_eStep = STEP.CHECK;
                }
            }
            break;

        case STEP.WAIT:
            if (bInit)
            {
                m_fWaitTimer = 0.0f;
            }
            m_fWaitTimer += Time.deltaTime;
            if ((float)m_CurrentData.param1 < m_fWaitTimer)
            {
                m_eStep = STEP.CHECK;
            }
            break;

        case STEP.BANNER:
            GameMain.Instance.SwitchSetting = 1;
            if (m_CurrentData.string_param.Equals("monster") == true)
            {
                GameMain.Instance.TutorialMonster = m_CurrentData.param1;
            }
            m_eStep = STEP.CHECK;
            break;

        case STEP.END_PARENT:
            int iParentTutorialId = 0;
            if (PlayerPrefs.HasKey(Define.KEY_TUTORIAL_PARENT_ID))
            {
                iParentTutorialId = PlayerPrefs.GetInt(Define.KEY_TUTORIAL_PARENT_ID);
            }
            else
            {
                iParentTutorialId = 1;                          // ない場合は
            }
            PlayerPrefs.SetInt(Define.KEY_TUTORIAL_PARENT_ID, iParentTutorialId + 1);
            m_eStep = STEP.INIT;
            break;

        case STEP.FINISH:
            PlayerPrefs.SetInt(Define.KEY_TUTORIAL_PARENT_ID, 99);
            m_eStep = STEP.INIT;
            break;

        case STEP.END:
            // STAY!
            GameMain.Instance.TutorialInputLock = false;

            gameObject.SetActive(false);
            break;

        default:
            break;
        }
    }
Esempio n. 7
0
    void initWin()
    {
        if (ArmyManager.Instance.ActiveEditArmy == null)
        {
            //复制用于编辑阵形
            ArmyManager.Instance.EditArmy1 = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(1));
            ArmyManager.Instance.EditArmy2 = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(2));
            ArmyManager.Instance.EditArmy3 = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(3));
            ArmyManager.Instance.EditArmy4 = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(4));
            ArmyManager.Instance.EditArmy5 = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(5));
            ArmyManager.Instance.EditArmy6 = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(6));

            if (ArmyManager.Instance.getActiveArmy() == ArmyManager.Instance.getArmy(1))
            {
                buttonTeamChoose.textLabel.text     = LanguageConfigManager.Instance.getLanguage("s0066");
                ArmyManager.Instance.ActiveEditArmy = ArmyManager.Instance.EditArmy1;
            }
            else if (ArmyManager.Instance.getActiveArmy() == ArmyManager.Instance.getArmy(2))
            {
                buttonTeamChoose.textLabel.text     = LanguageConfigManager.Instance.getLanguage("s0067");
                ArmyManager.Instance.ActiveEditArmy = ArmyManager.Instance.EditArmy2;
            }
            else if (ArmyManager.Instance.getActiveArmy() == ArmyManager.Instance.getArmy(3))
            {
                buttonTeamChoose.textLabel.text     = LanguageConfigManager.Instance.getLanguage("s0068");
                ArmyManager.Instance.ActiveEditArmy = ArmyManager.Instance.EditArmy3;
            }
            else if (ArmyManager.Instance.getActiveArmy() == ArmyManager.Instance.getArmy(4))
            {
                buttonTeamChoose.textLabel.text     = LanguageConfigManager.Instance.getLanguage("mining_team1");
                ArmyManager.Instance.ActiveEditArmy = ArmyManager.Instance.EditArmy4;
            }
            else if (ArmyManager.Instance.getActiveArmy() == ArmyManager.Instance.getArmy(5))
            {
                buttonTeamChoose.textLabel.text     = LanguageConfigManager.Instance.getLanguage("mining_team2");
                ArmyManager.Instance.ActiveEditArmy = ArmyManager.Instance.EditArmy5;
            }
            else if (ArmyManager.Instance.getActiveArmy() == ArmyManager.Instance.getArmy(6))
            {
                buttonTeamChoose.textLabel.text     = LanguageConfigManager.Instance.getLanguage("GuildArea_101");
                ArmyManager.Instance.ActiveEditArmy = ArmyManager.Instance.EditArmy6;
            }
            else
            {
                buttonTeamChoose.textLabel.text     = LanguageConfigManager.Instance.getLanguage("s0066");
                ArmyManager.Instance.ActiveEditArmy = ArmyManager.Instance.EditArmy1;
            }
            formationLength = ArmyManager.Instance.ActiveEditArmy.getLength();
            //整型容器初始化
            content.maxCount           = FormationManagerment.Instance.getPlayerFormation().Count;
            content.onCenterItem       = onCenterFormationPage;
            content.callbackUpdateEach = updateActive;
            content.fatherWindow       = this;
            content.init();

            switch (comeFrom)
            {
            case FROM_PVP:
            case FROM_LADDERS:
                teamSwitch(3);
                setTitle(LanguageConfigManager.Instance.getLanguage("s0068") + LanguageConfigManager.Instance.getLanguage("teamEdit10"));
                break;

//            case FROM_TOWER:
//                teamSwitch(3);
//                setTitle(LanguageConfigManager.Instance.getLanguage("s0068l0") + LanguageConfigManager.Instance.getLanguage("teamEdit10"));
//                break;
            case FROM_PVE:
                teamSwitch(1);
                setTitle(LanguageConfigManager.Instance.getLanguage("s0066") + LanguageConfigManager.Instance.getLanguage("teamEdit10"));
                break;

            case FROM_MINING:
                miningDesc.gameObject.SetActive(true);
                ShowMiningSpeedInfo();
                teamSwitch(showTeamId);
                break;

            case FROM_GUILD:
                teamSwitch(6);
                setTitle(LanguageConfigManager.Instance.getLanguage("GuildArea_101") + LanguageConfigManager.Instance.getLanguage("teamEdit10"));
                break;

            default:
                teamSwitch(1);
                break;
            }
//			if (comeFrom == FROM_PVP || comeFrom == FROM_LADDERS) {
//				teamSwitch (3);
//				setTitle (LanguageConfigManager.Instance.getLanguage ("s0068") + LanguageConfigManager.Instance.getLanguage ("teamEdit10"));
//			}
//			else {
//				if (comeFrom == FROM_PVE) {
//					setTitle (LanguageConfigManager.Instance.getLanguage ("s0066") + LanguageConfigManager.Instance.getLanguage ("teamEdit10"));
//				}
//				teamSwitch (1);
//			}
        }
        if (!isAwakeformHide)
        {
            PlayCardAnimation();
        }
        else
        {
            reLoadTeam();
            //StartCoroutine (Utils.DelayRun (()=>{
            //    MaskWindow.UnlockUI();
            //},0.3f));
        }
        if (chooseButton != null)
        {
            chooseButton.updateCard();
        }

        GuideManager.Instance.guideEvent();

        //这里控制新手引导期间,不可以拖拽卡片,避免造成卡死
        if (GuideManager.Instance.isEqualStep(GuideGlobal.SPECIALSID3) || GuideManager.Instance.isEqualStep(GuideGlobal.SPECIALSID33) ||
            GuideManager.Instance.isEqualStep(GuideGlobal.SPECIALSID34) || GuideManager.Instance.isEqualStep(GuideGlobal.SPECIALSID35))
        {
            buttonTeamChoose.GetComponent <BoxCollider> ().enabled = false;
            saveButton.GetComponent <BoxCollider> ().enabled       = false;
            for (int i = 0; i < teamForRole.Length; i++)
            {
                teamForRole [i].GetComponent <TeamEditDragDropItem> ().enabled     = false;
                teamForRole [i].GetComponent <TeamEditDragDropItem> ().cloneOnDrag = true;
            }
            for (int i = 0; i < teamSubRole.Length; i++)
            {
                teamSubRole [i].GetComponent <TeamEditDragDropItem> ().enabled     = false;
                teamSubRole [i].GetComponent <TeamEditDragDropItem> ().cloneOnDrag = true;
            }
        }
        else
        {
            buttonTeamChoose.GetComponent <BoxCollider> ().enabled = true;
//			saveButton.GetComponent<BoxCollider> ().enabled = true;
            if (ArmyManager.Instance.CheckActiveEditArrayIsEmpty())
            {
                saveButton.disableButton(true);
            }
            else
            {
                saveButton.disableButton(false);
            }
            for (int i = 0; i < teamForRole.Length; i++)
            {
                teamForRole [i].GetComponent <TeamEditDragDropItem> ().enabled     = true;
                teamForRole [i].GetComponent <TeamEditDragDropItem> ().cloneOnDrag = false;
            }
            for (int i = 0; i < teamSubRole.Length; i++)
            {
                teamSubRole [i].GetComponent <TeamEditDragDropItem> ().enabled     = true;
                teamSubRole [i].GetComponent <TeamEditDragDropItem> ().cloneOnDrag = false;
            }
        }
        openEmptyForLevel();
        openEmptyForLevelNew();
        GuideManager.Instance.doFriendlyGuideEvent();
    }
 void disableButton()
 {
     buttonLearn.GetComponent <UIImageButton> ().isEnabled = false;
     buttonLearn.textLabel.color       = Color.gray;
     buttonLearn.textLabel.effectColor = Color.black;
 }