using Interaction; using UnityEngine; namespace LLM.Commands { public class UnlockStateCommandReceiver : LLMCommandReceiverBase { [SerializeField] private InteractUnlockState unlockState; private void Awake() { if (unlockState == null) { unlockState = GetComponentInParent(); } } public override bool TryExecute(LLMCommand command) { if (command == null) return false; if (!string.Equals(command.type, "UnlockState", System.StringComparison.OrdinalIgnoreCase)) return false; if (unlockState == null) { unlockState = GetComponentInParent(); if (unlockState == null) return false; } if (string.Equals(command.action, "Unlock", System.StringComparison.OrdinalIgnoreCase)) { unlockState.SetUnlocked(true); return true; } if (string.Equals(command.action, "Lock", System.StringComparison.OrdinalIgnoreCase)) { unlockState.SetUnlocked(false); return true; } unlockState.SetUnlocked(command.value); return true; } } }