From dc0d947dfbbe14ec0554ca15518c9c029a7ed095 Mon Sep 17 00:00:00 2001 From: Glence Date: Fri, 10 Mar 2023 19:40:48 +0800 Subject: [PATCH] WIP for animations --- Assets/Scenes/Level1.shade | 12 +++++++++-- .../Player/PlayerStates/UT_PlayerIdleState.cs | 18 ++++++++++++---- .../Player/PlayerStates/UT_PlayerRunState.cs | 4 +++- .../Player/PlayerStates/UT_PlayerWalkState.cs | 14 +++++++++---- .../Gameplay/Player/SC_PlayerAnimations.cs | 6 ++++-- SHADE_CSharp/premake5.lua | 21 +++++++++++++------ 6 files changed, 56 insertions(+), 19 deletions(-) diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index ca74f938..2f822812 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -7668,8 +7668,8 @@ playerJumpStartClip: 223009573 playerJumpLoopClip: 230974023 playerJumpEndClip: 228134756 - silhouettePlayer: 51000 - silhouetteBag: 51000 + silhouettePlayer: 462 + silhouetteBag: 465 - EID: 65733 Name: HoldingPoint IsActive: true @@ -7753,6 +7753,10 @@ Mesh: 149697411 Material: 126391182 IsActive: true + Animator Component: + Rig: 77816045 + AnimationController: 0 + IsActive: true Scripts: ~ - EID: 465 Name: SilouetteBag @@ -7768,6 +7772,10 @@ Mesh: 144838771 Material: 126391182 IsActive: true + Animator Component: + Rig: 77816045 + AnimationController: 0 + IsActive: true Scripts: ~ - EID: 65732 Name: RespawnPoint diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs index 589db690..893818a3 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerIdleState.cs @@ -16,13 +16,23 @@ public class PlayerIdleState : BaseState { if (!holdItem) { - PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); - PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + if (PlayerAnimations.Instance.playerIdleClip) + { + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerIdleClip); + } } else { - PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); - PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + if (PlayerAnimations.Instance.playerCarryIdleClip) + { + PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryIdleClip); + } } } } diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs index dc39c045..7f30effc 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerRunState.cs @@ -14,10 +14,12 @@ public class PlayerRunState : BaseState public override void OnEnter() { //Debug.Log("WALK ENTER"); - if (PlayerAnimations.Instance) + if (PlayerAnimations.Instance && PlayerAnimations.Instance.playerRunClip) { PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerRunClip); PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerRunClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerRunClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerRunClip); } } public override void update() diff --git a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs index 12cdc860..c15fb5b1 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerStates/UT_PlayerWalkState.cs @@ -20,17 +20,23 @@ public class PlayerWalkState : BaseState { if (!holdItem) { - if(PlayerAnimations.Instance.playerWalkClip) + if (PlayerAnimations.Instance.playerWalkClip) + { PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); - if(PlayerAnimations.Instance.playerWalkClip) PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerWalkClip); + } } else { - if(PlayerAnimations.Instance.playerCarryWalkClip) + if (PlayerAnimations.Instance.playerCarryWalkClip) + { PlayerAnimations.Instance.playerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); - if(PlayerAnimations.Instance.playerCarryWalkClip) PlayerAnimations.Instance.BagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + PlayerAnimations.Instance.silhoPlayerAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + PlayerAnimations.Instance.silhoBagAnimator.Play(PlayerAnimations.Instance.playerCarryWalkClip); + } } } } diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs index 22b87d55..2bda8938 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs @@ -57,17 +57,19 @@ public class PlayerAnimations : Script if (!BagAnimator) Debug.LogError("Bag Animator is MISSING!"); - if(!silhouettePlayer) + if(silhouettePlayer) silhoPlayerAnimator = silhouettePlayer.GetComponent(); else Debug.LogError("Silho Player is MISSING!"); + if (!silhoPlayerAnimator) Debug.LogError("Silho Player Animator is MISSING!"); - if(!silhouetteBag) + if(silhouetteBag) silhoBagAnimator = silhouetteBag.GetComponent(); else Debug.LogError("Silho bag is MISSING!"); + if (!silhoBagAnimator) Debug.LogError("Silho Player Animator is MISSING!"); } diff --git a/SHADE_CSharp/premake5.lua b/SHADE_CSharp/premake5.lua index f735b515..c94bb438 100644 --- a/SHADE_CSharp/premake5.lua +++ b/SHADE_CSharp/premake5.lua @@ -26,24 +26,33 @@ project "SHADE_CSharp" } warnings 'Extra' - - postbuildcommands - { - "xcopy /r /y /q \"%{outputdir}\\net5.0\\SHADE_CSharp.xml\" \"%{outputdir}\"", - "xcopy /r /y /q \"%{outputdir}\\net5.0\\SHADE_CSharp.pdb\" \"%{outputdir}\"" - } filter "configurations:Debug" symbols "On" defines {"_DEBUG"} + postbuildcommands + { + "xcopy /r /y /q \"$(SolutionDir)\\bin\\Debug\\net5.0\\SHADE_CSharp.xml\" \"%{outputdir}\"", + "xcopy /r /y /q \"$(SolutionDir)\\bin\\Debug\\net5.0\\SHADE_CSharp.pdb\" \"%{outputdir}\"" + } filter "configurations:Release" optimize "On" defines{"_RELEASE"} + postbuildcommands + { + "xcopy /r /y /q \"$(SolutionDir)\\bin\\Release\\net5.0\\SHADE_CSharp.xml\" \"%{outputdir}\"", + "xcopy /r /y /q \"$(SolutionDir)\\bin\\Release\\net5.0\\SHADE_CSharp.pdb\" \"%{outputdir}\"" + } filter "configurations:Publish" optimize "On" defines{"_RELEASE"} + postbuildcommands + { + "xcopy /r /y /q \"$(SolutionDir)\\bin\\Release\\net5.0\\SHADE_CSharp.xml\" \"%{outputdir}\"", + "xcopy /r /y /q \"$(SolutionDir)\\bin\\Release\\net5.0\\SHADE_CSharp.pdb\" \"%{outputdir}\"" + } require "vstudio" -- 2.40.1