コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public unsafe static long $Invoke4(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(UnityUtils.CreateMaterial((Shader)GCHandledObjects.GCHandleToObject(*args))));
 }