示例#1
0
 private void DeleteNPC(NPCData _npc)
 {
     if (DataMart.CheckNPC(_npc.ID))
     {
         DataMart.RemoveNPC(_npc);
     }
     else
     {
         Debug.LogError("NPC doesnt exist");
     }
 }
示例#2
0
 public void LoadNPC(int id)
 {
     if (DataMart.CheckNPC(id))
     {
         NPCData data = DataMart.GetNPC(id);
         RefreshUI(data);
     }
     else
     {
         Debug.LogError("Cannot load, NPC not found.");
     }
 }
示例#3
0
    private void SaveNPC(NPCData _npc)
    {
        _npc.Name = NPCName.text;
        _npc.URI  = PortraitURI.text;

        if (DataMart.CheckNPC(_npc.ID))
        {
            DataMart.RemoveNPC(_npc);
            DataMart.AddNPC(_npc);
        }
        else
        {
            DataMart.AddNPC(_npc);
        }
    }
示例#4
0
 private void Start()
 {
     if (IDKEY >= 0)
     {
         //Is not a negative number
         if (DataMart.CheckNPC(IDKEY))
         {
             NPCData data = DataMart.GetNPC(IDKEY);
             npcname = data.Name;
             uri     = data.URI;
         }
     }
     else
     {
         Debug.LogError("ID is a negative number");
     }
 }