public static async ETTask <GameObject> CreateCharacterModelBySetting(PlayerCharSetting setting, int layer) { GameObject go = await CreateCharacterModel(setting.CharacterId); if (go == null) { return(null); } CharacterConfig config = null; //TODO:Wade 新角色 if (go.GetComponent <AvatarModelCollector>() != null && Define.OpenNewModel) { config = GetCharacterConfig(setting.CharacterId); var initModel = go.GetComponent <AvatarModelCollector>(); initModel.SetModel(config.Icon); } //腳踏車 config = GetAppearanceConfig(setting.BicycleId, (int)ConfigType.Bicycle); ChangeCharAppearance(go, config, setting.CharacterId); //身體 config = GetAppearanceConfig(setting.BodyId, (int)ConfigType.Body); ChangeCharAppearance(go, config, setting.CharacterId); //光輪 config = GetAppearanceConfig(setting.DecorationId, (int)ConfigType.LightWheel); ChangeCharAppearance(go, config, setting.CharacterId); //獎牌 config = GetAppearanceConfig(setting.MedalId, (int)ConfigType.Medal); ChangeCharAppearance(go, config, setting.CharacterId); //裝飾 //config = GetAppearanceConfig(setting.DecorationId, (int)ConfigType.Decoration); //ChangeCharAppearance(go, config); SetLayer(go, layer); return(go); }
public static void Reset(this PlayerCharSetting setting) { setting.CharacterId = INVALID; setting.BicycleId = INVALID; setting.BodyId = INVALID; setting.DecorationId = INVALID; setting.MedalId = INVALID; }
public static void ChangeLoungeSettingByConfigId(long id, ref PlayerCharSetting setting) { if (setting == null) { setting = new PlayerCharSetting(); } CharacterConfig config = GetAppearanceConfig(id); switch ((ConfigType)config.Type) { case ConfigType.Bicycle: { setting.BicycleId = config.Id; break; } case ConfigType.Body: { setting.BodyId = config.Id; break; } case ConfigType.LightWheel: { setting.DecorationId = config.Id; break; } case ConfigType.Medal: { setting.MedalId = config.Id; break; } //case ConfigType.Decoration: // { // setting.DecorationId = config.Id; // break; // } default: { Log.Info($"Doesnt exist 'LoungeUtility.ConfigType' type"); break; } } }