个人形象切换

This commit is contained in:
DESKTOP-SAJ6RKV\Administrator 2025-05-09 16:41:00 +08:00
parent 62a674d480
commit b6b52a7839
5 changed files with 43 additions and 8 deletions

View File

@ -38,6 +38,7 @@ namespace GameLogic
private double m_AllPush = 0; // 当前总值
private int m_AllAddPush = 0;//永久增加推力值
private int textureId = 0;
private Dictionary<string, List<Buff>> m_Buffs = new Dictionary<string, List<Buff>>(); //自身Buff列表
@ -69,7 +70,7 @@ namespace GameLogic
m_tmpAllValue.text = m_AllPush.ToString();
// 播放序列图,通过Gpu的形式
LoadTextureMatRes(1);
LoadTextureMatRes(textureId + 1);
}
@ -154,6 +155,33 @@ namespace GameLogic
}
m_AllPush += m_AddPush;
// 检测个人赛道推力值是否到达可以切换形象
SwitchActor();
}
private void SwitchActor()
{
int id = 0;
for (int i = 0; i < ConfigSystem.Instance.Tables.TbTeamConfig.DataList.Count; i++)
{
if (m_AllPush >= ConfigSystem.Instance.Tables.TbTeamConfig.DataList[i].OneScoreTargetValue)
{
id = i;
}
else
{
break;
}
}
// 选出当前朝代Id
if (id != textureId)
{
// 切换朝代
textureId = id;
LoadTextureMatRes(textureId + 1);
}
}
private void RefreshUI()
@ -330,7 +358,12 @@ namespace GameLogic
/// <param name="key"></param>
private void LoadTextureMatRes(int key)
{
//m_ImgSprite.material = GameModule.Resource.LoadAsset<Material>("0" + key);
// 先隐藏其他
for (int i = 1; i < m_rectCar.childCount; i++)
{
m_rectCar.transform.GetChild(i).gameObject.SetActive(false);
}
m_rectCar.transform.GetChild(key).gameObject.SetActive(true);
}

View File

@ -174,6 +174,8 @@ namespace GameLogic
}
m_rectBgList.GetChild(teamId).gameObject.SetActive(true);
// 替换UI图
}
private void AddPlayerFunc(UnitPlayerData unitPlayerData)

View File

@ -761,20 +761,20 @@ PlayerSettings:
webGLMemoryGeometricGrowthCap: 96
webGLPowerPreference: 2
scriptingDefineSymbols:
Android: ENABLE_LOG;TextMeshPro;ENABLE_HYBRIDCLR
Android: TextMeshPro;ENABLE_HYBRIDCLR;ENABLE_LOG
EmbeddedLinux: TextMeshPro
GameCoreXboxOne: TextMeshPro
Nintendo Switch: TextMeshPro
PS4: TextMeshPro
PS5: TextMeshPro;ENABLE_HYBRIDCLR
PS5: TextMeshPro;ENABLE_HYBRIDCLR;ENABLE_LOG
QNX: TextMeshPro
Stadia: TextMeshPro
Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1;ENABLE_LOG;TextMeshPro;ENABLE_HYBRIDCLR;AMPLIFY_SHADER_EDITOR
Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1;TextMeshPro;ENABLE_HYBRIDCLR;AMPLIFY_SHADER_EDITOR;ENABLE_LOG
VisionOS: TextMeshPro
WebGL: ENABLE_LOG;TextMeshPro;ENABLE_HYBRIDCLR
Windows Store Apps: ENABLE_LOG;ENABLE_HYBRIDCLR
WebGL: TextMeshPro;ENABLE_HYBRIDCLR;ENABLE_LOG
Windows Store Apps: ENABLE_HYBRIDCLR;ENABLE_LOG
XboxOne: TextMeshPro
iPhone: ENABLE_LOG;TextMeshPro;ENABLE_HYBRIDCLR
iPhone: TextMeshPro;ENABLE_HYBRIDCLR;ENABLE_LOG
tvOS: TextMeshPro
additionalCompilerArguments: {}
platformArchitecture: {}