Exemple #1
0
    void Start()
    {
        Texture2D atlas    = GetTextureAtlas();
        Material  material = new Material(Shader.Find("Standard"));

        atlas.filterMode     = FilterMode.Point;
        material.mainTexture = atlas;;
        /*material.SetTexture("_BaseColorMap", atlas);*/
        material.SetFloat("_Metallic", 0f);
        material.SetFloat("_Glossiness", 0f);
        blockMaterial[0] = material;

        Texture2D transparentAtlas = GetTextureAtlas(true);

        transparentAtlas.filterMode = FilterMode.Point;

        Material transparentMaterial = new Material(Shader.Find("Unlit/Transparent"));

        transparentAtlas.alphaIsTransparency = true;
        //player.SetActive(false);

        transparentMaterial.mainTexture = transparentAtlas;
        blockMaterial[1] = transparentMaterial;


        // Application.targetFrameRate = 70;
        // RenderSettings.ambientLight = Color.white * lightIntensity;
        ChunkUtils.GenerateRandomOffset();
        GenerateBlockTypes();
        GenerateWorld();
        StartCoroutine(BuildWorld());
    }
Exemple #2
0
    void Start()
    {
        Texture2D atlas    = GetTextureAtlas();
        Material  material = new Material(Shader.Find("Standard"));

        material.mainTexture = atlas;
        blockMaterial        = material;
        ChunkUtils.GenerateRandomOffset();
        GenerateBlockTypes();
        GenerateWorld();
        StartCoroutine(BuildWorld(true));
    }
Exemple #3
0
    void Start()
    {
        Texture2D atlas    = GetTextureAtlas();
        Material  material = new Material(Shader.Find("Standard"));

        material.mainTexture = atlas;
        blockMaterial[0]     = material;

        Texture2D transparentAtlas    = GetTextureAtlas(true);
        Material  transparentMaterial = new Material(Shader.Find("Unlit/Transparent"));

        transparentMaterial.mainTexture = transparentAtlas;
        blockMaterial[1] = transparentMaterial;

        ChunkUtils.GenerateRandomOffset();
        GenerateBlockTypes();
        GenerateWorld();
        StartCoroutine(BuildWorld());
    }