public void DropInteractableObject() { interactableObject = null; hintManager.HideHint(); if (activeInteractableWindow > -1) { interactionWindows[activeInteractableWindow].ToggleWindowVisibility(false); activeInteractableWindow = -1; } }
/// <summary> /// Rotates the side defined by axis and positionValue around axis with rotationValue ammount. /// </summary> /// <param name="axis">Rotating around this</param> /// <param name="positionValue">Axis way coordinate of the side we want to rotate</param> /// <param name="rotationValue">Ammount of rotation</param> public void RotateSide(Axis axis, float positionValue, float rotationValue) { // Hiding the hint before starting rotation hintManager.HideHint(); // Only start a new rotation if there is no rotation now if (currentlyRotating == 0) { Vector3 rotationVector = axis.ToVector3(transform); foreach (var cube in cubes) { var cubePosition = cube.gameObject.transform.localPosition; // using local position if (AxisExtensions.VectorEqualsValueAtAxis(axis, cubePosition, positionValue)) { StartCoroutine(ContinousRotation(cube.gameObject, axis, rotationValue)); } } } else { Debug.Log("Rotation in progress I won't start new rotation"); } }