Beispiel #1
0
        private object GetAudioClipPropertyValue(AudioClip clip)
        {
            if (clip == null) return null;
            var assetPath = AssetDatabase.GetAssetPath(clip);
            if (String.IsNullOrEmpty(assetPath)) return null;

            var assetName = Path.GetFileName(assetPath);
            var outputPath = Path.Combine(babylonScene.OutputPath, assetName);
            File.Copy(assetPath, outputPath, true);
            Dictionary<string, object> assetInfo = new Dictionary<string, object>();
            assetInfo.Add("type", clip.GetType().FullName);
            assetInfo.Add("filename", assetName);
            assetInfo.Add("length", clip.length);
            assetInfo.Add("channels", clip.channels);
            assetInfo.Add("frequency", clip.frequency);
            assetInfo.Add("samples", clip.samples);
            return assetInfo;
        }