public static bool SaveLightShowVideo(LightShowVideo video, bool reimport = true)
    {
        if (video == null)
        {
            return(false);
        }
        if (string.IsNullOrEmpty(video.Data.AssetGuid))
        {
            return(false);
        }

        var assetPath = AssetDatabase.GUIDToAssetPath(video.Data.AssetGuid);

        if (string.IsNullOrEmpty(assetPath))
        {
            return(false);
        }

        var jsonString = JsonUtility.ToJson(video.Data, true);

        File.WriteAllText(assetPath, jsonString);
        if (reimport)
        {
            AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);
        }
        Debug.Log("Saved");
        return(true);
    }
    public static void CreateLightShowVideo(int instanceID, string assetPath, LightShowVideo video, bool refreshAsset = true)
    {
        if (video == null || string.IsNullOrEmpty(assetPath))
        {
            return;
        }
        var jsonString = JsonUtility.ToJson(video.Data, true);

        Debug.Log(jsonString);
        File.WriteAllText(assetPath, jsonString);
        if (refreshAsset)
        {
            AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);
        }
    }
    public override void OnImportAsset(AssetImportContext ctx)
    {
        var lightShowVideo = FileUtility.LoadLightShowVideo(ctx.assetPath);
        var icon           = Resources.Load <Texture2D>("projector");

        if (string.IsNullOrEmpty(lightShowVideo.AssetGuid) || lightShowVideo.AssetGuid != AssetDatabase.AssetPathToGUID(ctx.assetPath))
        {
            var assetGuid = AssetDatabase.AssetPathToGUID(ctx.assetPath);
            lightShowVideo.SetAssetGuid(assetGuid);
        }

        Instance = lightShowVideo;
        ctx.AddObjectToAsset("MainAsset", lightShowVideo, icon);
        ctx.SetMainObject(lightShowVideo);
        Debug.Log("Imported");
    }