Ejemplo n.º 1
0
    private void Update()
    {
        float distanceMoved = Vector2.Distance(new Vector2(lastPosition.x, lastPosition.z),
                                               new Vector2(transform.position.x, transform.position.z));

        if (distanceMoved > reloadChunkDistance)
        {
            lastPosition = transform.position;
            StartCoroutine(world.LoadChunks(transform.position, loadDistance));
        }

        if (Input.GetMouseButtonDown(0))
        {
            modify.ReplaceBlockCenter(10, -.0000000001f);
        }

        if (Input.GetMouseButtonDown(1))
        {
            modify.AddBlockCenter(10, .00000000001f);
        }
    }
 public void DeleteBlock()
 {
     modifyTerrian.ReplaceBlockCenter(0);
     audio.PlayOneShot(blockPickSound, 1.0f);
     modifyTerrian.StartLoadChunks();
 }