阶段暂存
This commit is contained in:
Binary file not shown.
BIN
Content/Blueprint/Level/Actor/RoamingCamera.uasset
Normal file
BIN
Content/Blueprint/Level/Actor/RoamingCamera.uasset
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/Blueprint/Level/Actor/Static/BP_Campsite.uasset
Normal file
BIN
Content/Blueprint/Level/Actor/Static/BP_Campsite.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/Level/Actor/Static/BP_Tree.uasset
Normal file
BIN
Content/Blueprint/Level/Actor/Static/BP_Tree.uasset
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/Blueprint/Level/GameMode/BP_BusyLevelGameState.uasset
Normal file
BIN
Content/Blueprint/Level/GameMode/BP_BusyLevelGameState.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Data/Input/Level/IA_CameraDetach.uasset
Normal file
BIN
Content/Data/Input/Level/IA_CameraDetach.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
Content/Lua/@types/BusyGameplayLibrary.d.lua
Normal file
3
Content/Lua/@types/BusyGameplayLibrary.d.lua
Normal file
@ -0,0 +1,3 @@
|
||||
--- @class BusyGameplayLibrary
|
||||
--- @field K2_GetWorld fun(obj:table):table
|
||||
local BusyGameplayLibrary = {}
|
||||
@ -27,3 +27,9 @@ slua = {
|
||||
KismetSystemLibrary = {
|
||||
K2_ClearTimerHandle = function() end
|
||||
}
|
||||
|
||||
|
||||
--- @class GameplayStatics
|
||||
--- @field GetPlayerController fun(uobj:table,idx:number):table
|
||||
--- @field GetGameState fun(uobj:table):table
|
||||
local GameplayStatics
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
local BusyPlayerRole = {}
|
||||
|
||||
function BusyPlayerRole:UpdateMoveDirection(InDirection)
|
||||
if(InDirection.Y > 0) then
|
||||
self["SpineAnimationComponent"]:SetSkin("front/move")
|
||||
else
|
||||
self["SpineAnimationComponent"]:SetSkin("back/move")
|
||||
end
|
||||
end
|
||||
|
||||
return Class(nil, nil, BusyPlayerRole)
|
||||
4
Content/Lua/Level/Actor/LevelFoxRole.lua
Normal file
4
Content/Lua/Level/Actor/LevelFoxRole.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local LevelFoxRole = {}
|
||||
|
||||
|
||||
return Class(nil, nil, LevelFoxRole)
|
||||
58
Content/Lua/Level/Actor/LevelRabbitRole.lua
Normal file
58
Content/Lua/Level/Actor/LevelRabbitRole.lua
Normal file
@ -0,0 +1,58 @@
|
||||
local LevelRabbitRole = {}
|
||||
|
||||
function LevelRabbitRole:ctor()
|
||||
self.last_animation = "back/move"
|
||||
end
|
||||
|
||||
function LevelRabbitRole:ReceiveBeginPlay()
|
||||
self["SpineAnimationComponent"]:SetSkin("back/move");
|
||||
self["SpineAnimationComponent"]:SetAnimation(0, "animation", true);
|
||||
end
|
||||
|
||||
|
||||
function LevelRabbitRole:OnMove(location)
|
||||
-- 控制器移动相应函数
|
||||
self["MovementComponent"]:MoveTo(location)
|
||||
end
|
||||
|
||||
|
||||
function LevelRabbitRole:UpdateMoveDirection(InDirection)
|
||||
-- 运动组件更新方向响应函数
|
||||
local cur_animation
|
||||
if(InDirection.Y >= 0) then
|
||||
cur_animation = "front/move"
|
||||
else
|
||||
cur_animation = "back/move"
|
||||
end
|
||||
if cur_animation ~= self.last_animation then
|
||||
self["SpineAnimationComponent"]:SetSkin(cur_animation)
|
||||
self["SpineAnimationComponent"]:SetSlotsToSetupPose()
|
||||
self.last_animation = cur_animation
|
||||
end
|
||||
end
|
||||
|
||||
function LevelRabbitRole:OnDetachCamera()
|
||||
print(self, "LevelRabbitRole.OnDetachCamera")
|
||||
|
||||
-- 禁用弹簧臂的附着
|
||||
self["SpringArmComponent"].bEnableCameraRotationLag = true
|
||||
self["SpringArmComponent"].CameraRotationLagSpeed = 0
|
||||
-- 保持当前位置,停止跟随
|
||||
self["SpringArmComponent"].bInheritPitch = true
|
||||
self["SpringArmComponent"].bInheritYaw = true
|
||||
self["SpringArmComponent"].bInheritRoll = true
|
||||
|
||||
-- (Pitch=0.000000,Yaw=-90.000000,Roll=0.000000)
|
||||
end
|
||||
|
||||
function LevelRabbitRole:OnReattachCamera()
|
||||
print(self, "LevelRabbitRole.OnReattachCamera")
|
||||
end
|
||||
|
||||
|
||||
function LevelRabbitRole:OnMoveCamera(direction)
|
||||
print(self, "LevelRabbitRole.OnMoveCamera", direction.X, direction.Y)
|
||||
end
|
||||
|
||||
|
||||
return Class(nil, nil, LevelRabbitRole)
|
||||
4
Content/Lua/Level/Actor/Static/Campsite.lua
Normal file
4
Content/Lua/Level/Actor/Static/Campsite.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local Campsite = {}
|
||||
|
||||
|
||||
return Class(nil, nil, Campsite)
|
||||
@ -1,13 +1,36 @@
|
||||
local Vector = import("Vector")
|
||||
local GameplayStatics = import("GameplayStatics")
|
||||
local BusyGameplayLibrary = import("BusyGameplayLibrary")
|
||||
|
||||
--- 保留到以后做联机内容时拓展
|
||||
--- @class LevelGameMode
|
||||
--- @field GameMapActorClass table
|
||||
local LevelGameMode = {}
|
||||
|
||||
function LevelGameMode:K2_PostLogin(new_player_controller)
|
||||
|
||||
local new_player_state = new_player_controller.PlayerState
|
||||
|
||||
local role = new_player_state:CreateRoleRoster(new_player_controller)
|
||||
|
||||
new_player_controller:Possess(role)
|
||||
|
||||
function LevelGameMode:ctor()
|
||||
self.map_actor = nil
|
||||
end
|
||||
|
||||
function LevelGameMode:ReceiveBeginPlay()
|
||||
print("LevelGameMode:ReceiveBeginPlay", self.GameMapActorClass)
|
||||
local world = BusyGameplayLibrary.K2_GetWorld(self)
|
||||
local game_state = GameplayStatics.GetGameState(self) --- @type LevelGameState
|
||||
|
||||
if self.GameMapActorClass then
|
||||
local map_actor = world:SpawnActor(self.GameMapActorClass, Vector(), nil, nil)
|
||||
game_state:SetGameMapActor(map_actor)
|
||||
end
|
||||
end
|
||||
|
||||
-- function LevelGameMode:K2_PostLogin(new_player_controller)
|
||||
-- local new_player_state = new_player_controller.PlayerState
|
||||
-- local role = new_player_state:CreateRoleRoster(new_player_controller)
|
||||
-- local new_pos = FVector()
|
||||
-- new_pos.X = 500
|
||||
-- new_pos.Y = 500
|
||||
-- new_pos.Z = 50
|
||||
-- role:K2_SetActorLocation(new_pos, true, nil, false)
|
||||
-- new_player_controller:Possess(role)
|
||||
-- end
|
||||
|
||||
return Class(nil, nil, LevelGameMode)
|
||||
9
Content/Lua/Level/LevelGameState.lua
Normal file
9
Content/Lua/Level/LevelGameState.lua
Normal file
@ -0,0 +1,9 @@
|
||||
--- @class LevelGameState
|
||||
local LevelGameState = {}
|
||||
|
||||
function LevelGameState:SetGameMapActor(game_map_actor)
|
||||
self.GameMapActor = game_map_actor
|
||||
end
|
||||
|
||||
|
||||
return Class(nil, nil, LevelGameState)
|
||||
12
Content/Lua/Level/LevelPlayerState.lua
Normal file
12
Content/Lua/Level/LevelPlayerState.lua
Normal file
@ -0,0 +1,12 @@
|
||||
local GameplayStatics = import("GameplayStatics")
|
||||
|
||||
local LevelPlayerState = {}
|
||||
|
||||
function LevelPlayerState:ReceiveBeginPlay()
|
||||
local pc = GameplayStatics.GetPlayerController(self, 0)
|
||||
local role = self:CreateRoleRoster(pc)
|
||||
print("LevelPlayerState:ReceiveBeginPlay", role, self:HasAuthority())
|
||||
pc:Possess(role)
|
||||
end
|
||||
|
||||
return Class(nil, nil, LevelPlayerState)
|
||||
BIN
Content/Resource/Spine/PlacedItems/Fire/Fire.uasset
Normal file
BIN
Content/Resource/Spine/PlacedItems/Fire/Fire.uasset
Normal file
Binary file not shown.
BIN
Content/Resource/Spine/PlacedItems/Fire/FireData.uasset
Normal file
BIN
Content/Resource/Spine/PlacedItems/Fire/FireData.uasset
Normal file
Binary file not shown.
BIN
Content/Resource/Spine/PlacedItems/Fire/Textures/Fire.uasset
Normal file
BIN
Content/Resource/Spine/PlacedItems/Fire/Textures/Fire.uasset
Normal file
Binary file not shown.
BIN
Content/Resource/Spine/PlacedItems/Tree/Textures/Tree.uasset
Normal file
BIN
Content/Resource/Spine/PlacedItems/Tree/Textures/Tree.uasset
Normal file
Binary file not shown.
BIN
Content/Resource/Spine/PlacedItems/Tree/Tree.uasset
Normal file
BIN
Content/Resource/Spine/PlacedItems/Tree/Tree.uasset
Normal file
Binary file not shown.
BIN
Content/Resource/Spine/PlacedItems/Tree/TreeData.uasset
Normal file
BIN
Content/Resource/Spine/PlacedItems/Tree/TreeData.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user