Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (!skipframe)
     {
         vp = voxelPlanet.instance;
         if (Input.GetMouseButton(0))
         {
             dig = true;
         }
         if (Input.GetMouseButton(1))
         {
             place = true;
         }
         if (dig)
         {
             skipframe = true;
             int[] coords = findVoxelCoords();
             //print("trying (" + coords[0] + ", " + coords[1] + ", " + coords[2] + ")");
             vp.dig(coords[0], coords[1], coords[2], 0);
             dig = false;
         }
         else if (place)
         {
             skipframe = true;
             int[] coords = findVoxelCoords();
             //print("trying (" + coords[0] + ", " + coords[1] + ", " + coords[2] + ")");
             vp.dig(coords[0], coords[1], coords[2], 1);
             place = false;
         }
     }
     skipframe = false;
 }
Exemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (!skipframe) {
         vp = voxelPlanet.instance;
         if (Input.GetMouseButton(0)) dig = true;
         if (Input.GetMouseButton(1)) place = true;
         if (dig) {
             skipframe = true;
             int[] coords = findVoxelCoords();
             //print("trying (" + coords[0] + ", " + coords[1] + ", " + coords[2] + ")");
             vp.dig(coords[0], coords[1], coords[2], 0);
             dig = false;
         } else if (place) {
             skipframe = true;
             int[] coords = findVoxelCoords();
             //print("trying (" + coords[0] + ", " + coords[1] + ", " + coords[2] + ")");
             vp.dig(coords[0], coords[1], coords[2], 1);
             place = false;
         }
     }
     skipframe = false;
 }