using Interaction; using UnityEngine; namespace LLM.Commands { public class DoorCommandReceiver : LLMCommandReceiverBase { [SerializeField] private DoorController door; private void Awake() { if (door == null) { door = GetComponentInParent(); } } public override bool TryExecute(LLMCommand command) { if (command == null) return false; if (!string.Equals(command.type, "Door", System.StringComparison.OrdinalIgnoreCase)) return false; if (door == null) { door = GetComponentInParent(); if (door == null) return false; } if (string.Equals(command.action, "Open", System.StringComparison.OrdinalIgnoreCase)) { door.OpenDoor(); return true; } if (string.Equals(command.action, "Close", System.StringComparison.OrdinalIgnoreCase)) { door.CloseDoor(); return true; } door.ToggleDoor(); return true; } } }