コード例 #1
0
ファイル: AnimationInfo.cs プロジェクト: FTD2012/AssetViewer
        public static AnimationInfo CreateAnimationInfo(string assetPath)
        {
            AnimationInfo mInfo = null;

            if (!_dictMatInfo.TryGetValue(assetPath, out mInfo))
            {
                mInfo = new AnimationInfo();
                _dictMatInfo.Add(assetPath, mInfo);
            }

            ModelImporter tImporter = AssetImporter.GetAtPath(assetPath) as ModelImporter;

            if (tImporter == null || tImporter.clipAnimations == null)
            {
                return(null);
            }

            mInfo.Path                 = assetPath;
            mInfo.AnimationType        = tImporter.animationType;
            mInfo.AnimationCompression = tImporter.animationCompression;
            mInfo.MemSize              = EditorTool.CalculateAnimationSizeBytes(assetPath);

            if (++_loadCount % 256 == 0)
            {
                Resources.UnloadUnusedAssets();
            }

            return(mInfo);
        }