This commit is contained in:
NimXD
2024-09-26 20:53:03 +05:30
parent dfe47c1fb8
commit c29b03d428
212 changed files with 291654 additions and 1622 deletions

View File

@@ -20,6 +20,7 @@ public class playerNetwork : NetworkBehaviour
public const float ATTACK_COOLDOWN = 0.6f;
[HideInInspector]
public StatManager statManager;
public CharacterSelection charSelectionManager;
//public const int XPFORLEVEL = 10;
[SyncVar(hook =nameof(OnHealthChanged))] public int health = 100;
@@ -150,6 +151,8 @@ public class playerNetwork : NetworkBehaviour
public GameObject projectile;
public string selectedCharacterJson = CharacterSelection.selectedCharJson;
public void QuestFunction(QuestScriptable questData){
currentQuest = questData;
questText.text = questData.questTitle;
@@ -243,6 +246,7 @@ public class playerNetwork : NetworkBehaviour
{"xp", XP},
{"completedQuest", completedQuests},
{"playerStats", statManager.PlayerStats},
{"characterJson", selectedCharacterJson},
};
@@ -297,8 +301,9 @@ public class playerNetwork : NetworkBehaviour
inventory.inventoryManager.SetInventory(inventoryGetData);
completedQuests = snapshot.GetValue<List<string>>("completedQuest");
//stats
statManager.loadFromCloudSave(snapshot.GetValue<Dictionary<string, int>>("playerStats"));
isLoaded = true;
}else{