using System; using UnityEngine; /// 스크립트 실행에 필요한 컨텍스트 public class ScriptContext { // ===== Stores ===== public DialogueStore DialogueStore { get; set; } public ChoiceStore ChoiceStore { get; set; } public CharacterStore CharacterStore { get; set; } public FlowStore FlowStore { get; set; } /// 변수 저장소 public VariableStore VariableStore { get; set; } // ===== 흐름 제어 ===== /// 다음 액션의 타입 확인 (choices 자동 진행 등에 사용) public Func PeekNextType { get; set; } /// 스크립트 교체 요청 콜백 (scriptPath) public Action OnScriptChange { get; set; } // ===== 리소스 로딩 헬퍼 ===== private const string CharacterPathPrefix = "Images/Characters/"; public Sprite LoadCharacterSprite(string fileName) { string path = CharacterPathPrefix + fileName; Sprite sprite = Resources.Load(path); if (sprite == null) Debug.LogError($"캐릭터 이미지 로드 실패: {path}"); return sprite; } }