using System.Collections; using System.Collections.Generic; using UnityEngine; public class SpaceshipDoor : Interactable { bool IsOpen = false; public AudioSource source; public override void Interact() { if (!IsOpen) { source.Play(); Vector3 currentRotation = transform.eulerAngles; currentRotation.z += 115; transform.eulerAngles = currentRotation; IsOpen = true; } else { source.Play(); Vector3 currentRotation = transform.eulerAngles; currentRotation.z -= 115; transform.eulerAngles = currentRotation; IsOpen = false; } } }