private void animateOutUiObj(InspectUIButtonParent obj, Vector3 offset, string animateKey) { Vector3 throwAwayTargetPosition = obj.child.getTargetPosition() + offset; Misc.AnimateMovementTo(animateKey, obj.gameObject, throwAwayTargetPosition); currentUiDelays.Add(animateKey, StartCoroutine(setActiveUIButtonAfterDelay(obj.gameObject, false, animateKey))); }
private void animateInUiObj(InspectUIButtonParent obj, Vector3 offset, string animateKey) { // Safety check - are we currently animating the UI? bool animatingUiInProgress = Misc.IsMovementAnimationActive("inspect_police"); if (animatingUiInProgress) { // UI is animating, and a will be hidden after a delay, cancel these delays cancelUiDelay(); } Vector3 currentButtonTargetPosition = obj.child.getTargetPosition(); obj.gameObject.SetActive(true); obj.transform.position = currentButtonTargetPosition + offset; Debug.Log(animateKey + ": " + obj.transform.position + " - " + currentButtonTargetPosition); Misc.AnimateMovementTo(animateKey, obj.gameObject, currentButtonTargetPosition); }