vault backup: 2024-08-19 12:29:02
This commit is contained in:
parent
10c9f79227
commit
937950691e
@ -67,3 +67,40 @@ ServerDoLoadPropPreset() => ServerStartSwitchPreset() => ServerLoadProp() => DoL
|
||||
|
||||
LocalLoadDressByConfig() 本地加载。
|
||||
LoadDressByConfig() 服务器加载。
|
||||
|
||||
# 角色衣服套装预设切换逻辑
|
||||
在WBP_CharacterItem中5个按钮BtnSuit_1、BtnSuit_2、BtnSuit_3、BtnSuit_4、BtnSuit_5会调用EventOnPresetClicked。
|
||||
|
||||
```ts
|
||||
EventOnPresetClicked(PresetIndex: number, IsDoubleClick: boolean):void {
|
||||
let curTime = UE.KismetSystemLibrary.GetGameTimeInSeconds(this)
|
||||
if (curTime - this.LastLoadPresetTime < 0.5) {
|
||||
console.warn('Click too fast , please try again later')
|
||||
return
|
||||
}
|
||||
this.LastLoadPresetTime = curTime;
|
||||
if (IsDoubleClick) {
|
||||
this.LoadPreset(PresetIndex)
|
||||
} else {
|
||||
this.PreviewPreset(PresetIndex)
|
||||
}
|
||||
}
|
||||
|
||||
public LoadPreset(PresetIndex: number): void {
|
||||
if (this.Idol == null) {
|
||||
console.error(`TsCharacterItem@LoadPreset error: idol is null`);
|
||||
return;
|
||||
}
|
||||
this.Idol.PropComp.ServerLoadPropPreset(PresetIndex);
|
||||
}
|
||||
|
||||
public PreviewPreset(PresetIndex: number): void {
|
||||
if (this.Idol == null) {
|
||||
console.error(`TsCharacterItem@PreviewPreset error: idol is null`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.Idol.PropComp.ClientLoadPropPreset(PresetIndex);
|
||||
this.RefreshPresetUIStatus()
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user