unitysamples / LyraStarterGame /Plugins /GameSettings /Source /Private /EditCondition /WhenPlayingAsPrimaryPlayer.cpp
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| TSharedRef<FWhenPlayingAsPrimaryPlayer> FWhenPlayingAsPrimaryPlayer::Get() | |
| { | |
| static TSharedRef<FWhenPlayingAsPrimaryPlayer> Instance = MakeShared<FWhenPlayingAsPrimaryPlayer>(); | |
| return Instance; | |
| } | |
| void FWhenPlayingAsPrimaryPlayer::GatherEditState(const ULocalPlayer* InLocalPlayer, FGameSettingEditableState& InOutEditState) const | |
| { | |
| if (!InLocalPlayer->IsPrimaryPlayer()) | |
| { | |
| InOutEditState.Disable(LOCTEXT("OnlyPrimaryPlayerEditable", "Can only be changed by the primary player.")); | |
| } | |
| } | |