/// <summary> /// Dreht das Objekt um 90° im Uhrzeigersinn. /// </summary> public void TurnRight() { Vector2 temp = oldDirection; oldDirection = direction; direction = new Vector2(oldDirection.y, -oldDirection.x); if (GetComponent <Robot>() && GetComponent <Robot>().GrabbedObject != null) { List <InteractiveObject> grabbedObjects = new List <InteractiveObject>(); InteractiveObject grabbedObject = GetComponent <Robot>().GrabbedObject; grabbedObjects.Add(grabbedObject); if (grabbedObject.GetComponent <WorldObjectGroup>()) { foreach (WorldObject obj in grabbedObject.GetComponent <WorldObjectGroup>().objects) { grabbedObjects.Add(obj.GetComponent <InteractiveObject>()); } } grabbedObject.AdjustRelativePosition("Right"); grabbedObject.MoveToRelativePosition(); } gameObject.transform.rotation = Quaternion.AngleAxis(GetFacingAngle(direction), Vector3.forward); }