Stagger now
This commit is contained in:
1 parent
e61fcb78cf
commit
c8626a9806
718 files changed
+93824
-212081
No files matched your search
@@ -15,7 +15,7 @@ MonoBehaviour:
|
||||
m_DefaultGroup: c6b29e598b23fb86ab8489c479625427
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 44f126fa14b8a998a704e71aca5af9f9
|
||||
Hash: b113f67bc91e1581674910b7e68471ef
|
||||
m_ExtractTypeTreeData: 0
|
||||
m_DisableWriteTypeTree: 0
|
||||
m_OptimizeCatalogSize: 0
|
||||
@@ -109,7 +109,7 @@ MonoBehaviour:
|
||||
- Volume
|
||||
- SceneInfo
|
||||
- CleanTool
|
||||
- AttackAction
|
||||
- BattleAction
|
||||
m_SchemaTemplates: []
|
||||
m_GroupTemplateObjects:
|
||||
- {fileID: 11400000, guid: 8c4ebef95ae1ef057bea1e3916daec48, type: 2}
|
||||
|
||||
@@ -40,13 +40,19 @@ MonoBehaviour:
|
||||
m_Address: Assets/OfficeGame/Player/Animations/Mma Kick.asset
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels:
|
||||
- AttackAction
|
||||
- BattleAction
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 1d088f052c2092d1f9cb64b3a16f5779
|
||||
m_Address: Assets/Infrastructure/UI/CanvasSettings.asset
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 1e89d0da735f7493fb460a85555999d6
|
||||
m_Address: Assets/OfficeGame/Player/Animations/Stugger.asset
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels:
|
||||
- BattleAction
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 21e867e417abc566db705349d91556ce
|
||||
m_Address: Assets/OfficeGame/Testing/Segments/SecondTestingSegment.unity
|
||||
m_ReadOnly: 0
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Code.Game.TestingLevel
|
||||
.AsUniTask();
|
||||
|
||||
var factoryConfig = new SingleConfig<PlayerFactorySettings>();
|
||||
var attackActionsConfigs = new MultipleConfig<AttackActionConfig>();
|
||||
var attackActionsConfigs = new MultipleConfig<BattleActionParameters>();
|
||||
|
||||
await UniTask.WhenAll(factoryConfig.LoadConfig(), attackActionsConfigs.LoadConfigs());
|
||||
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.OfficeGame.BattleMode.HitBoxes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
{
|
||||
[Config("Configs/AttackAction", true)]
|
||||
[CreateAssetMenu(fileName = "AttackActionConfig", menuName = "Configs/AttackAction")]
|
||||
public class AttackActionConfig : ScriptableObject
|
||||
public class AttackActionConfig : BattleActionParameters
|
||||
{
|
||||
public BattleActionType ActionType;
|
||||
|
||||
public AnimationClip AnimationClip;
|
||||
|
||||
public int StateHash => Animator.StringToHash(AnimationClip.name);
|
||||
|
||||
public int TotalFrames;
|
||||
|
||||
public int HitboxStartFrame;
|
||||
|
||||
public int HitboxEndFrame;
|
||||
|
||||
@@ -17,11 +17,11 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
private int _currentFrame;
|
||||
|
||||
[Inject]
|
||||
public void Construct(MultipleConfig<AttackActionConfig> attackData)
|
||||
public void Construct(MultipleConfig<BattleActionParameters> attackData)
|
||||
{
|
||||
_animator = GetComponentInChildren<Animator>();
|
||||
_entityHitBoxes = GetComponent<EntityHitBoxes>();
|
||||
_attackData = attackData.Configs.SingleOrDefault(x=>x.ActionType == ActionType);
|
||||
_attackData = (AttackActionConfig) attackData.Configs.SingleOrDefault(x=>x.ActionType == ActionType);
|
||||
}
|
||||
|
||||
public override async UniTask<BattleActionDecisionResultCode> DecideAction()
|
||||
@@ -64,6 +64,9 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
private void OnEnemyHit(Collider enemyCollider)
|
||||
{
|
||||
Debug.Log($"Попадание в {enemyCollider.name} на {_currentFrame}-м кадре! Урон: {_attackData.Damage}");
|
||||
var entityActor = enemyCollider.GetComponentInParent<EntityTimelineActor>();
|
||||
entityActor.ForceDecideAction(BattleActionType.Stugger);
|
||||
|
||||
}
|
||||
|
||||
public void CompleteOrInterruptAction()
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
[Config("Configs/BattleAction", true)]
|
||||
[CreateAssetMenu(fileName = "BattleActionConfig", menuName = "Configs/BattleAction")]
|
||||
public class BattleActionParameters: ScriptableObject
|
||||
{
|
||||
public BattleActionType ActionType;
|
||||
|
||||
public AnimationClip AnimationClip;
|
||||
|
||||
public int StateHash => Animator.StringToHash(AnimationClip.name);
|
||||
|
||||
public int TotalFrames;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c9ef585559248f0ba66635a85a6c829
|
||||
timeCreated: 1793025207
|
||||
@@ -0,0 +1,61 @@
|
||||
using System.Linq;
|
||||
using Code.Infrastructure.Utils;
|
||||
using Code.OfficeGame.BattleMode.HitBoxes;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
public class BattleActionStugger : BattleAction
|
||||
{
|
||||
private Animator _animator;
|
||||
private EntityHitBoxes _entityHitBoxes;
|
||||
private int EntryStateHash => Animator.StringToHash("WalkBlend");
|
||||
private int StuggerStateHash => Animator.StringToHash("Stugger");
|
||||
|
||||
private BattleActionParameters _actionParameters;
|
||||
|
||||
private int _currentFrame;
|
||||
|
||||
[Inject]
|
||||
public void Construct(MultipleConfig<BattleActionParameters> actionData)
|
||||
{
|
||||
_animator = GetComponentInChildren<Animator>();
|
||||
_entityHitBoxes = GetComponent<EntityHitBoxes>();
|
||||
_actionParameters = actionData.Configs.SingleOrDefault(x => x.ActionType == ActionType);
|
||||
}
|
||||
public override async UniTask<BattleActionDecisionResultCode> DecideAction()
|
||||
{
|
||||
_currentFrame = 0;
|
||||
Finished = false;
|
||||
|
||||
return BattleActionDecisionResultCode.Decided;
|
||||
}
|
||||
|
||||
public override BattleActionType ActionType => BattleActionType.Stugger;
|
||||
|
||||
public override void Tick(float tickDelta)
|
||||
{
|
||||
if (Finished) return;
|
||||
|
||||
if (_currentFrame == 0)
|
||||
{
|
||||
_animator.Play(StuggerStateHash, 0, 0f);
|
||||
}
|
||||
|
||||
_currentFrame++;
|
||||
|
||||
if (_currentFrame >= _actionParameters.TotalFrames)
|
||||
{
|
||||
CompleteOrInterruptAction();
|
||||
}
|
||||
}
|
||||
|
||||
public void CompleteOrInterruptAction()
|
||||
{
|
||||
_animator.Play(EntryStateHash, 0, 0f); // Создать None State и кинуть эту штуку туда
|
||||
Finished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91ff2d61ed324b62957ec67153dcfcd5
|
||||
timeCreated: 1793024093
|
||||
@@ -5,6 +5,7 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
None,
|
||||
Wait,
|
||||
Move,
|
||||
PlayerAttackMMA
|
||||
PlayerAttackMMA,
|
||||
Stugger
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
public bool Finished => CurrentAction == null || CurrentAction.Finished;
|
||||
|
||||
public abstract UniTask DecideAction(CancellationToken ctx);
|
||||
public abstract void ForceDecideAction(BattleActionType actionType);
|
||||
|
||||
[DoNotSerialize] public Animator animator;
|
||||
|
||||
|
||||
@@ -41,5 +41,11 @@ namespace Code.OfficeGame.BattleMode.Actions.Player
|
||||
}
|
||||
CurrentAction = BattleActions[decidedAction];
|
||||
}
|
||||
|
||||
public override void ForceDecideAction(BattleActionType actionType)
|
||||
{
|
||||
CurrentAction = BattleActions[actionType];
|
||||
CurrentAction.DecideAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.HitBoxes
|
||||
{
|
||||
// TODO Добавить меотды отключения,чтобы не получать урон во время стаггера
|
||||
public class EntityHitBoxes : MonoBehaviour
|
||||
{
|
||||
[Serializable]
|
||||
|
||||
@@ -898,6 +898,7 @@ GameObject:
|
||||
- component: {fileID: 1642146228553031303}
|
||||
- component: {fileID: 2915538842514811766}
|
||||
- component: {fileID: 3634170979914840227}
|
||||
- component: {fileID: 1066720593343024550}
|
||||
m_Layer: 3
|
||||
m_Name: Companion
|
||||
m_TagString: Untagged
|
||||
@@ -1077,6 +1078,18 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 5af678ef30f04b7093df4488ed133bff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Code.OfficeGame.BattleMode.Actions.BattleActionWait
|
||||
--- !u!114 &1066720593343024550
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4619667822637681491}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 91ff2d61ed324b62957ec67153dcfcd5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Code.OfficeGame.BattleMode.Actions.BattleActionStugger
|
||||
--- !u!1 &4999618383784345993
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3c9ef585559248f0ba66635a85a6c829, type: 3}
|
||||
m_Name: Stugger
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Code.OfficeGame.BattleMode.Actions.BattleActionParameters
|
||||
ActionType: 4
|
||||
AnimationClip: {fileID: -2945207999064407817, guid: 6b292eac3f2644cf9b2aab9ab117c2a7, type: 3}
|
||||
TotalFrames: 59
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3eab09540515480f90cc053f8cb680d
|
||||
guid: 1e89d0da735f7493fb460a85555999d6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84eeeb244dc88ef8ea5351429b74a76b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 64d3b955991e69aad96769fe04b482e2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,31 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1102 &-5134193005504543649
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Stugger
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: -2945207999064407817, guid: 6b292eac3f2644cf9b2aab9ab117c2a7, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1102 &-351307674499923201
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
@@ -76,6 +102,9 @@ AnimatorStateMachine:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -351307674499923201}
|
||||
m_Position: {x: 300, y: 220, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -5134193005504543649}
|
||||
m_Position: {x: 300, y: 290, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -41,6 +41,7 @@ MonoBehaviour:
|
||||
m_SubObjectType:
|
||||
m_SubObjectGUID:
|
||||
m_EditorAssetChanged: 0
|
||||
BattleActionParameters: BattleAction
|
||||
AudioSourceSettings: AudioSourceSettings
|
||||
AudioSourcePrefab:
|
||||
m_AssetGUID: 2e21bba962bb10f53a41bb8aee11cbb2
|
||||
@@ -55,4 +56,3 @@ MonoBehaviour:
|
||||
m_SubObjectGUID:
|
||||
m_EditorAssetChanged: 0
|
||||
AudioInfoConfig: AudioInfo
|
||||
AttackActionConfig: AttackAction
|
||||
Reference in new issue
Block a user