29 lines
689 B
C#
29 lines
689 B
C#
|
using System;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace Thousandto.Core.Base
|
|||
|
{
|
|||
|
//Shader的扩展类
|
|||
|
public static class ShaderEx
|
|||
|
{
|
|||
|
//Shader的自定义查找
|
|||
|
private static Func<string, Shader> _findCustomHandler = null;
|
|||
|
|
|||
|
//设置Shader的自定义查找句柄
|
|||
|
public static void SetFindCustomHandler(Func<string, Shader> func)
|
|||
|
{
|
|||
|
_findCustomHandler = func;
|
|||
|
}
|
|||
|
|
|||
|
//Shader的查找函数
|
|||
|
public static Shader Find(string name)
|
|||
|
{
|
|||
|
if (_findCustomHandler != null)
|
|||
|
{
|
|||
|
return _findCustomHandler(name);
|
|||
|
}
|
|||
|
return Shader.Find(name);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|