Exemplo n.º 1
0
    void Start()
    {
        TextureGenerator window_textures = GetComponent <TextureGenerator>();

        Material material1 = new Material(Shader.Find("Unlit/Texture"));
        Material material2 = new Material(Shader.Find("Unlit/Texture"));

        window_textures.Generate();
        material1.mainTexture = window_textures.getTexture(1);

        material2.mainTexture = window_textures.getTexture(2);

        building.materials = new List <Material>();
        building.materials.Add(material1);
        building.materials.Add(material2);

        int i = 0;

        for (float x = -size.x / 2f; x < size.x / 2f; x++)
        {
            for (float y = -size.y / 2f; y < size.y / 2f; y++)
            {
                Instantiate(building, new Vector3(3f * x, 0f, 3f * y), Quaternion.identity);
                i++;
            }
        }
        Debug.Log(i + " buildings generated");
    }
    private void EditorGUI()
    {
        TextureGenerator textureGenerator = (TextureGenerator)target;

        if (GUILayout.Button("Generate"))
        {
            textureGenerator.Generate();
        }
    }
Exemplo n.º 3
0
        public RevCounter(VehicleChassis vehicle)
        {
            _chassis = vehicle;

            x = 0.01f;
            y = 0.8f;
            if (GameVars.Emulation == EmulationMode.Demo)
            {
                PixFile pix = new PixFile("tacho.pix");
                _speedoTexture = pix.PixMaps[0].Texture;
            }
            else
            {
                PixFile pix = new PixFile("hirestch.pix");
                _speedoTexture = pix.PixMaps[0].Texture;
            }
            _speedoLineTexture = TextureGenerator.Generate(new Color(255, 0, 0));
        }
Exemplo n.º 4
0
        public void ResolveTexture(List <PixMap> pixmaps)
        {
            if (Texture != null)
            {
                return;                   //weve already resolved this material
            }
            if (!String.IsNullOrEmpty(PixName))
            {
                PixMap pixmap = null;
                if (pixmaps != null)
                {
                    pixmap = pixmaps.Find(p => p.Name.Equals(PixName, StringComparison.InvariantCultureIgnoreCase));
                }
                else
                {
                    PixFile pixfile = new PixFile(PixName);
                    if (pixfile.Exists)
                    {
                        pixmap = pixfile.PixMaps[0];
                    }
                }
                if (pixmap != null)
                {
                    Texture = pixmap.Texture;
                }
            }

            if (Texture == null)
            {
                //simp mat
                if (SimpMatGradientCount > 1)
                {
                    GenerateSimpMatGradient();
                }
                else
                {
                    Texture = TextureGenerator.Generate(GameVars.Palette.GetRGBColorForPixel(SimpMatPixelIndex));
                }
            }
        }
Exemplo n.º 5
0
 public Texture2D MakeTexture(float[,] heightMap)
 {
     return(TextureGenerator.Generate(colorSteps, heightMap));
 }
Exemplo n.º 6
0
 static BaseHUDItem()
 {
     _shadow   = TextureGenerator.Generate(new Color(0f, 0f, 0f, 0.6f));
     _window   = GameEngine.Window;
     FontScale = _window.Width / 800f;
 }