public void PickupPetroglyph(Petroglyph petroglyph) { if (holdingPetroglyph != null) { DropPetroglyph(); } Debug.Log("Picked up Petroglyph"); audioHandler.TriggerSound(); holdingPetroglyph = petroglyph; var targetPosition = new Vector3(); var targetRotation = new Quaternion(); bool mouseIsUsed = GetMouseTargetTransform(out targetPosition, out targetRotation); if (mouseIsUsed) { pickingOffset = holdingPetroglyph.transform.position - targetPosition; pickingOffset.y = 0; } dontCheckDrop = true; }
void DropPetroglyph() { Debug.Log("Drop Petroglyph"); audioHandler.TriggerSound(); holdingPetroglyph = null; }