paste method

void paste()

Implementation

void paste(){
  Vector3 newPosition = Vector3.copy(-camera.position)+Vector3(-camera.viewportWidth/1000,camera.viewportHeight/1000,0)*camera.zoom;
  if(objectsCopied.isNotEmpty){
    objectTappedOn = [];
    currentSize = null;
    for(int i = 0; i < objectsCopied.length;i++){
      levelInfo[selectedLevel].objects.add(
        Object(
          name: objectsCopied[i].name,
          position: newPosition,
          size: objectsCopied[i].size,
          imageLocation: objectsCopied[i].imageLocation,
          type: objectsCopied[i].type,
          color: objectsCopied[i].color,
          layer: objectsCopied[i].layer,
          mesh: objectsCopied[i].mesh,
          rotation: objectsCopied[i].rotation,
          scale :objectsCopied[i].scale,
          scaleAllowed: objectsCopied[i].scaleAllowed
        )
      );
    }
    updateMinMap = true;
  }
  update();
}