public override void SerializePCF(GameObject go, string outputDirectory, Action <bool, string> OnComplete)
        {
            Debug.Log("serialize generic object to directory: " + outputDirectory);

            DirectoryInfo outDir = new DirectoryInfo(outputDirectory);

            if (!outDir.Exists)
            {
                outDir.Create();
            }

            //These export objects are custom to our project, override if specific behaviour needed.
            object[] opts = new object[4];
            opts[0] = new TextureSerializeOpts(TexturePackageOptions.ASTCPackage);
            opts[1] = new AvatarSerializeOpts("Transform");
            opts[2] = new AudioSerializeOpts();
            opts[3] = new LightprobeSerializeOpts(Path.Combine(Application.dataPath, "LightingData"));

            string outputFile = Path.Combine(outputDirectory, go.name + ".pcf");

            ExportUtils.AddVersionInfo(go);
            SerializeContent(go, opts, outputDirectory, outputFile, PCFfileType.Unknown);
            ExportUtils.AddChecksum(outputFile);

            OnComplete(true, "Success exporting content: " + go.name);
        }
        public override void Serialize(SerializedAssets serializedAssets, object[] serializeOptions, NodeBase objNode, List <Action <NodeBase> > postserializeActions)
        {
            if (this.audioClip == null)
            {
                Debug.Log("Missing audio clip! If this is intentional ignore this message.");
                return;
            }

                        #if UNITY_EDITOR
            //Make sure this is always 36 characters long.
            this.referenceID = this.rootNode.GenerateID();

            AudioSerializeOpts serializeOption = null;
            for (int i = 0; i < serializeOptions.Length; i++)
            {
                object opt = serializeOptions[i];

                if (opt is AudioSerializeOpts)
                {
                    serializeOption = opt as AudioSerializeOpts;
                    break;
                }
            }

            if (serializeOption == null)
            {
                return;
            }

            ComponentNode scriptNode = new ComponentNode(PCFResourceType.AUDIO, referenceID, null, typeof(UnityEngine.AudioClip).Name.ToString());

            objNode.AddChildNode(scriptNode);

            bool   streamed  = true;
            byte[] audioData = serializeOption.PackageAudio(audioClip, serializedAssets, this.referenceID, ref streamed);

            JObject metaData = new JObject();
            metaData["fieldName"]  = this.fieldName;
            metaData["arrayItem"]  = this.arrayItem;
            metaData["name"]       = this.audioClip.name;
            metaData["sampleRate"] = this.audioClip.frequency;
            metaData["channels"]   = this.audioClip.channels;
            metaData["samples"]    = this.audioClip.samples * this.audioClip.channels;
            metaData["streamed"]   = streamed;

            byte[] metaDataBuffer = System.Text.Encoding.UTF8.GetBytes(metaData.ToString(Formatting.None));

            AssetResource resource = new AssetResource(true);
            resource.Serialize(referenceID, MetaDataType.JSON, metaDataBuffer, audioData);

            serializedAssets.AddResource(referenceID, PCFResourceType.AUDIO, resource);
                        #endif
        }