Exemplo n.º 1
0
    void m_moveItem(GameObject go, string newRoom, Vector3 newPos)
    {
        PersistentItem item = go.GetComponent <PersistentItem> ();

        item.StoreData();
        refreshPersItems();
        DelCharData(item.data);
        CharacterSaveContainer cc = LoadChars(savePath + newRoom);

//		item.pos = newPos;
        JsonUtility.ToJson(new CharacterSaveContainer());
        cc.actors.Add(item.data);
        Save(savePath + newRoom, cc);
        ResaveRoom();
    }
Exemplo n.º 2
0
    void m_moveItem(GameObject go, string newRoom, string newID, RoomDirection newDir)
    {
        //Debug.Log ("Moving " + go.name + " to " + newRoom + " at position: " + newID + " direction: " + newDir);
        PersistentItem item = go.GetComponent <PersistentItem> ();

        //Remove the current data.
        item.StoreData();
        refreshPersItems();
        DelCharData(item.data);

        //load the list of things in the new room and add the current character to it
        CharacterSaveContainer cc = LoadChars(savePath + newRoom);

        item.data.targetID  = newID;
        item.data.targetDir = newDir;
        cc.actors.Add(item.data);
        //Debug.Log ("What is this anyways?: " + item.data.targetID + " : " + item.data.targetDir);
        Save(savePath + newRoom, cc);
        ResaveRoom();
        LoadChars(savePath + curRoom);
    }