Example #1
0
    /// <summary>
    /// MAP背景画像を設定する.
    /// </summary>
    /// <param name="category">リージョンカテゴリ</param>
    /// <param name="fixId">MasterDataRegionのfix_id</param>
    private void SetAreaBackground(MasterDataDefineLabel.REGION_CATEGORY category, uint fixId, Action action)
    {
        if (m_AreaSelect == null)
        {
            return;
        }

        // デフォルトの背景を設定する.
        Sprite defaultSprite = null;

        switch (m_CurrentRegionMaster.category)
        {
        case MasterDataDefineLabel.REGION_CATEGORY.STORY:
            defaultSprite = m_AreaSelect.backgroundSprites[0];
            break;

        case MasterDataDefineLabel.REGION_CATEGORY.MATERIAL:
            defaultSprite = m_AreaSelect.backgroundSprites[1];
            break;

        case MasterDataDefineLabel.REGION_CATEGORY.EVENT:
            defaultSprite = m_AreaSelect.backgroundSprites[2];
            break;
        }

        var assetBundleName = string.Format("AreaBackGround_{0}", fixId);
        // 該当ファイルがAssetBundlePathMasterに存在しない場合は、カテゴリ毎のデフォルト画像を設定する.
        var assetBundlePath = MasterDataUtil.GetMasterDataAssetBundlePath(assetBundleName);

        if (assetBundlePath != null)
        {
            AssetBundler.Create().Set(
                assetBundleName, (o) =>
            {
                m_AreaSelect.BackGroundImage = o.GetAsset <Sprite>();
                if (action != null)
                {
                    action();
                }
            },
                (s) =>
            {
                m_AreaSelect.BackGroundImage = defaultSprite;
                if (action != null)
                {
                    action();
                }
            }
                ).Load();
        }
        else
        {
            m_AreaSelect.BackGroundImage = defaultSprite;
            if (action != null)
            {
                action();
            }
        }
    }
Example #2
0
    /// <summary>
    /// 選択保存:選択情報から遷移を設定
    /// </summary>
    /// <returns>設定されなかったら[false]を返す</returns>
    static public bool SetupSaveSelect()
    {
        bool bRet = false;

        switch (m_SaveSelectQuestType)
        {
        case MasterDataDefineLabel.QuestType.NORMAL:
        {
            //有効なエリアカテゴリかどうかチェック
            if (MainMenuUtil.CheckRNAreaCategory(m_SaveSelectAreaCategoryID))
            {
                //クエスト選択画面へ
                SetQuestSelectParam(m_SaveSelectAreaCategoryID, m_SaveSelectAreaID);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT, false, false);
            }
            else
            {
                //有効でない場合は属しているマップに遷移
                MasterDataDefineLabel.REGION_CATEGORY caegory = MainMenuUtil.GetRegionCategory(m_SaveSelectAreaCategoryID);
                MainMenuParam.m_RegionID = MasterDataUtil.GetRegionIDFromCategory(caegory);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT_AREA_STORY, false, false);
            }
        }
        break;

        case MasterDataDefineLabel.QuestType.CHALLENGE:
        {
            //有効な成長ボスイベントリスト取得
            List <MasterDataChallengeEvent> eventList = MasterDataUtil.GetActiveChallengeEvent();
            if (eventList.Count > 0)
            {
                //成長ボス選択画面へ
                SetChallengeSelectParam(m_SaveSelectChallengeQuestID);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_CHALLENGE_SELECT, false, false);
            }
            else
            {
                //表示できる成長ボスイベントが1つもない場合はイベントマップへ遷移
                MainMenuParam.m_RegionID = MasterDataUtil.GetRegionIDFromCategory(MasterDataDefineLabel.REGION_CATEGORY.EVENT);
                bRet = MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT_AREA_STORY, false, false);
            }
        }
        break;
        }
        return(bRet);
    }