add some extra assets FX and SFX

This commit is contained in:
Robii Aragon
2026-03-29 23:03:14 -07:00
parent 6ef3eb1535
commit 24dc66a81e
10142 changed files with 2535978 additions and 36608 deletions

View File

@@ -0,0 +1,38 @@
using System;
using UnityEditor;
using UnityEngine;
namespace CartoonFX
{
namespace CustomShaderImporter
{
public class CFXR_ShaderPostProcessor : AssetPostprocessor
{
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
CleanCFXRShaders(importedAssets);
}
static void CleanCFXRShaders(string[] paths)
{
foreach (var assetPath in paths)
{
if (!assetPath.EndsWith(CFXR_ShaderImporter.FILE_EXTENSION, StringComparison.InvariantCultureIgnoreCase))
{
continue;
}
var shader = AssetDatabase.LoadMainAssetAtPath(assetPath) as Shader;
if (shader != null)
{
ShaderUtil.ClearShaderMessages(shader);
if (!ShaderUtil.ShaderHasError(shader))
{
ShaderUtil.RegisterShader(shader);
}
}
}
}
}
}
}