public static Material CreateBuildingColorMaterial() { Material material = null; AssetManager assetManager = Service.Get <AssetManager>(); if (assetManager != null) { GameShaders shaders = assetManager.Shaders; if (shaders != null) { Shader shader = shaders.GetShader("Grid_Building_Color_PL"); material = UnityUtils.CreateMaterial(shader); } } if (material == null) { throw new Exception("Unable to create color material"); } return(material); }
public static Material CreateColorMaterial(Color32 color) { Material material = null; AssetManager assetManager = Service.Get <AssetManager>(); if (assetManager != null) { GameShaders shaders = assetManager.Shaders; if (shaders != null) { Shader shader = shaders.GetShader("SimpleSolidColor"); material = UnityUtils.CreateMaterial(shader); } } if (material == null) { throw new Exception("Unable to create color material"); } material.SetColor("_Pigment", color); return(material); }
public unsafe static long $Invoke4(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(UnityUtils.CreateMaterial((Shader)GCHandledObjects.GCHandleToObject(*args)))); }