using System.Collections; using System.Collections.Generic; using UnityEngine; public class InitPlayer : MonoBehaviour { public JSONReader JSONReader; public CharacterAin Character; public Skill_Pick SkillPick; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } void Init(string id) { foreach (var npcData in JSONReader.npcDictionary.Values) { if (npcData.ID == int.Parse(id)) { GameObject ob = Resources.Load(npcData.ResPath); Character.ain = ob.GetComponent(); SkillPick.CharacterAnimator= ob.GetComponent(); Instantiate(ob, transform); } } } }