diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_left.anim b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_left.anim new file mode 100644 index 0000000..79fb861 --- /dev/null +++ b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_left.anim @@ -0,0 +1,107 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: walk_left + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: + - curve: + - time: 0 + value: {fileID: -6959915571989194883, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.05 + value: {fileID: 960921020097805623, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.1 + value: {fileID: -3336701548478254045, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.15 + value: {fileID: -5400053455435091454, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.2 + value: {fileID: 4408406346810168619, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.25 + value: {fileID: -485737157877676475, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.3 + value: {fileID: -5106187503225981072, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.35 + value: {fileID: 4312765686203540801, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.4 + value: {fileID: 5251978615751408329, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.45 + value: {fileID: 2965599932687856292, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.5 + value: {fileID: 2365076705713957727, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.55 + value: {fileID: 6256131582671704638, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.6 + value: {fileID: 7208522903439339441, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.65 + value: {fileID: -8803371887732516606, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + m_SampleRate: 20 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + pptrCurveMapping: + - {fileID: -6959915571989194883, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 960921020097805623, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -3336701548478254045, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -5400053455435091454, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 4408406346810168619, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -485737157877676475, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -5106187503225981072, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 4312765686203540801, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 5251978615751408329, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 2965599932687856292, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 2365076705713957727, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 6256131582671704638, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 7208522903439339441, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -8803371887732516606, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.7 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_left.anim.meta b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_left.anim.meta new file mode 100644 index 0000000..e4ad174 --- /dev/null +++ b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_left.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2763a6c075e342dcb4da79a607727cde +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_right.anim b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_right.anim new file mode 100644 index 0000000..322238c --- /dev/null +++ b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_right.anim @@ -0,0 +1,170 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: walk_right + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: + - curve: + - time: 0 + value: {fileID: -6959915571989194883, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.05 + value: {fileID: 960921020097805623, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.1 + value: {fileID: -3336701548478254045, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.15 + value: {fileID: -5400053455435091454, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.2 + value: {fileID: 4408406346810168619, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.25 + value: {fileID: -485737157877676475, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.3 + value: {fileID: -5106187503225981072, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.35 + value: {fileID: 4312765686203540801, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.4 + value: {fileID: 5251978615751408329, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.45 + value: {fileID: 2965599932687856292, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.5 + value: {fileID: 2365076705713957727, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.55 + value: {fileID: 6256131582671704638, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.6 + value: {fileID: 7208522903439339441, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - time: 0.65 + value: {fileID: -8803371887732516606, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + m_SampleRate: 20 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 555744692 + script: {fileID: 0} + typeID: 212 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + pptrCurveMapping: + - {fileID: -6959915571989194883, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 960921020097805623, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -3336701548478254045, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -5400053455435091454, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 4408406346810168619, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -485737157877676475, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -5106187503225981072, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 4312765686203540801, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 5251978615751408329, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 2965599932687856292, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 2365076705713957727, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 6256131582671704638, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: 7208522903439339441, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + - {fileID: -8803371887732516606, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.7 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_FlipX + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_right.anim.meta b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_right.anim.meta new file mode 100644 index 0000000..a1895e1 --- /dev/null +++ b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_right.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13ab981c8ff1bfe4bb73f39b23eb3199 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_side.anim b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_side.anim deleted file mode 100644 index bb8c706..0000000 --- a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_side.anim +++ /dev/null @@ -1,107 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!74 &7400000 -AnimationClip: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: walk_side - serializedVersion: 6 - m_Legacy: 0 - m_Compressed: 0 - m_UseHighQualityCurve: 1 - m_RotationCurves: [] - m_CompressedRotationCurves: [] - m_EulerCurves: [] - m_PositionCurves: [] - m_ScaleCurves: [] - m_FloatCurves: [] - m_PPtrCurves: - - curve: - - time: 0 - value: {fileID: -6959915571989194883, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.05 - value: {fileID: 960921020097805623, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.1 - value: {fileID: -3336701548478254045, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.15 - value: {fileID: -5400053455435091454, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.2 - value: {fileID: 4408406346810168619, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.25 - value: {fileID: -485737157877676475, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.3 - value: {fileID: -5106187503225981072, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.35 - value: {fileID: 4312765686203540801, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.4 - value: {fileID: 5251978615751408329, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.45 - value: {fileID: 2965599932687856292, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.5 - value: {fileID: 2365076705713957727, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.55 - value: {fileID: 6256131582671704638, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.6 - value: {fileID: 7208522903439339441, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - time: 0.65 - value: {fileID: -8803371887732516606, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - attribute: m_Sprite - path: - classID: 212 - script: {fileID: 0} - m_SampleRate: 20 - m_WrapMode: 0 - m_Bounds: - m_Center: {x: 0, y: 0, z: 0} - m_Extent: {x: 0, y: 0, z: 0} - m_ClipBindingConstant: - genericBindings: - - serializedVersion: 2 - path: 0 - attribute: 0 - script: {fileID: 0} - typeID: 212 - customType: 23 - isPPtrCurve: 1 - pptrCurveMapping: - - {fileID: -6959915571989194883, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 960921020097805623, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: -3336701548478254045, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: -5400053455435091454, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 4408406346810168619, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: -485737157877676475, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: -5106187503225981072, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 4312765686203540801, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 5251978615751408329, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 2965599932687856292, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 2365076705713957727, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 6256131582671704638, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: 7208522903439339441, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - - {fileID: -8803371887732516606, guid: 70098d1b981f46c1b65f8f94d61a2fc2, type: 3} - m_AnimationClipSettings: - serializedVersion: 2 - m_AdditiveReferencePoseClip: {fileID: 0} - m_AdditiveReferencePoseTime: 0 - m_StartTime: 0 - m_StopTime: 0.7 - m_OrientationOffsetY: 0 - m_Level: 0 - m_CycleOffset: 0 - m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 - m_LoopBlend: 0 - m_LoopBlendOrientation: 0 - m_LoopBlendPositionY: 0 - m_LoopBlendPositionXZ: 0 - m_KeepOriginalOrientation: 0 - m_KeepOriginalPositionY: 1 - m_KeepOriginalPositionXZ: 0 - m_HeightFromFeet: 0 - m_Mirror: 0 - m_EditorCurves: [] - m_EulerEditorCurves: [] - m_HasGenericRootTransform: 0 - m_HasMotionFloatCurves: 0 - m_Events: [] diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_side.anim.meta b/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_side.anim.meta deleted file mode 100644 index e4ad174..0000000 --- a/Assets/COPY SPRIGHT/2D Character - Orc/Animations/walk_side.anim.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2763a6c075e342dcb4da79a607727cde -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/OrcAnimatorController.controller b/Assets/COPY SPRIGHT/2D Character - Orc/OrcAnimatorController.controller new file mode 100644 index 0000000..9bc6c6d --- /dev/null +++ b/Assets/COPY SPRIGHT/2D Character - Orc/OrcAnimatorController.controller @@ -0,0 +1,300 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1101 &-5874932307711408228 +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: IsStopped + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 4064792876197137059} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-2933209776547137667 +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: IsStopped + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1885941893022285744} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.7619047 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: OrcAnimatorController + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: LookDirection + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: VelocityX + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: VelocityY + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: IsStopped + 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: 4412649892918967495} + 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 &1885941893022285744 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Locomotion + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -5874932307711408228} + 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: 3553526472815402576} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!206 &3553526472815402576 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Movement + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 4ab1b0a81674457ea7c0344678971160, type: 2} + m_Threshold: 0 + m_Position: {x: 0, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: LookDirection + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 2763a6c075e342dcb4da79a607727cde, type: 2} + m_Threshold: 0.33333334 + m_Position: {x: -1, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: LookDirection + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: e913aa11b3ec433d904dbd7172c73f29, type: 2} + m_Threshold: 0.6666667 + m_Position: {x: 0, y: -1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: LookDirection + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 13ab981c8ff1bfe4bb73f39b23eb3199, type: 2} + m_Threshold: 1 + m_Position: {x: 1, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: LookDirection + m_Mirror: 0 + m_BlendParameter: VelocityX + m_BlendParameterY: VelocityY + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 2 +--- !u!1102 &4064792876197137059 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -2933209776547137667} + 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: 6233307688280413951} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &4412649892918967495 +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: 4064792876197137059} + m_Position: {x: 330, y: 120, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1885941893022285744} + m_Position: {x: 330, y: 20, z: 0} + - serializedVersion: 1 + m_State: {fileID: 4544742684315406710} + m_Position: {x: 365, y: 85, 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: 4064792876197137059} +--- !u!1102 &4544742684315406710 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: walk_right + 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: 7400000, guid: 13ab981c8ff1bfe4bb73f39b23eb3199, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!206 &6233307688280413951 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idling + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: 85139c275168455880d3c5db746d189a, type: 2} + m_Threshold: 0 + m_Position: {x: 0, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: Blend + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: f2366ff3ef524b35bcf62aab21f9abb0, type: 2} + m_Threshold: 0.33333334 + m_Position: {x: -1, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: Blend + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: f2366ff3ef524b35bcf62aab21f9abb0, type: 2} + m_Threshold: 0.6666667 + m_Position: {x: 0, y: -1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: Blend + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 7400000, guid: f42cb240a2284878babb282417141298, type: 2} + m_Threshold: 1 + m_Position: {x: 1, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: Blend + m_Mirror: 0 + m_BlendParameter: LookDirection + m_BlendParameterY: Blend + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 0 diff --git a/Assets/COPY SPRIGHT/2D Character - Orc/OrcAnimatorController.controller.meta b/Assets/COPY SPRIGHT/2D Character - Orc/OrcAnimatorController.controller.meta new file mode 100644 index 0000000..7cefb75 --- /dev/null +++ b/Assets/COPY SPRIGHT/2D Character - Orc/OrcAnimatorController.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 063236dff8163fb49bddf2169c5d9b02 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Prototype.unity b/Assets/Scenes/Prototype.unity index 0d42caf..88cae0a 100644 --- a/Assets/Scenes/Prototype.unity +++ b/Assets/Scenes/Prototype.unity @@ -431,10 +431,12 @@ m_Component: - component: {fileID: 743703308} - component: {fileID: 743703307} + - component: {fileID: 743703312} + - component: {fileID: 743703311} - component: {fileID: 743703309} - component: {fileID: 743703310} m_Layer: 0 - m_Name: Enemy + m_Name: Orc m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -481,7 +483,7 @@ m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3} + m_Sprite: {fileID: 8793639957104055765, guid: c6d3e18a54ab4998bf1d4fd6f5cef79d, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 @@ -501,7 +503,7 @@ m_GameObject: {fileID: 743703306} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -47.8, y: -47.4, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 1.2, y: 1.2, z: 1.2} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 3 @@ -519,12 +521,13 @@ m_Name: m_EditorClassIdentifier: target: {fileID: 1265954503} - speed: 20 + speed: 5 turnSpeed: 3 turnDistance: 2 stoppingDistance: 10 stop: 0 agentDestination: {x: 0, y: 0} + moveDirection: {x: 0, y: 0} --- !u!114 &743703310 MonoBehaviour: m_ObjectHideFlags: 0 @@ -534,13 +537,59 @@ m_GameObject: {fileID: 743703306} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c95cee1561fee644e88708dfeb6b8510, type: 3} + m_Script: {fileID: 11500000, guid: a2d1e2f5065e40c4680cc1c51821736f, type: 3} m_Name: m_EditorClassIdentifier: - fsm: - initialState: {fileID: 0} - currentState: {fileID: 0} - target: {fileID: 0} + fsm: {fileID: 11400000, guid: 989f50236af8e2248a189fe3ddbe8034, type: 2} + agent: {fileID: 0} + health: 100 + maxHealth: 100 + target: {fileID: 1485538324} +--- !u!61 &743703311 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 743703306} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0.65} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.1} + oldSize: {x: 2.7692308, y: 2.3076923} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1.5, y: 1.5} + m_EdgeRadius: 0 +--- !u!95 &743703312 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 743703306} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 063236dff8163fb49bddf2169c5d9b02, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!1 &963720380 GameObject: m_ObjectHideFlags: 0 @@ -945,6 +994,11 @@ objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0cf11774487a5ee47a41ba8097423209, type: 3} +--- !u!1 &1485538324 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7125823908817143911, guid: 0cf11774487a5ee47a41ba8097423209, type: 3} + m_PrefabInstance: {fileID: 1378569865} + m_PrefabAsset: {fileID: 0} --- !u!1 &2120984397 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/NPC/FSM/FSM.cs b/Assets/Scripts/NPC/FSM/FSM.cs index d1fb3ce..bdd94cc 100644 --- a/Assets/Scripts/NPC/FSM/FSM.cs +++ b/Assets/Scripts/NPC/FSM/FSM.cs @@ -5,19 +5,19 @@ namespace MyCollections.AI.FinitStateMachine { - [System.Serializable] - public class FSM + [CreateAssetMenu(menuName = "Finite State Machine/FSM")] + public class FSM : ScriptableObject { private NPCConroller controller; [SerializeField] private State initialState; [SerializeField] private State currentState; [SerializeField] private GameObject target; - - public GameObject Target => target; public NPCConroller Controller => controller; - public void SetUp() + public void SetUp(NPCConroller conroller) { + SetContoller(conroller); + if (initialState != null) { Debug.Log($"{controller.gameObject.name} initial state is {initialState}"); @@ -34,6 +34,7 @@ // Called Every Frame public void GUpdate() { + Debug.Log("FSM UPDATING"); if (currentState != null) { if (currentState.GetActions().Count > 0) @@ -60,10 +61,7 @@ } public State CurrentState() => currentState; - public FSM(NPCConroller controller) - { - this.controller = controller; - SetUp(); - } + + private void SetContoller(NPCConroller controller) => this.controller = controller; } } diff --git a/Assets/Scripts/NPC/FSM/State.cs b/Assets/Scripts/NPC/FSM/State.cs index 2b07b8d..618f939 100644 --- a/Assets/Scripts/NPC/FSM/State.cs +++ b/Assets/Scripts/NPC/FSM/State.cs @@ -8,8 +8,8 @@ public class State : ScriptableObject { [SerializeField] private List entryActions; - [SerializeField] private List transitions = new List(); [SerializeField] private List actions; + [SerializeField] private List transitions = new List(); [SerializeField] private Action exitAction; public List GetentryActions() => entryActions; diff --git a/Assets/Scripts/NPC/NPCConroller.cs b/Assets/Scripts/NPC/NPCConroller.cs index 63df03b..583f28d 100644 --- a/Assets/Scripts/NPC/NPCConroller.cs +++ b/Assets/Scripts/NPC/NPCConroller.cs @@ -3,26 +3,44 @@ using UnityEngine; using MyCollections.AI.FinitStateMachine; -public class NPCConroller : MonoBehaviour +[RequireComponent(typeof(Animator))] +public abstract class NPCConroller : MonoBehaviour { - [SerializeField] private FSM fsm; - private Agent agent; + [SerializeField] protected FSM fsm; + [SerializeField] protected Agent agent; + protected Animator animator; public Agent Agent => agent; + public Animator Animator => animator; - private void Awake() + protected virtual void Awake() { - agent = GetComponent(); + if (!TryGetComponent(out agent)) + { + Debug.LogError("Agent component not found on this GameObject!"); + } + + animator = GetComponent(); } + // Start is called before the first frame update - void Start() + protected virtual void Start() { - fsm = new FSM(this); + if (fsm != null) + fsm.SetUp(this); } // Update is called once per frame - void Update() + protected virtual void Update() { - fsm.GUpdate(); + if (fsm != null) + fsm.GUpdate(); + + AnimationController(); + } + + protected virtual void AnimationController() + { + } } diff --git a/Assets/Scripts/NPC/Orc/Actions/ChaseTartet.cs b/Assets/Scripts/NPC/Orc/Actions/ChaseTartet.cs index efcc9a0..3749aee 100644 --- a/Assets/Scripts/NPC/Orc/Actions/ChaseTartet.cs +++ b/Assets/Scripts/NPC/Orc/Actions/ChaseTartet.cs @@ -9,7 +9,8 @@ public override void Run(FSM fsm) { Agent agent = fsm.Controller.Agent; - GameObject target = fsm.Target; + EnemyNPCContoller controller = (EnemyNPCContoller)fsm.Controller; + GameObject target = controller.Target; if (agent != null) { diff --git a/Assets/Scripts/NPC/Orc/Actions/IdleAction.asset b/Assets/Scripts/NPC/Orc/Actions/IdleAction.asset new file mode 100644 index 0000000..08e7399 --- /dev/null +++ b/Assets/Scripts/NPC/Orc/Actions/IdleAction.asset @@ -0,0 +1,14 @@ +%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: 4f085d05a3bf0df4d85a327d12106749, type: 3} + m_Name: IdleAction + m_EditorClassIdentifier: diff --git a/Assets/Scripts/NPC/Orc/Actions/IdleAction.asset.meta b/Assets/Scripts/NPC/Orc/Actions/IdleAction.asset.meta new file mode 100644 index 0000000..59e91f6 --- /dev/null +++ b/Assets/Scripts/NPC/Orc/Actions/IdleAction.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c27bb2d79d5f0540bfd7faac8760886 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/Orc/Actions/IdleAction.cs b/Assets/Scripts/NPC/Orc/Actions/IdleAction.cs new file mode 100644 index 0000000..4dd1290 --- /dev/null +++ b/Assets/Scripts/NPC/Orc/Actions/IdleAction.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using MyCollections.AI.FinitStateMachine; + +[CreateAssetMenu(menuName = "Finite State Machine/Action/Idle")] +public class IdleAction : Action +{ + public override void Run(FSM fsm) + { + Agent agent = fsm.Controller.Agent; + + if(agent != null) agent.agentStop = true; + } + +} diff --git a/Assets/Scripts/NPC/Orc/Actions/IdleAction.cs.meta b/Assets/Scripts/NPC/Orc/Actions/IdleAction.cs.meta new file mode 100644 index 0000000..0fe2623 --- /dev/null +++ b/Assets/Scripts/NPC/Orc/Actions/IdleAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f085d05a3bf0df4d85a327d12106749 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/Orc/EnemyNPCContoller.cs b/Assets/Scripts/NPC/Orc/EnemyNPCContoller.cs new file mode 100644 index 0000000..a182ff4 --- /dev/null +++ b/Assets/Scripts/NPC/Orc/EnemyNPCContoller.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class EnemyNPCContoller : NPCConroller, IHealthSystem +{ + [Header("NPC Attributes: ")] + [SerializeField] protected float health; + [SerializeField] protected float maxHealth; + + [SerializeField] protected GameObject target; + + public GameObject Target => target; + public float GetHealth() => health; + + public void Heal(float ammount) => health += ammount; + + public bool IsDead() => health <= 0f; + + public void TakeDamage(float ammount) => maxHealth -= ammount; + + protected override void Awake() + { + base.Awake(); + } + + // Start is called before the first frame update + protected override void Start() + { + base.Start(); + health = maxHealth; + } + + // Update is called once per frame + protected override void Update() + { + base.Update(); + } +} diff --git a/Assets/Scripts/NPC/Orc/EnemyNPCContoller.cs.meta b/Assets/Scripts/NPC/Orc/EnemyNPCContoller.cs.meta new file mode 100644 index 0000000..d58222b --- /dev/null +++ b/Assets/Scripts/NPC/Orc/EnemyNPCContoller.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07fe6cd8139a9e941be537f5c89ae4b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/Orc/OrcFSM.asset b/Assets/Scripts/NPC/Orc/OrcFSM.asset new file mode 100644 index 0000000..fbc2c8d --- /dev/null +++ b/Assets/Scripts/NPC/Orc/OrcFSM.asset @@ -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: 51f43cc9e43d6a340b860f1495565b51, type: 3} + m_Name: OrcFSM + m_EditorClassIdentifier: + initialState: {fileID: 11400000, guid: 46e233bbb8a097e45828adee0507c870, type: 2} + currentState: {fileID: 11400000, guid: 46e233bbb8a097e45828adee0507c870, type: 2} + target: {fileID: 0} diff --git a/Assets/Scripts/NPC/Orc/OrcFSM.asset.meta b/Assets/Scripts/NPC/Orc/OrcFSM.asset.meta new file mode 100644 index 0000000..4a4d81b --- /dev/null +++ b/Assets/Scripts/NPC/Orc/OrcFSM.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 989f50236af8e2248a189fe3ddbe8034 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/Orc/OrcNPCController.cs b/Assets/Scripts/NPC/Orc/OrcNPCController.cs new file mode 100644 index 0000000..7fefd81 --- /dev/null +++ b/Assets/Scripts/NPC/Orc/OrcNPCController.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class OrcNPCController : EnemyNPCContoller +{ + // Start is called before the first frame update + protected override void Start() + { + base.Start(); + } + + // Update is called once per frame + protected override void Update() + { + base.Update(); + } + + protected override void AnimationController() + { + base.AnimationController(); + Debug.Log("ANIMATOR IS RUNING"); + animator.SetBool("IsStopped", agent.agentStop); + animator.SetFloat("VelocityX", agent.agentVelocity.x); + animator.SetFloat("VelocityY", agent.agentVelocity.y); + animator.SetFloat("LookDirection", agent.agentVelocity.normalized.magnitude); + } +} diff --git a/Assets/Scripts/NPC/Orc/OrcNPCController.cs.meta b/Assets/Scripts/NPC/Orc/OrcNPCController.cs.meta new file mode 100644 index 0000000..81eda9b --- /dev/null +++ b/Assets/Scripts/NPC/Orc/OrcNPCController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2d1e2f5065e40c4680cc1c51821736f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPC/Orc/States/Idle.asset b/Assets/Scripts/NPC/Orc/States/Idle.asset index a45a85e..039fd89 100644 --- a/Assets/Scripts/NPC/Orc/States/Idle.asset +++ b/Assets/Scripts/NPC/Orc/States/Idle.asset @@ -12,7 +12,8 @@ m_Script: {fileID: 11500000, guid: 7e5d42aa554d6614e9d198b0b751cc65, type: 3} m_Name: Idle m_EditorClassIdentifier: - entryActions: [] - transitions: [] + entryActions: + - {fileID: 11400000, guid: 8c27bb2d79d5f0540bfd7faac8760886, type: 2} actions: [] + transitions: [] exitAction: {fileID: 0} diff --git a/Assets/Scripts/NPC/Pathfinding/Agent.cs b/Assets/Scripts/NPC/Pathfinding/Agent.cs index 03b621d..68c99b3 100644 --- a/Assets/Scripts/NPC/Pathfinding/Agent.cs +++ b/Assets/Scripts/NPC/Pathfinding/Agent.cs @@ -18,12 +18,14 @@ private Path path; [SerializeField] private bool stop; [SerializeField] private Vector2 agentDestination; + [SerializeField] private Vector2 moveDirection; public bool agentStop { get => stop; set => stop = value; } + public Vector2 agentVelocity => moveDirection; private void Awake() { - stop = false; agentDestination = Vector2.zero; + stop = false; } private void Start() @@ -80,7 +82,7 @@ { bool followingPath = true; int pathIndex = 0; - Vector2 moveDirection = Vector2.zero; + moveDirection = Vector2.zero; float speedPercent = 1f;