forked from Tencent/UnLua
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chienluo
committed
Aug 13, 2019
0 parents
commit 102b557
Showing
229 changed files
with
26,220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[/Script/UnrealEd.AnalyticsPrivacySettings] | ||
bSendUsageData = false |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[/Script/EngineSettings.GeneralProjectSettings] | ||
ProjectID=6EA8D66B479BD73FE99BE9B2084D9F14 | ||
|
||
[/Script/UnrealEd.ProjectPackagingSettings] | ||
Build=IfProjectHasCode | ||
BuildConfiguration=PPBC_Shipping | ||
StagingDirectory=(Path="") | ||
FullRebuild=False | ||
ForDistribution=False | ||
IncludeDebugFiles=False | ||
BlueprintNativizationMethod=Disabled | ||
bIncludeNativizedAssetsInProjectGeneration=False | ||
bExcludeMonolithicEngineHeadersInNativizedCode=False | ||
UsePakFile=True | ||
bGenerateChunks=False | ||
bGenerateNoChunks=False | ||
bChunkHardReferencesOnly=False | ||
bBuildHttpChunkInstallData=False | ||
HttpChunkInstallDataDirectory=(Path="") | ||
HttpChunkInstallDataVersion= | ||
IncludePrerequisites=False | ||
IncludeAppLocalPrerequisites=False | ||
bShareMaterialShaderCode=False | ||
bSharedMaterialNativeLibraries=False | ||
ApplocalPrerequisitesDirectory=(Path="") | ||
IncludeCrashReporter=False | ||
InternationalizationPreset=English | ||
-CulturesToStage=en | ||
+CulturesToStage=en | ||
bCookAll=True | ||
bCookMapsOnly=False | ||
bCompressed=True | ||
bEncryptIniFiles=False | ||
bEncryptPakIndex=False | ||
bSkipEditorContent=True | ||
bSkipMovies=False | ||
+DirectoriesToAlwaysStageAsUFS=(Path="Script") | ||
bNativizeBlueprintAssets=False | ||
bNativizeOnlySelectedBlueprints=False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[/Script/Engine.GameUserSettings] | ||
ResolutionSizeX=1920 | ||
ResolutionSizeY=1080 | ||
FullscreenMode=2 | ||
bUseDesktopResolution=false | ||
Version=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
|
||
[/Script/Engine.InputSettings] | ||
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) | ||
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) | ||
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Left_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_Z",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Z",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_FaceButton1",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_FaceButton2",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_IndexPointing",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_ThumbUp",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_FaceButton1",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_FaceButton2",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_IndexPointing",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_ThumbUp",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouchpad_Touchpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouchpad_Touchpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Left_HandGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Left_IndexGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Left_MiddleGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Left_RingGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Left_PinkyGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_HandGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_IndexGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_MiddleGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_RingGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="SteamVR_Knuckles_Right_PinkyGrip",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
bAltEnterTogglesFullscreen=True | ||
bF11TogglesFullscreen=True | ||
bUseMouseForTouch=False | ||
bEnableMouseSmoothing=True | ||
bEnableFOVScaling=True | ||
bCaptureMouseOnLaunch=True | ||
bDefaultViewportMouseLock=False | ||
bAlwaysShowTouchInterface=False | ||
bShowConsoleOnFourFingerTap=True | ||
bEnableGestureRecognizer=False | ||
bUseAutocorrect=False | ||
DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown | ||
DefaultViewportMouseLockMode=LockOnCapture | ||
FOVScale=0.011110 | ||
DoubleClickTime=0.200000 | ||
+ActionMappings=(ActionName="Fire",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=SpaceBar) | ||
+ActionMappings=(ActionName="Aim",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=RightMouseButton) | ||
+ActionMappings=(ActionName="Fire",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftMouseButton) | ||
+ActionMappings=(ActionName="Fire",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Bottom) | ||
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W) | ||
+AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D) | ||
+AxisMappings=(AxisName="Turn",Scale=1.000000,Key=MouseX) | ||
+AxisMappings=(AxisName="LookUp",Scale=-1.000000,Key=MouseY) | ||
+AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S) | ||
+AxisMappings=(AxisName="MoveRight",Scale=-1.000000,Key=A) | ||
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=Gamepad_LeftY) | ||
+AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=Gamepad_LeftX) | ||
+AxisMappings=(AxisName="LookUpRate",Scale=1.000000,Key=Gamepad_RightY) | ||
+AxisMappings=(AxisName="TurnRate",Scale=1.000000,Key=Gamepad_RightX) | ||
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks | ||
ConsoleKey=None | ||
-ConsoleKeys=Tilde | ||
+ConsoleKeys=Tilde | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+108 KB
Content/AnimationAssets/UE4_Mannequin/Materials/M_UE4Man_ChestLogo.uasset
Binary file not shown.
Binary file added
BIN
+104 KB
...nt/AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset
Binary file not shown.
Binary file added
BIN
+82.8 KB
Content/AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset
Binary file not shown.
Binary file added
BIN
+83.8 KB
...AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset
Binary file not shown.
Binary file added
BIN
+96.1 KB
Content/AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset
Binary file not shown.
Binary file added
BIN
+424 KB
Content/AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/T_ML_Aluminum01.uasset
Binary file not shown.
Binary file added
BIN
+396 KB
Content/AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset
Binary file not shown.
Binary file added
BIN
+460 KB
Content/AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset
Binary file not shown.
Binary file added
BIN
+354 KB
Content/AnimationAssets/UE4_Mannequin/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+25.5 KB
Content/AnimationAssets/UE4_Mannequin/Mesh/SK_Mannequin_PhysicsAsset.uasset
Binary file not shown.
Binary file added
BIN
+10.9 KB
Content/AnimationAssets/UE4_Mannequin/Mesh/UE4_Mannequin_Skeleton.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+268 KB
Content/AnimationAssets/UE4_Mannequin/Textures/UE4_Mannequin_MAT_MASKA.uasset
Binary file not shown.
Binary file added
BIN
+5.23 MB
Content/AnimationAssets/UE4_Mannequin/Textures/UE4_Mannequin__normals.uasset
Binary file not shown.
Binary file added
BIN
+354 KB
Content/AnimationAssets/UE4_Mannequin/Textures/UE4_Mannequin_occlusion_Mobile.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+118 KB
Content/FPWeapon/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset
Binary file not shown.
Binary file added
BIN
+112 KB
Content/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset
Binary file not shown.
Binary file added
BIN
+112 KB
Content/FPWeapon/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.25 MB
Content/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset
Binary file not shown.
Binary file added
BIN
+4.68 MB
Content/FPWeapon/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require "UnLua" | ||
|
||
local BP_AICharacter_C= Class("BP_CharacterBase_C") | ||
|
||
function BP_AICharacter_C:Initialize(Initializer) | ||
self.Super.Initialize(self) | ||
self.Damage = 128.0 | ||
--self.DamageType = UE4.UClass.Load("/Script/Engine.DamageType") | ||
self.DamageType = UE4.UClass.Load("UDamageType") | ||
end | ||
|
||
--function BP_AICharacter_C:UserConstructionScript() | ||
--end | ||
|
||
function BP_AICharacter_C:ReceiveBeginPlay() | ||
self.Super.ReceiveBeginPlay(self) | ||
self.Sphere.OnComponentBeginOverlap:Add(self, BP_AICharacter_C.OnComponentBeginOverlap_Sphere) | ||
end | ||
|
||
function BP_AICharacter_C:Died(DamageType) | ||
self.Super.Died(self, DamageType) | ||
self.Sphere:SetCollisionEnabled(UE4.ECollisionEnabled.NoCollision) | ||
local NewLocation = UE4.FVector(0.0, 0.0, self.CapsuleComponent.CapsuleHalfHeight) | ||
local SweepHitResult = UE4.FHitResult() | ||
self.Mesh:K2_SetRelativeLocation(NewLocation, false, SweepHitResult, false) | ||
self.Mesh:SetAllBodiesBelowSimulatePhysics(self.BoneName, true, true) | ||
local GameMode = UE4.UGameplayStatics.GetGameMode(self) | ||
UE4.UBPI_Interfaces_C.NotifyEnemyDied(GameMode) | ||
--self.Sphere.OnComponentBeginOverlap:Remove(self, BP_AICharacter_C.OnComponentBeginOverlap_Sphere) | ||
end | ||
|
||
function BP_AICharacter_C:OnComponentBeginOverlap_Sphere(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) | ||
local PlayerCharacter = OtherActor:Cast(UE4.ABP_PlayerCharacter_C) | ||
if PlayerCharacter then | ||
local Controller = self:GetController() | ||
UE4.UGameplayStatics.ApplyDamage(PlayerCharacter, self.Damage, Controller, self, self.DamageType) | ||
end | ||
end | ||
|
||
return BP_AICharacter_C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "UnLua" | ||
|
||
local BP_AIController_C = Class() | ||
|
||
--BP_AIController_C.BehaviorTree = UObject.Load("/Game/Core/Blueprints/AI/BT_Enemy") | ||
BP_AIController_C.BehaviorTree = LoadObject("/Game/Core/Blueprints/AI/BT_Enemy") | ||
|
||
function BP_AIController_C:ReceiveBeginPlay() | ||
--local BehaviorTree = UObject.Load("/Game/Core/Blueprints/AI/BT_Enemy") | ||
self:RunBehaviorTree(self.BehaviorTree) | ||
end | ||
|
||
return BP_AIController_C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require "UnLua" | ||
|
||
local ABP_AICharacter_C = Class() | ||
|
||
function ABP_AICharacter_C:AnimNotify_NotifyPhysics() | ||
UE4.UBPI_Interfaces_C.ChangeToRagdoll(self.Pawn) | ||
end | ||
|
||
function ABP_AICharacter_C:BlueprintBeginPlay() | ||
self.Velocity = UE4.FVector() | ||
self.Pawn = self:TryGetPawnOwner() | ||
end | ||
|
||
function ABP_AICharacter_C:BlueprintUpdateAnimation(DeltaTimeX) | ||
local Pawn = self:TryGetPawnOwner(self.Pawn) | ||
if not Pawn then | ||
return | ||
end | ||
local Vel = Pawn:GetVelocity(self.Velocity) | ||
if not Vel then | ||
return | ||
end | ||
self.Speed = Vel:Size() | ||
local Character = Pawn:Cast(UE4.ABP_CharacterBase_C) | ||
if Character then | ||
if Character.IsDead and not self.IsDead then | ||
self.IsDead = true | ||
self.DeathAnimIndex = UE4.UKismetMathLibrary.RandomIntegerInRange(0, 2) | ||
end | ||
end | ||
end | ||
|
||
return ABP_AICharacter_C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
require "UnLua" | ||
|
||
local ABP_PlayerCharacter_C = Class() | ||
|
||
function ABP_PlayerCharacter_C:AnimNotify_NotifyPhysics() | ||
UE4.UBPI_Interfaces_C.ChangeToRagdoll(self.Pawn) | ||
end | ||
|
||
function ABP_PlayerCharacter_C:BlueprintBeginPlay() | ||
self.Velocity = UE4.FVector() | ||
self.ForwardVec = UE4.FVector() | ||
self.RightVec = UE4.FVector() | ||
self.ControlRot = UE4.FRotator() | ||
self.Pawn = self:TryGetPawnOwner() | ||
end | ||
|
||
function ABP_PlayerCharacter_C:BlueprintUpdateAnimation(DeltaTimeX) | ||
local Pawn = self:TryGetPawnOwner(self.Pawn) | ||
if not Pawn then | ||
return | ||
end | ||
local Vel = Pawn:GetVelocity(self.Velocity) | ||
if not Vel then | ||
return | ||
end | ||
local Character = Pawn:Cast(UE4.ABP_CharacterBase_C) | ||
if Character then | ||
if Character.IsDead and not self.IsDead then | ||
self.IsDead = true | ||
self.DeathAnimIndex = UE4.UKismetMathLibrary.RandomIntegerInRange(0, 2) | ||
end | ||
end | ||
local Speed = Vel:Size() | ||
self.Speed = Speed | ||
if Speed > 0.0 then | ||
Vel:Normalize() | ||
local Rot = Pawn:GetControlRotation(self.ControlRot) | ||
Rot:Set(0, Rot.Yaw, 0) | ||
local ForwardVec = Rot:GetForwardVector(self.ForwardVec) | ||
local RightVec = Rot:GetRightVector(self.RightVec) | ||
local DP0 = Vel:Dot(RightVec) | ||
local DP1 = Vel:Dot(ForwardVec) | ||
local Angle = UE4.UKismetMathLibrary.Acos(DP1) | ||
if DP0 > 0.0 then | ||
self.Direction = Angle | ||
else | ||
self.Direction = -Angle | ||
end | ||
end | ||
end | ||
|
||
return ABP_PlayerCharacter_C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
require "UnLua" | ||
|
||
local BP_CharacterBase_C = Class() | ||
|
||
function BP_CharacterBase_C:Initialize(Initializer) | ||
self.IsDead = false | ||
self.BodyDuration = 3.0 | ||
self.BoneName = nil | ||
local Health = 100 | ||
self.Health = Health | ||
self.MaxHealth = Health | ||
end | ||
|
||
--function BP_CharacterBase_C:UserConstructionScript() | ||
--end | ||
|
||
function BP_CharacterBase_C:ReceiveBeginPlay() | ||
local Weapon = self:SpawnWeapon() | ||
if Weapon then | ||
Weapon:K2_AttachToComponent(self.WeaponPoint, nil, UE4.EAttachmentRule.SnapToTarget, UE4.EAttachmentRule.SnapToTarget, UE4.EAttachmentRule.SnapToTarget) | ||
self.Weapon = Weapon | ||
end | ||
end | ||
|
||
function BP_CharacterBase_C:SpawnWeapon() | ||
return nil | ||
end | ||
|
||
function BP_CharacterBase_C:StartFire() | ||
if self.Weapon then | ||
self.Weapon:StartFire() | ||
end | ||
end | ||
|
||
function BP_CharacterBase_C:StopFire() | ||
if self.Weapon then | ||
self.Weapon:StopFire() | ||
end | ||
end | ||
|
||
function BP_CharacterBase_C:ReceiveAnyDamage(Damage, DamageType, InstigatedBy, DamageCauser) | ||
if not self.IsDead then | ||
local Health = self.Health - Damage | ||
self.Health = math.max(Health, 0) | ||
if Health <= 0.0 then | ||
self:Died(DamageType) | ||
local co = coroutine.create(BP_CharacterBase_C.Destroy) | ||
coroutine.resume(co, self, self.BodyDuration) | ||
end | ||
end | ||
end | ||
|
||
function BP_CharacterBase_C:Died(DamageType) | ||
self.IsDead = true | ||
self.CapsuleComponent:SetCollisionEnabled(UE4.ECollisionEnabled.NoCollision) | ||
self:StopFire() | ||
local Controller = self:GetController() | ||
Controller:UnPossess() | ||
end | ||
|
||
function BP_CharacterBase_C:Destroy(Duration) | ||
UE4.UKismetSystemLibrary.Delay(self, Duration) | ||
if self.Weapon then | ||
self.Weapon:K2_DestroyActor() | ||
end | ||
self:K2_DestroyActor() | ||
end | ||
|
||
function BP_CharacterBase_C:ChangeToRagdoll() | ||
self.Mesh:SetSimulatePhysics(true) | ||
end | ||
|
||
return BP_CharacterBase_C |
Oops, something went wrong.