IEnumerator loadCutSceneSoundAssetCT(Callback.Default callback)
    {
        string path = AssetBundleManager.getCutSceneSoundBundlePath(GameManager.me.stageManager.nowRound.id.ToUpper(), true);

#if UNITY_EDITOR
        if (CutSceneMaker.instance.useCutSceneMaker)
        {
            string csi = CutSceneMaker.instance.nowCutSceneId.ToUpper();

            string[] c = csi.Split('_');

            path = AssetBundleManager.getCutSceneSoundBundlePath(c[0], true);
        }
#endif

        using (WWW asset = new WWW(path))
        {
            yield return(asset);

            if (asset == null || asset.error != null || asset.isDone == false)
            {
#if UNITY_EDITOR
                Debug.LogError("err: " + asset.error.ToString() + "   path : " + path);
#endif
            }
            else if (asset != null && asset.assetBundle != null)
            {
                UnityEngine.Object[] clips = asset.assetBundle.LoadAll(typeof(AudioClip));

                foreach (UnityEngine.Object ac in clips)
                {
                    if (_cutsceneDic.ContainsKey(ac.name) == false)
                    {
                        _cutsceneDic.Add(ac.name, ac as AudioClip);
                    }
                }

                asset.assetBundle.Unload(false);
            }

            if (asset != null)
            {
                asset.Dispose();
            }

#if UNITY_EDITOR
            Debug.Log("CutScene Sound Load Complete!");
#endif
        }

        nowLoadingCutSceneAsset = false;
        if (callback != null)
        {
            callback();
        }
    }
    IEnumerator loadTutorialSoundAssetCT(Callback.Default callback)
    {
        string path = AssetBundleManager.getTutorialSoundBundlePath(TutorialManager.instance.nowTutorialId, true);

        using (WWW asset = new WWW(path))
        {
            yield return(asset);

            if (asset == null || asset.error != null || asset.isDone == false)
            {
#if UNITY_EDITOR
                Debug.LogError("err: " + asset.error.ToString() + "   path : " + path);
#endif
            }
            else if (asset != null && asset.assetBundle != null)
            {
                UnityEngine.Object[] clips = asset.assetBundle.LoadAll(typeof(AudioClip));

                foreach (UnityEngine.Object ac in clips)
                {
                    string sName   = ac.name;
                    int    keyName = Convert.ToInt32(sName);
                    if (_tutorialDic.ContainsKey(keyName) == false)
                    {
                        _tutorialDic.Add(keyName, ac as AudioClip);
                    }
                }

                asset.assetBundle.Unload(false);
            }

            if (asset != null)
            {
                asset.Dispose();
            }

#if UNITY_EDITOR
            Debug.Log("Tutorial Sound Load Complete!");
#endif
        }

        callback();
    }
    protected override void onClickClose(GameObject go)
    {
        if (showItemTabBeforeClose && UIShopItemList.type == ShopItem.Type.ruby)
        {
            onClickEquip(null);
            showItemTabBeforeClose = false;
            return;
        }

        GameManager.me.uiManager.uiMenuCamera.enabled  = true;
        GameManager.me.uiManager.uiMenu.camera.enabled = true;
        GameManager.me.uiManager.uiMenu.uiLobby.chracterCamera.enabled = true;

        base.onClickClose(go);

        if (SHOUL_REFRESH_INVEN_LIST)
        {
            if (GameManager.me.uiManager.uiMenu.currentPanel == UIMenu.HERO)
            {
                GameManager.me.uiManager.uiMenu.uiHero.refreshList();
            }
            else if (GameManager.me.uiManager.uiMenu.currentPanel == UIMenu.SKILL)
            {
                GameManager.me.uiManager.uiMenu.uiSkill.refreshSkillInven();
            }
            else if (GameManager.me.uiManager.uiMenu.currentPanel == UIMenu.SUMMON)
            {
                GameManager.me.uiManager.uiMenu.uiSummon.refreshUnitInven();
            }
        }

        if (callbackAfterShopClose != null)
        {
            callbackAfterShopClose();
            callbackAfterShopClose = null;
        }
    }
 public void loadTutorialSoundAsset(Callback.Default callback)
 {
     _tutorialDic.Clear();
     StartCoroutine(loadTutorialSoundAssetCT(callback));
 }
 public void loadCutSceneSoundAsset(Callback.Default callback)
 {
     nowLoadingCutSceneAsset = true;
     StartCoroutine(loadCutSceneSoundAssetCT(callback));
 }
示例#6
0
    public void setData(P_Package pData, Callback.Default closeCallback)
    {
        _data = pData;

        _closeCallback = closeCallback;

        if (lbPrice != null)
        {
                #if UNITY_ANDROID
            lbPrice.text = Util.GetCommaScore(Mathf.RoundToInt(_data.price));
                #else
            lbPrice.text = string.Format("{0:F2}", _data.price);
                #endif
        }

        if (string.IsNullOrEmpty(_data.imageUrl) == false)
        {
            uiContainer.gameObject.SetActive(false);
            photo.gameObject.SetActive(true);
            return;
        }

        photo.gameObject.SetActive(false);
        uiContainer.gameObject.SetActive(true);

        switch (_data.category)
        {
        case SpecialPackage.RUNE:

            if (_data.subcategory != null)
            {
                switch (_data.subcategory)
                {
                case SpecialPackage.UNIT:
                    spItemIcon.spriteName = "img_package_animal";
                    break;

                case SpecialPackage.SKILL:
                    spItemIcon.spriteName = "img_package_skill";
                    break;

                case SpecialPackage.EQUIP:
                    spItemIcon.spriteName = "img_package_hero";
                    break;
                }
            }

            break;

        case SpecialPackage.SPECIAL:

            if (spItemIcon != null)
            {
                switch (_data.showWeight)
                {
                case 0:
                    spItemIcon.spriteName = "img_package_special2";
                    break;

                case 1:
                    spItemIcon.spriteName = "img_package_special1";
                    break;
                }
            }

            break;

        case SpecialPackage.STARTER:

            switch (_data.showWeight)
            {
            case 0:
                spItemIcon.spriteName = "img_package_start2";
                break;

            case 1:
                spItemIcon.spriteName = "img_package_start1";
                break;
            }

            break;
        }
    }