public static void SetTextureArray(this JContainer jsonNode, string key, Texture2DArrayData value)
        {
            var assetData = SerializeObject.SerializeAsset(value);
            var uri       = ExportSetting.instance.GetExportPath(assetData.uri);

            jsonNode.Add(new JProperty(key, uri));
        }
 public static void SetCubemap(this JContainer jsonNode, string key, Cubemap value, Cubemap defalutValue = null)
 {
     if (value != defalutValue)
     {
         var assetData = SerializeObject.SerializeAsset(value);
         var uri       = ExportSetting.instance.GetExportPath(assetData.uri);
         jsonNode.Add(new JProperty(key, uri));
     }
 }
        public static void SetAnimation(this JObject jsonNode, UnityEngine.GameObject obj, UnityEngine.AnimationClip[] animationClips)
        {
            var exportAnimations = new JArray();

            jsonNode.Add("_animations", exportAnimations);
            foreach (var animationClip in animationClips)
            {
                var asset      = SerializeObject.SerializeAsset(animationClip);
                var assetIndex = SerializeObject.currentData.AddAsset(asset);
                exportAnimations.AddAsset(assetIndex);
            }
        }
        public static void SetMesh(this JContainer jsonNode, UnityEngine.GameObject obj, UnityEngine.Mesh mesh)
        {
            if (mesh == null)
            {
                return;
            }

            var asset      = SerializeObject.SerializeAsset(mesh);
            var assetIndex = SerializeObject.currentData.AddAsset(asset);

            jsonNode.SetAsset("mesh", assetIndex);
        }
        public static void SetLightmaps(this JObject jsonNode, string exportPath)
        {
            var lightmapsJson = new JArray();

            jsonNode.Add("lightmaps", lightmapsJson);
            foreach (var lightmapData in LightmapSettings.lightmaps)
            {
                Texture2D lightmap   = lightmapData.lightmapColor;
                var       asset      = SerializeObject.SerializeAsset(lightmap);
                var       assetIndex = SerializeObject.currentData.AddAsset(asset);
                lightmapsJson.AddAsset(assetIndex);
            }
        }
        public static void SetMaterials(this JObject jsonNode, UnityEngine.GameObject obj, UnityEngine.Material[] materials, bool isParticleMat = false, bool isAnimationMat = false)
        {
            var materialsItem = new JArray();

            jsonNode.Add("materials", materialsItem);
            //写材质
            foreach (var material in materials)
            {
                if (material == null)
                {
                    UnityEngine.Debug.LogWarning(obj.gameObject.name + " 材质缺失,请检查资源");
                    continue;
                }

                var asset      = SerializeObject.SerializeAsset(material);
                var assetIndex = SerializeObject.currentData.AddAsset(asset);
                materialsItem.AddAsset(assetIndex);
            }
        }