public void HandleCustomPlayerDisplayValues() { CheckData(); if (customCharacterData.isCustomType || customCharacterData.isDefaultType) { if (customCharacterDataCurrent.lastCustomDisplayCode != customCharacterData.characterDisplayCode || customCharacterDataCurrent.lastCustomDisplayName != customCharacterData.characterDisplayName) { GameCustomController.UpdateCharacterDisplay( gameObject, customCharacterData.characterDisplayName, customCharacterData.characterDisplayCode); customCharacterDataCurrent.lastCustomDisplayCode = customCharacterData.characterDisplayCode; customCharacterDataCurrent.lastCustomDisplayName = customCharacterData.characterDisplayName; } } }
public virtual void Change(GameCustomCharacterData customCharacterDataTo) { customCharacterData = customCharacterDataTo; //customCharacterDataCurrent = customCharacterDataTo; CheckData(); if (gameCustomPlayerContainer != null) { gameCustomPlayerContainer.customCharacterData = customCharacterData; } //LogUtil.Log("GameCustomBase:Change:characterData:" + characterData.teamCode); if (customCharacterData != null) { //customCharacterData.presetColorCode = customCharacterData.presetColorCode; //customCharacterData.presetTextureCode = customCharacterData.presetTextureCode; //LogUtil.Log("GameCustomBase:Change:customColorCode:" + customColorCode); //LogUtil.Log("GameCustomBase:Change:customTextureCode:" + customTextureCode); if (!string.IsNullOrEmpty(customCharacterData.teamCode) && customCharacterData.teamCode != "default") { //LogUtil.Log("Loading TEAM Custom Type:characterData.teamCode:" + characterData.teamCode); GameTeam team = GameTeams.Instance.GetById(customCharacterData.teamCode); if (team != null) { if (team.data != null) { customCharacterData.teamCode = team.code; customCharacterData.type = GameCustomTypes.teamType; //LogUtil.Log("Loading TEAM EXISTS Type:teamCode:" + teamCode); GameDataTexturePreset itemTexture = team.data.GetTexturePreset(); if (itemTexture != null) { customCharacterData.presetTextureCode = itemTexture.code; customCharacterDataCurrent.lastCustomColorCode = "--"; } GameDataColorPreset itemColor = team.data.GetColorPreset(); if (itemColor != null) { customCharacterData.presetColorCode = itemColor.code; customCharacterDataCurrent.lastCustomTextureCode = "--"; } } GameCustomController.UpdateCharacterDisplay( gameObject, team.display_name, UnityEngine.Random.Range(1, 99).ToString()); } } } UpdatePlayer(); }