Shooting Enemy Improvements

This commit is contained in:
Syntriax 2022-02-26 00:01:18 +03:00
parent 8c37322121
commit 622c1e373c
6 changed files with 215 additions and 15 deletions

View File

@ -11,7 +11,7 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 5876367394177316943}
m_Position: {x: 200, y: 0, z: 0}
m_Position: {x: 240, y: 100, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []

View File

@ -17,15 +17,42 @@ AnimationClip:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: -1157838632, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.2
value: {fileID: -462201011, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.4
value: {fileID: 743132909, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.6
value: {fileID: -2076608484, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.8
value: {fileID: -1235347885, guid: 1efadb39977408e45afdf46717553bba, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 5
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -1157838632, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: -462201011, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: 743132909, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: -2076608484, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: -1235347885, guid: 1efadb39977408e45afdf46717553bba, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}

View File

@ -17,21 +17,48 @@ AnimationClip:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: -1349788792, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.083333336
value: {fileID: 126039133, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.16666667
value: {fileID: 1248009340, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.25
value: {fileID: 223013045, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- time: 0.33333334
value: {fileID: 1054640101, guid: 1efadb39977408e45afdf46717553bba, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 12
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -1349788792, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: 126039133, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: 1248009340, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: 223013045, guid: 1efadb39977408e45afdf46717553bba, type: 3}
- {fileID: 1054640101, guid: 1efadb39977408e45afdf46717553bba, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_StopTime: 0.4166667
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0

View File

@ -1,5 +1,82 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-8925493173552996503
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: isAttacking
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 6197246932365002679}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.40000004
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-4341753384189100879
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Shooting Patrolling
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -8925493173552996503}
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: 7400000, guid: 5d5c3517990910d4b80e8c4c92b28458, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-1022967042000561681
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: isAttacking
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -4341753384189100879}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.40000004
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
@ -8,5 +85,75 @@ AnimatorController:
m_PrefabAsset: {fileID: 0}
m_Name: ShootingPatrollingEnemy_0
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers: []
m_AnimatorParameters:
- m_Name: isAttacking
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 6241431251955664347}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &6197246932365002679
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Shooting Patrolling Attack
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -1022967042000561681}
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: 7400000, guid: a19cbb84a96566a46b1f1fe22265331b, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &6241431251955664347
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -4341753384189100879}
m_Position: {x: 270, y: 110, z: 0}
- serializedVersion: 1
m_State: {fileID: 6197246932365002679}
m_Position: {x: 270, y: 10, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -4341753384189100879}

View File

@ -62,9 +62,7 @@ namespace AI
movement.BaseSpeed = 0f;
animator.SetBool("isAttacking", true);
animator.speed = 0f;
yield return new WaitForSeconds(focusingTime);
animator.speed = 1f;
while (canShoot)
{
@ -74,6 +72,7 @@ namespace AI
}
movement.BaseSpeed = movementBaseSpeed;
animator.SetBool("isAttacking", false);
remainingCooldown = 0f;
isShooting = false;
}

View File

@ -14,7 +14,7 @@ TagManager:
- Player
- Enemy
- Interactables
-
- Projectiles
-
-
-