public void UpdateData(TaskData data) { taskData = data; scene = JsonManager.GetInstance().GetMapping <SceneData>("Scenes", taskData.BelongToSceneId); npc = JsonManager.GetInstance().GetMapping <NpcData>("Npcs", taskData.BelongToNpcId); JObject areaNames = JsonManager.GetInstance().GetJson("AreaNames"); areaName = areaNames[scene.BelongToAreaName] != null ? areaNames[scene.BelongToAreaName]["Name"].ToString() : ""; }
public void UpdateData(TaskData data) { taskData = data; currentDialog = taskData.GetCurrentDialog(); scene = JsonManager.GetInstance().GetMapping <SceneData>("Scenes", taskData.BelongToSceneId); npc = JsonManager.GetInstance().GetMapping <NpcData>("Npcs", taskData.BelongToNpcId); areaNames = JsonManager.GetInstance().GetJson("AreaNames"); areaName = areaNames[scene.BelongToAreaName] != null ? areaNames[scene.BelongToAreaName]["Name"].ToString() : ""; EventTriggerListener.Get(ScoutBtn.gameObject).onClick = onClick; }
void createNpcContainer(NpcData npc) { if (prefabObj == null) { prefabObj = Statics.GetPrefab("Prefabs/UI/GridItems/NpcItemContainer"); } GameObject itemPrefab = Statics.GetPrefabClone(prefabObj); itemPrefab.name = npc.Id; MakeToParent(npcsGrid.transform, itemPrefab.transform); NpcContainer container = itemPrefab.GetComponent <NpcContainer>(); container.SetNpcData(npc); npcContainersMapping.Add(npc.Id, container); }
public void UpdateData(NpcData data) { npcData = data; }
public void SetNpcData(NpcData data) { UpdateData(data); RefreshView(); }