Skip to content

Instantly share code, notes, and snippets.

View dorgonman's full-sized avatar
☯️
inner peace

dorgon chang dorgonman

☯️
inner peace
View GitHub Profile
- ContentRootToPath Num=10 TArray<FPathPair,FDefaultAllocator>
+ [0] {RootPath=L"/Paper2D/" ContentPath=L"../../../Engine/Plugins/2D/Paper2D/Content/" } FPathPair
+ [1] {RootPath=L"/Engine/" ContentPath=L"../../../Engine/Content/" } FPathPair
+ [2] {RootPath=L"/Engine/" ContentPath=L"../../../Engine/Shaders/" } FPathPair
+ [3] {RootPath=L"/Game/" ContentPath=L"C:/Users/Dorgon/Documents/Unreal Projects/MyProject/Content/" } FPathPair
+ [4] {RootPath=L"/Script/" ContentPath=L"C:/Users/Dorgon/Documents/Unreal Projects/MyProject/Script/" } FPathPair
+ [5] {RootPath=L"/Temp/" ContentPath=L"C:/Users/Dorgon/Documents/Unreal Projects/MyProject/Saved/" } FPathPair
+ [6] {RootPath=L"/Game/" ContentPath=L"../../../MyProject/Content/" } FPathPair
+ [7] {RootPath=L"/Script/" ContentPath=L"../../../MyProject/Script/" } FPathPair
+ [8] {RootPath=L"/Temp/" ContentPath=L"../../../MyProject/Saved/" } FPathPair
FStringClassReference clsRef = "Blueprint'/Game/MyBlueprint.MyBlueprint_C'";
//AMyActor is my own c++ implemented actor that inherited from AActor
UClass* myBlueprintActorClass = clsRef.TryLoadClass<AMyActor>();
auto myBlueprintActor = GetWorld()->SpawnActor<AMyActor>(myBlueprintActorClass);
UENUM(BlueprintType, meta = (Bitflags))
enum class EHorizonPlayerSortType : uint8
{
Invalidated = 0,
Level UMETA(DisplayName = "PlayerLevel"),
Power UMETA(DisplayName = "Power"),
Speed UMETA(DisplayName = "Speed"),
PlaceHolder1 UMETA(DisplayName = "PlaceHolder1"),
PlaceHolder2 UMETA(DisplayName = "PlaceHolder2"),
PlaceHolder3 UMETA(DisplayName = "PlaceHolder3"),
enum class EHorizonPlayerSortType
{
Invalidated = ( 1 << 0),
Leve = ( 1 << 1),
Power = ( 1 << 2),
Speed = ( 1 << 3),
PlaceHolder1 = ( 1 << 4),
PlaceHolder2 = ( 1 << 5),
PlaceHolder3 = ( 1 << 6),
PlaceHolder4 = ( 1 << 7),
@dorgonman
dorgonman / cloudSettings
Last active August 25, 2019 15:18
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-08-25T15:18:01.590Z","extensionVersion":"v3.4.2"}
@dorgonman
dorgonman / ue4_build_plugin.sh
Last active March 17, 2018 05:05
ue4_build_plugin
UEBuildPlugin(){
mkdir -p "${PLUGIN_PACKAGE_ARCHIVE_DIR}"
PLUGIN_PACKAGE_ARCHIVE_DIR=$(cd "${PLUGIN_PACKAGE_ARCHIVE_DIR}"; pwd)
echo "-----------------------------------------------------"
echo "UEBuildPlugin: ${PLUGIN_FILE} ${PLUGIN_BUILD_TARGET} to ${PLUGIN_PACKAGE_ARCHIVE_DIR}"
echo "-----------------------------------------------------"
cmd=" \
'${UE4_ENGINE_ROOT}/Engine/Build/BatchFiles/RunUAT.bat' BuildPlugin \
-Plugin='${PLUGIN_FILE}' -TargetPlatforms=${PLUGIN_BUILD_TARGET} \
PredictionKey.NewRejectedDelegate().BindUObject(this, &UAbilitySystemComponent::OnPredictiveMontageRejected, NewAnimMontage);
void UAbilitySystemComponent::OnPredictiveMontageRejected(UAnimMontage* PredictiveMontage)
{
static const float MONTAGE_PREDICTION_REJECT_FADETIME = 0.25f;
UAnimInstance* AnimInstance = AbilityActorInfo.IsValid() ? AbilityActorInfo->GetAnimInstance() : nullptr;
if (AnimInstance && PredictiveMontage)
{
@dorgonman
dorgonman / UE4_GAS_Attribute_Replicate.cpp
Created June 14, 2018 15:45
UE4_GAS_Attribute_Replicate
void UMyHealthSet::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
   DOREPLIFETIME_CONDITION_NOTIFY(UMyHealthSet, Health, COND_None, REPNOTIFY_Always);
}
void UMyHealthSet::OnRep_Health()
{
    GAMEPLAYATTRIBUTE_REPNOTIFY(UMyHealthSet, Health);
}
@dorgonman
dorgonman / wordpress_post1561_01.cpp
Created June 26, 2018 15:42
wordpress_post1561_01.cpp
// We have fully received the bunch, so process it.
if( Bunch.bClose )
{
...
UE_LOG(LogNetTraffic, Log, TEXT("UChannel::ReceivedSequencedBunch: Bunch.bClose == true. Calling ConditionalCleanUp. ChIndex: %i"), ChIndex );
ConditionalCleanUp();
...
}
@dorgonman
dorgonman / wordpress_post1561_02.cpp
Created June 26, 2018 15:43
wordpress_post1561_02.cpp
int32 UNetDriver::ServerReplicateActors_ProcessPrioritizedActors( UNetConnection* Connection, const TArray<FNetViewer>& ConnectionViewers, FActorPriority** PriorityActors, const int32 FinalSortedCount, int32& OutUpdated )
{
...
// If the actor wasn't recently relevant, or if it was torn off, close the actor channel if it exists for this connection
if ( ( !bIsRecentlyRelevant || Actor->bTearOff ) && Channel != NULL )
{
...
UE_LOG( LogNetTraffic, Log, TEXT( "- Closing channel for no longer relevant actor %s" ), *Actor->GetName() );
Channel->Close();
...