public void AnimatePositioningItem(Transform parentTo, System.Action <ItemPickup> endAnimationEvent, AudioType playSound = AudioType.None) { // Setup variables onAnimationEnd = endAnimationEvent; transform.parent = parentTo; // Setup animation configuration itemAnimationConfiguration.clearEvents(); itemAnimationConfiguration.clearProperties(); // Setup scale and rotation itemAnimationConfiguration.localRotation(Quaternion.identity); itemAnimationConfiguration.scale(Vector3.one); // Setup path itemTweenPath[0] = transform.localPosition; itemTweenPath[1] = new Vector3((transform.localPosition.x / 2f), midTweenOffset, 0); itemAnimationConfiguration.localPositionPath(new GoSpline(itemTweenPath)); // Check if we need to clean up the animation if (itemAnimation != null) { // Clean up this item animation from the animation queue Go.removeTween(itemAnimation); itemAnimation = null; } // Create and play a new animation itemAnimation = Go.to(transform, animationDuration, itemAnimationConfiguration); itemAnimation.setOnCompleteHandler(OnAnimationEnds); itemAnimation.play(); // Play a sound effect if (playSound == AudioType.Place) { PlayClip(dropSound); } else if (playSound == AudioType.PickUp) { PlayClip(pickupSound); } }