```
feat: 移除自适应性能相关配置并调整动画控制器 移除了Unity自适应性能(Adaptive Performance)的相关配置文件, 包括Adaptive Performance文件夹及其子目录中的所有配置文件, 同时移除了移动通知(NotificationSettings)相关配置, 以及第一章第一关(level_chapter1_level1)的关卡配置文件, 还删除了多个材质文件如AdjustableGlowOrb、AdjustableGlowOrbHalo 和Arena相关材质。另外微调了base-人类士兵.controller中状态机 的位置坐标,将x坐标从320调整为330。 ```
This commit is contained in:
1 parent
13d0c80335
commit
f77fa20f82
413 files changed
+13494
-63858
No files matched your search
@@ -1,14 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class PlayerOwnedCharacterJson
|
||||
{
|
||||
public string characterId;
|
||||
public int level = 1;
|
||||
public int starLevel = 0;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class PlayerSaveJson
|
||||
{
|
||||
public string playerId = "local_player";
|
||||
public PlayerOwnedCharacterJson[] unlockedCharacters = new PlayerOwnedCharacterJson[0];
|
||||
public string[] currentDeck = new string[0];
|
||||
}
|
||||
|
||||
public class PlayerDataManager : MonoBehaviour
|
||||
{
|
||||
public static PlayerDataManager Instance { get; private set; }
|
||||
|
||||
[Header("玩家拥有的角色(临时写死)")]
|
||||
public List<PlayerCharacterData> ownedCharacters = new List<PlayerCharacterData>();
|
||||
[Header("本地玩家 JSON(正式版替换为服务器响应)")]
|
||||
public TextAsset localPlayerJson;
|
||||
|
||||
[Header("当前卡组(临时写死)")]
|
||||
public List<PlayerCharacterData> ownedCharacters = new List<PlayerCharacterData>();
|
||||
public PlayerCharacterData[] currentDeck = new PlayerCharacterData[5];
|
||||
|
||||
private void Awake()
|
||||
@@ -19,6 +35,40 @@ public class PlayerDataManager : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
Instance = this;
|
||||
InitializeFromJsonOrFallback();
|
||||
}
|
||||
|
||||
private void InitializeFromJsonOrFallback()
|
||||
{
|
||||
TextAsset json = localPlayerJson != null
|
||||
? localPlayerJson
|
||||
: Resources.Load<TextAsset>("PlayerData");
|
||||
|
||||
if (json != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var save = JsonUtility.FromJson<PlayerSaveJson>(json.text);
|
||||
if (save != null && save.unlockedCharacters != null)
|
||||
{
|
||||
ownedCharacters.Clear();
|
||||
foreach (var entry in save.unlockedCharacters)
|
||||
{
|
||||
if (entry == null || string.IsNullOrEmpty(entry.characterId)) continue;
|
||||
ownedCharacters.Add(new PlayerCharacterData(entry.characterId, Mathf.Max(1, entry.level), Mathf.Max(0, entry.starLevel)));
|
||||
}
|
||||
|
||||
currentDeck = new PlayerCharacterData[5];
|
||||
for (int i = 0; i < save.currentDeck.Length && i < currentDeck.Length; i++)
|
||||
currentDeck[i] = GetCharacterData(save.currentDeck[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Debug.LogError("玩家 JSON 解析失败:" + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
InitializeTempData();
|
||||
}
|
||||
@@ -26,12 +76,15 @@ public class PlayerDataManager : MonoBehaviour
|
||||
private void InitializeTempData()
|
||||
{
|
||||
ownedCharacters.Clear();
|
||||
|
||||
ownedCharacters.Add(new PlayerCharacterData("human_soldier", 1, 0));
|
||||
ownedCharacters.Add(new PlayerCharacterData("archer", 1, 0));
|
||||
ownedCharacters.Add(new PlayerCharacterData("shield_guard", 1, 0));
|
||||
ownedCharacters.Add(new PlayerCharacterData("mage", 1, 0));
|
||||
ownedCharacters.Add(new PlayerCharacterData("elite_soldier", 1, 0));
|
||||
|
||||
currentDeck[0] = ownedCharacters[0];
|
||||
currentDeck[1] = ownedCharacters[1];
|
||||
currentDeck = new PlayerCharacterData[5];
|
||||
for (int i = 0; i < currentDeck.Length && i < ownedCharacters.Count; i++)
|
||||
currentDeck[i] = ownedCharacters[i];
|
||||
}
|
||||
|
||||
public PlayerCharacterData GetCharacterData(string characterId)
|
||||
@@ -41,20 +94,13 @@ public class PlayerDataManager : MonoBehaviour
|
||||
|
||||
public PlayerCharacterData GetDeckCharacter(int slot)
|
||||
{
|
||||
if (slot < 0 || slot >= currentDeck.Length)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (slot < 0 || slot >= currentDeck.Length) return null;
|
||||
return currentDeck[slot];
|
||||
}
|
||||
|
||||
public void UpgradeCharacter(string characterId)
|
||||
{
|
||||
var character = GetCharacterData(characterId);
|
||||
if (character != null)
|
||||
{
|
||||
character.level++;
|
||||
Debug.Log($"角色 {characterId} 升级到 {character.level} 级");
|
||||
}
|
||||
if (character != null) character.level++;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user