Updated version, added movement animations and facing

This commit is contained in:
Jeremy Smitherman 2025-08-24 17:38:37 -05:00
parent bd58219310
commit 01b141d78a
14 changed files with 494 additions and 20 deletions

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.14.1
// version 1.14.2
// from Assets/InputSystem_Actions.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if

View File

@ -46,6 +46,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Pawn
unitData: {fileID: 11400000, guid: 002caf708abb1144c99ca1048c00afcc, type: 2}
spriteRenderer: {fileID: 5418347876159129663}
animator: {fileID: 9153895417803376005}
--- !u!1 &7443273741764524837
GameObject:
m_ObjectHideFlags: 0

View File

@ -119,6 +119,119 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &14305653
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 14305656}
- component: {fileID: 14305655}
- component: {fileID: 14305654}
m_Layer: 0
m_Name: Vigilante_Walk_strip4_0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!95 &14305654
Animator:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 14305653}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: 76987e46ed3f06e44b0109890c9c1532, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_AnimatePhysics: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!212 &14305655
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 14305653}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: -5182867339085442074, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.17, y: 0.32}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!4 &14305656
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 14305653}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -7.8244877, y: -4.7786894, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1072830979
GameObject:
m_ObjectHideFlags: 0
@ -369,7 +482,6 @@ MonoBehaviour:
m_EditorClassIdentifier: Assembly-CSharp::Managers.InputManager
stateMachine: {fileID: 1567913722}
playerInputManager: {fileID: 1135129242}
uiModule: {fileID: 0}
characterPrefabs:
- {fileID: 5178305101487608751, guid: 990b0cce140f5964eabc74ee4b0fde11, type: 3}
- {fileID: 5178305101487608751, guid: 990b0cce140f5964eabc74ee4b0fde11, type: 3}
@ -471,3 +583,4 @@ SceneRoots:
- {fileID: 1695492504}
- {fileID: 1135129243}
- {fileID: 1567913723}
- {fileID: 14305656}

View File

@ -5,11 +5,18 @@ using UnityEngine;
public class Pawn : MonoBehaviour
{
[SerializeField] private UnitData unitData;
[SerializeField] private SpriteRenderer spriteRenderer;
[SerializeField] private Animator animator;
private Vector2 _moveInput;
public virtual void HandleMove(Vector2 input)
{
_moveInput = input;
_moveInput = input;
animator.Play(input.magnitude > 0 ? "Walk" : "Idle");
if(_moveInput.magnitude > 0)
spriteRenderer.flipX = _moveInput.x < 0;
}
private void FixedUpdate()

View File

@ -9,12 +9,12 @@ namespace State.GameStateMachine
public override void OnExit()
{
throw new System.NotImplementedException();
}
public override void Update()
{
throw new System.NotImplementedException();
}
}
}

View File

@ -1,5 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-7041491042131476571
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Walk
m_Speed: 0.5
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: 0e4e2c7d885da8a4c9da311f62419dd7, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-6585584643281648321
AnimatorState:
serializedVersion: 6
@ -7,7 +33,7 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: idle
m_Name: Idle
m_Speed: 0.5
m_CycleOffset: 0
m_Transitions: []
@ -32,7 +58,7 @@ AnimatorController:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Vigilante_Idle_strip4_0
m_Name: Human
serializedVersion: 5
m_AnimatorParameters:
- m_Name: punch
@ -66,6 +92,9 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: -6585584643281648321}
m_Position: {x: 310, y: 120, z: 0}
- serializedVersion: 1
m_State: {fileID: -7041491042131476571}
m_Position: {x: 320, y: 10, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

View File

@ -0,0 +1,234 @@
fileFormatVersion: 2
guid: 2e963a8df8218d247b9a96461b2cea08
TextureImporter:
internalIDToNameTable:
- first:
213: -5182867339085442074
second: Vigilante_Walk_strip4_0
- first:
213: 302867376508223093
second: Vigilante_Walk_strip4_1
- first:
213: -8702860448738653697
second: Vigilante_Walk_strip4_2
- first:
213: -3633904276090707168
second: Vigilante_Walk_strip4_3
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 16
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Vigilante_Walk_strip4_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 17
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 6e396d77d91c218b0800000000000000
internalID: -5182867339085442074
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Vigilante_Walk_strip4_1
rect:
serializedVersion: 2
x: 17
y: 0
width: 16
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 57eb3d63640043400800000000000000
internalID: 302867376508223093
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Vigilante_Walk_strip4_2
rect:
serializedVersion: 2
x: 33
y: 0
width: 16
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: ff9c227188a393780800000000000000
internalID: -8702860448738653697
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Vigilante_Walk_strip4_3
rect:
serializedVersion: 2
x: 49
y: 0
width: 15
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 02327db6057c19dc0800000000000000
internalID: -3633904276090707168
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Vigilante_Walk_strip4_0: -5182867339085442074
Vigilante_Walk_strip4_1: 302867376508223093
Vigilante_Walk_strip4_2: -8702860448738653697
Vigilante_Walk_strip4_3: -3633904276090707168
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,81 @@
%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
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: -5182867339085442074, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
- time: 0.083333336
value: {fileID: 302867376508223093, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
- time: 0.16666667
value: {fileID: -8702860448738653697, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
- time: 0.25
value: {fileID: -3633904276090707168, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
flags: 2
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:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: -5182867339085442074, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
- {fileID: 302867376508223093, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
- {fileID: -8702860448738653697, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
- {fileID: -3633904276090707168, guid: 2e963a8df8218d247b9a96461b2cea08, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.33333334
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: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0e4e2c7d885da8a4c9da311f62419dd7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -4,11 +4,11 @@
"com.unity.feature.2d": "2.0.1",
"com.unity.ide.rider": "3.0.36",
"com.unity.ide.visualstudio": "2.0.23",
"com.unity.inputsystem": "1.14.1",
"com.unity.inputsystem": "1.14.2",
"com.unity.multiplayer.center": "1.0.0",
"com.unity.render-pipelines.universal": "17.2.0",
"com.unity.test-framework": "1.5.1",
"com.unity.timeline": "1.8.7",
"com.unity.timeline": "1.8.9",
"com.unity.ugui": "2.0.0",
"com.unity.visualscripting": "1.9.7",
"com.unity.modules.accessibility": "1.0.0",

View File

@ -18,9 +18,9 @@
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "11.0.1",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.2d.common": "11.0.1",
"com.unity.mathematics": "1.2.6",
"com.unity.modules.animation": "1.0.0"
},
@ -31,11 +31,11 @@
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.8.4",
"com.unity.2d.sprite": "1.0.0",
"com.unity.mathematics": "1.1.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.uielements": "1.0.0"
"com.unity.burst": "1.8.4"
},
"url": "https://packages.unity.com"
},
@ -70,8 +70,8 @@
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "11.0.1",
"com.unity.mathematics": "1.1.0",
"com.unity.2d.common": "11.0.1",
"com.unity.modules.physics2d": "1.0.0"
},
"url": "https://packages.unity.com"
@ -90,14 +90,14 @@
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.tilemap": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.23",
"version": "1.8.24",
"depth": 2,
"source": "registry",
"dependencies": {
@ -120,8 +120,8 @@
"dependencies": {
"com.unity.burst": "1.8.19",
"com.unity.mathematics": "1.3.2",
"com.unity.test-framework": "1.4.6",
"com.unity.nuget.mono-cecil": "1.11.5",
"com.unity.test-framework": "1.4.6",
"com.unity.test-framework.performance": "3.0.3"
},
"url": "https://packages.unity.com"
@ -166,7 +166,7 @@
"url": "https://packages.unity.com"
},
"com.unity.inputsystem": {
"version": "1.14.1",
"version": "1.14.2",
"depth": 0,
"source": "registry",
"dependencies": {
@ -276,7 +276,7 @@
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.8.7",
"version": "1.8.9",
"depth": 0,
"source": "registry",
"dependencies": {

View File

@ -1,2 +1,2 @@
m_EditorVersion: 6000.2.0f1
m_EditorVersionWithRevision: 6000.2.0f1 (eed1c594c913)
m_EditorVersion: 6000.2.1f1
m_EditorVersionWithRevision: 6000.2.1f1 (55300504c302)