Exemplo n.º 1
0
    //プレハブからの生成情報を取得
    static string GetFileInfo(string _assetbundleName, string _folderName, AssetBundleInfo.InfoType _infoType)
    {
        string buildURL = SystemSetting.GetResourcesAssetSrcPath() + _assetbundleName + "Prefab";

        UnityEngine.Object[] gameObjectArray = Resources.LoadAll(buildURL, typeof(GameObject));

        Debug.LogWarning("生成情報" + buildURL);

        AssetBundleInfo info;
        string          returnString = "";

        foreach (var item in gameObjectArray)
        {
            GameObject obj = (GameObject)item as GameObject;
            info = obj.GetComponent <AssetBundleInfo> ();

            if (info != null)
            {
                switch (_infoType)
                {
                case AssetBundleInfo.InfoType.MAKETIME:
                    returnString = info.makeTime;
                    break;

                case AssetBundleInfo.InfoType.LASTAUTHER:
                    returnString = info.lastAuthor;
                    break;

                case AssetBundleInfo.InfoType.VERID:
                    returnString = info.verID.ToString();
                    break;

                default:
                    Debug.LogError("データ設定に異常があります");
                    break;
                }
            }
        }

        return(returnString);
    }
Exemplo n.º 2
0
    static string GetAssetBundleFileInfo(string _assetbundleName, string _folderName, AssetBundleInfo.InfoType _infoType)
    {
        GameObject      obj  = GetAssetBundleInfo(_assetbundleName, _folderName);
        AssetBundleInfo info = obj.GetComponent <AssetBundleInfo> ();

        string returnString = "";

        if (info != null)
        {
            switch (_infoType)
            {
            case AssetBundleInfo.InfoType.MAKETIME:
                returnString = info.makeTime;
                break;

            case AssetBundleInfo.InfoType.LASTAUTHER:
                returnString = info.lastAuthor;
                break;

            case AssetBundleInfo.InfoType.VERID:
                returnString = info.verID.ToString();
                break;

            default:
                Debug.LogError("データ設定に異常があります");
                break;
            }
        }

        DestroyImmediate(obj);
        return(returnString);
    }