Open wuxinwei opened 8 years ago
The other option is to include a "Resources" file or point to a file with the AssetDatabase instead and load it from there. I had a similar problem with a Shader I could no longer use in Unity 5.
@KellanHiggins ,yeah, that's another way to fix this, but I still use unity5.2 built-in shader may be better, anyway thany you for your advise.
Hi All,
Yeah, there is going to be a lot of small Unity incompatibilities building up in this old project. If your solution doesn't work in all situations, here is the full Unity recommended configuration. Found it somewhere when I was upgrading code in the utilities project:
/// <summary>
/// A shared material suitable for simple drawing operations.
/// </summary>
public static Material SimpleMaterial
{
get
{
if (!mSimpleMaterial)
{
var shader = Shader.Find("Hidden/Internal-Colored");
mSimpleMaterial = new Material(shader);
mSimpleMaterial.hideFlags = HideFlags.HideAndDontSave;
// Turn on alpha blending
mSimpleMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
mSimpleMaterial.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
// Turn backface culling off
mSimpleMaterial.SetInt("_Cull", (int)UnityEngine.Rendering.CullMode.Off);
// Turn off depth writes
mSimpleMaterial.SetInt("_ZWrite", 0);
}
return mSimpleMaterial;
}
}
ok, thanks again, Stephen
..\critterai-master\src\main\Assets\CAI\util-u3d\DebugDraw.cs