示例#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();
            }
        }
    }
示例#2
0
    public AssetBundler Create(MasterDataChallengeEvent eventMaster, Action finish = null, Action fail = null)
    {
        string assetbundleName = (eventMaster.bg_assetbundle_name == null) ? "" : eventMaster.bg_assetbundle_name;

        if (MasterDataUtil.GetMasterDataAssetBundlePath(assetbundleName) == null)
        {
            assetbundleName = "Areamap_default";
        }
        return(Create(assetbundleName, finish, fail));
    }
示例#3
0
    public AssetBundler Set(string assetBundleName, string assetName, System.Type type, Action <AssetBundlerResponse> finishAction = null, Action <string> error = null)
    {
        setAction(finishAction, error);

        this.assetBundleName = assetBundleName.ToLower();
        this.assetName       = assetName;
        this.type            = type;

        assetbundlepath = MasterDataUtil.GetMasterDataAssetBundlePath(this.assetBundleName, false);

#if BUILD_TYPE_DEBUG
        gameObject.name = "AssetBundler::" + assetBundleName + "::" + assetName + "::" + type.ToString();
        Debug.Log("CALL AssetBundler#Set:" + gameObject.name);
#endif
        return(this);
    }