IEnumerator HandleAnimationWithHand() { usingHand = true; if (auxiliarHandCursor == null) { yield break; } auxiliarHandCursor.Enable(); this.transform.localScale = ScaleWithHand; this.transform.rotation = Quaternion.Euler(InitialRotationWithHand.x, 180 + InitialRotationWithHand.y, InitialRotationWithHand.z); this.auxiliarHand.transform.localScale = AuxiliarHandScale; this.auxiliarHand.transform.localPosition = AuxiliarHandOffset; this.auxiliarHand.transform.rotation = Quaternion.Euler(InitialAuxiliarHandRotation.x, InitialAuxiliarHandRotation.y, InitialAuxiliarHandRotation.z); float time = Time.time; float rotation = RotationSpeedWithHand; while (this.animating) { while (Time.time - time < AnimationTimeWithHand) { this.transform.Rotate(new Vector3(0, 0, 1), rotation); yield return(new WaitForEndOfFrame()); } rotation = -rotation; time = Time.time; yield return(1); } animations.Dequeue(); }
private void EnableActiveCursor() { if (activeCursor == null) { return; } bool showHand = this.gameManager.MapGrid.InputStatesOnMap.Any(i => i.IsHovering && i.AffectedObjects.Any(a => a.IsFloating)) || this.gameManager.MapGrid.IsAnyFloatingObjectBeingDragged(); DisableAllCursors(); activeCursor.Enable(); activeCursor.Animate(showHand); }