阵营显示问题 加入玩家阵营显示处理

This commit is contained in:
DESKTOP-SAJ6RKV\Administrator 2025-05-09 14:19:01 +08:00
parent 0c5d304914
commit c50f68cbea
8 changed files with 100 additions and 10713 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,8 @@ Material:
m_Shader: {fileID: 4800000, guid: 8051d8a533a10b541a591e43ef313e96, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_ValidKeywords:
- _USEONEEM_ON
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
@ -191,7 +192,7 @@ Material:
- _UseEmTex_R_A: 0
- _UseMainTex_RGB_A: 0
- _UseMainTex_Ramp_RGB_A: 0
- _UseOneEM: 0
- _UseOneEM: 1
- _UseOneNoise: 1
- _UseTur_Mask: 0
- _Use_Flash: 0

View File

@ -2871,7 +2871,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4655219308374456140}
- {fileID: 9100389558934680694}
- {fileID: 3086937246495487097}
m_Father: {fileID: 1508900408836313865}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@ -3863,7 +3863,7 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 6403937887474270162, guid: 3c87f3ae07d99d64fa62efe33b26e010, type: 3}
m_PrefabInstance: {fileID: 1749071072740984990}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2499756593991139208
--- !u!1001 &8515460702066491271
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
@ -3962,30 +3962,10 @@ PrefabInstance:
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 1371285011784465696, guid: 7945afcaefa5a2945bddd43039739591, type: 3}
insertIndex: -1
addedObject: {fileID: 171999324682489111}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7945afcaefa5a2945bddd43039739591, type: 3}
--- !u!1 &3582370593861976744 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1371285011784465696, guid: 7945afcaefa5a2945bddd43039739591, type: 3}
m_PrefabInstance: {fileID: 2499756593991139208}
m_PrefabAsset: {fileID: 0}
--- !u!114 &171999324682489111
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3582370593861976744}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b354256188e404448b40d3195b9c4150, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &9100389558934680694 stripped
--- !u!224 &3086937246495487097 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 6700229753991957502, guid: 7945afcaefa5a2945bddd43039739591, type: 3}
m_PrefabInstance: {fileID: 2499756593991139208}
m_PrefabInstance: {fileID: 8515460702066491271}
m_PrefabAsset: {fileID: 0}

View File

@ -60,12 +60,12 @@ namespace GameLogic
if (data == null)
{
data = DataGameSceneManager.Instance.CreateUnitPlayerData(protCustMessageData);
// 二次容错
if (data == null)
{
return;
}
//data = DataGameSceneManager.Instance.CreateUnitPlayerData(protCustMessageData);
//// 二次容错
//if (data == null)
//{
// return;
//}
}
// if (EventConts.gameStateType == GameStateType.团队赛)
@ -170,14 +170,16 @@ namespace GameLogic
if (data == null)
{
data = DataGameSceneManager.Instance.CreateUnitPlayerData(protCustMessageData);
int targetId = Random.Range(1, EventConts.MaxPlayerIds);
data = DataGameSceneManager.Instance.CreateUnitPlayerData(protCustMessageData, targetId - 1);
// 二次容错
if (data == null)
{
return;
}
int targetId = Random.Range(1, EventConts.MaxPlayerIds);
var actor = DataGameSceneManager.Instance.GetTeamActor((targetId - 1).ToString());
if (actor == null)
{

View File

@ -110,13 +110,13 @@ namespace GameLogic
public UnitPlayerData CreateUnitPlayerData(ProtCustMessageData protCustMessageData)
public UnitPlayerData CreateUnitPlayerData(ProtCustMessageData protCustMessageData, int targetId)
{
UnitPlayerData unitPlayerData = new UnitPlayerData()
{
protCustMessageData = protCustMessageData,
teamId = "-1"
teamId = targetId.ToString()
};
if (string.IsNullOrEmpty(protCustMessageData.imgURL))
@ -131,6 +131,9 @@ namespace GameLogic
// 添加局内数据
m_DicUnitPlayerDatas.Add(protCustMessageData.openId, unitPlayerData);
// 发送添加玩家事件
GameEvent.Send(EventConts.AddPlayer,unitPlayerData);
return unitPlayerData;
}
@ -275,8 +278,6 @@ namespace GameLogic
// 动态计算公用胜点池
WinAllValue = (long)Math.Ceiling(ScoreAllValue * 0.00001f);
// 播放音效
GameModule.Audio.Play(TEngine.AudioType.UISound, "数字" + UnityEngine.Random.Range(1, 3), false, 0.1f);
//Log.Error($"添加礼物:{giftId}");
GiftItemData giftItemData = new GiftItemData()

View File

@ -146,12 +146,11 @@ namespace GameLogic
private void AddPlayerFunc(UnitPlayerData unitPlayerData)
{
// 显示加入UI
var jiaRuItem = GameObject.Instantiate(m_rect_GiftPanel.transform.GetChild(1));
jiaRuItem.transform.SetParent(m_rect_GiftPanel);
jiaRuItem.transform.localScale = Vector3.one * 1.5f;
jiaRuItem.transform.localPosition = new Vector3(-258, 5, 0);
jiaRuItem.transform.localScale = Vector3.one ;
jiaRuItem.transform.localPosition = Vector3.zero;
jiaRuItem.gameObject.SetActive(true);
jiaRuItem.GetComponent<UIJiaRuItem>().OnInit(unitPlayerData);

View File

@ -5,6 +5,8 @@ using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using TMPro;
using System.Threading.Tasks;
using TEngine;
namespace GameLogic
{
@ -14,14 +16,20 @@ namespace GameLogic
public TextMeshProUGUI m_Info;
void Awake()
{
m_PlayerName = transform.Find("Name").GetComponent<TextMeshProUGUI>();
m_Info = transform.Find("Info").GetComponent<TextMeshProUGUI>();
}
public void OnInit(UnitPlayerData unitPlayerData)
public async Task OnInit(UnitPlayerData unitPlayerData)
{
m_PlayerName.text = unitPlayerData.protCustMessageData.nickName;
m_Info.text = DataGameSceneManager.Instance.GetStrs(int.Parse(unitPlayerData.teamId));
Log.Debug(DataGameSceneManager.Instance.GetStrs(int.Parse(unitPlayerData.teamId)));
await UniTask.Delay(2000);
Log.Debug("ÒÆ³ý");
Destroy(gameObject);
}
}
}

File diff suppressed because it is too large Load Diff