using UnityEngine; using UnityEngine.InputSystem; using EasyTalk.Controller; public class GameManager : MonoBehaviour { private Player player; private DialogueController dialogueController; void Awake() { player = GetComponent(); } // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { dialogueController = FindFirstObjectByType(); if (dialogueController == null) Debug.LogError("DialogueController not found in the scene."); else dialogueController.PlayDialogue(); } // Update is called once per frame void Update() { } public void ShowPlayerSkills(InputAction.CallbackContext ctx) { if (!ctx.performed) return; player.GetSkills(out var skills); foreach (var skill in skills) { Debug.Log($"Skill: {skill.Key}, Level: {skill.Value.level}, Description: {skill.Value.Description}"); } } public void SkillCheck(string skillName, int requiredLevel, out bool hasSkill) { if (player.skills.TryGetValue(skillName, out Skill skill)) { hasSkill = skill.level >= requiredLevel; } else { hasSkill = false; } } }