public void HandleCustomPlayerTexture() { CheckData(); if (customCharacterData.isCustomType || customCharacterData.isDefaultType) { //return; } else if (customCharacterDataCurrent.lastCustomTextureCode != customCharacterData.presetTextureCode) { //if(AppColorPresets.Instance.CheckByCode(customTextureCode)) { //LogUtil.Log("HandleCustomPlayerColor:changing:" + // " lastCustomColorCode:" + lastCustomTextureCode + // " characterData.presetColorCode:" + characterData.presetTextureCode); AppContentAssetTexturePreset preset = AppContentAssetTexturePresets.Instance.GetByCode( customCharacterData.presetTextureCode); if (preset != null) { // load from current code GameCustomController.UpdateTexturePresetObject( gameObject, preset); } customCharacterDataCurrent.lastCustomTextureCode = customCharacterData.presetTextureCode; //} } }
public void ChangePreset(int index) { int countPresets = AppContentAssetTexturePresets.Instance.GetListByType(type).Count; if (index < -1) { index = countPresets - 1; } if (index > countPresets - 1) { index = -1; } currentIndex = index; if (index > -2 && index < countPresets) { if (initialProfileCustomItem == null) { initialProfileCustomItem = GameProfileCharacters.currentCustom; } currentProfileCustomItem = GameProfileCharacters.currentCustom; if (index == -1) { UIUtil.SetLabelValue(labelCurrentDisplayName, "My Previous Uniform"); GameCustomController.UpdateTexturePresetObject( initialProfileCustomItem, currentObject, type); } else { AppContentAssetTexturePreset preset = AppContentAssetTexturePresets.Instance.GetListByType(type)[currentIndex]; //AppColorPreset presetColor = // AppColorPresets.Instance.GetListByType(type)[currentIndex]; // change character to currently selected texture preset currentProfileCustomItem = GameCustomController.UpdateTexturePresetObject( currentProfileCustomItem, currentObject, preset); //profileCustomItem = GameCustomController.UpdateColorPresetObject(profileCustomItem, currentObject, presetColor); GameCustomController.SaveCustomItem(currentProfileCustomItem); UIUtil.SetLabelValue(labelCurrentDisplayName, preset.display_name); } } }
public void SetCustomTextures() { CheckData(); if (customCharacterDataCurrent.lastCustomTextureCode == customCharacterData.presetTextureCode) { //return; } if (customCharacterData.isCustomType || customCharacterData.isTeamType || customCharacterData.isExplicitType) { return; } else if (customCharacterData.isDefaultType) { if (customCharacterData.actorType == GameCustomActorTypes.heroType) { GameProfileCustomItem customItem = GameProfileCharacters.currentCustom; if (customItem != null) { GameCustomController.UpdateTexturePresetObject( customItem, gameObject, customCharacterData.presetType); } else { GameCustomController.UpdateTexturePresetObject( gameObject, AppContentAssetTexturePresets.Instance.GetByCode( customCharacterData.presetTextureCodeDefault)); } //GameCustomController.BroadcastCustomColorsChanged } else { GameCustomController.UpdateTexturePresetObject( gameObject, AppContentAssetTexturePresets.Instance.GetByCode( customCharacterData.presetTextureCodeDefault)); } } customCharacterDataCurrent.lastCustomTextureCode = customCharacterData.presetTextureCode; }