added new enemy prefab, reconfigured enemy patrol script
enemy patrol now contains option for vertical movement
This commit is contained in:
parent
06f8cefd11
commit
4625a1f6ba
BIN
Assets/.DS_Store
vendored
BIN
Assets/.DS_Store
vendored
Binary file not shown.
8
Assets/Animations/Bat.meta
Normal file
8
Assets/Animations/Bat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12cc00e5abdeb4f7fb278dfc0f4ee2b3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
72
Assets/Animations/Bat/BatController.controller
Normal file
72
Assets/Animations/Bat/BatController.controller
Normal file
@ -0,0 +1,72 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1107 &-1120805670155518336
|
||||
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: 8499720518961295116}
|
||||
m_Position: {x: 130, y: 220, 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: 8499720518961295116}
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: BatController
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: -1120805670155518336}
|
||||
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 &8499720518961295116
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: BatFly
|
||||
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: 2eebd929e068e4971abc8acf58a09f01, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
8
Assets/Animations/Bat/BatController.controller.meta
Normal file
8
Assets/Animations/Bat/BatController.controller.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60cf97454cc2a49c88849344eaf08885
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 9100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
78
Assets/Animations/Bat/BatFly.anim
Normal file
78
Assets/Animations/Bat/BatFly.anim
Normal file
@ -0,0 +1,78 @@
|
||||
%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: BatFly
|
||||
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: 190768245, guid: fb6771c0fb3c943deb84d273bbe0eb49, type: 3}
|
||||
- time: 0.083333336
|
||||
value: {fileID: -2141346492, guid: fb6771c0fb3c943deb84d273bbe0eb49, type: 3}
|
||||
- time: 0.16666667
|
||||
value: {fileID: -534746609, guid: fb6771c0fb3c943deb84d273bbe0eb49, 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: 190768245, guid: fb6771c0fb3c943deb84d273bbe0eb49, type: 3}
|
||||
- {fileID: -2141346492, guid: fb6771c0fb3c943deb84d273bbe0eb49, type: 3}
|
||||
- {fileID: -534746609, guid: fb6771c0fb3c943deb84d273bbe0eb49, type: 3}
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 0.25
|
||||
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: []
|
8
Assets/Animations/Bat/BatFly.anim.meta
Normal file
8
Assets/Animations/Bat/BatFly.anim.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2eebd929e068e4971abc8acf58a09f01
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
179
Assets/Prefabs/Bat.prefab
Normal file
179
Assets/Prefabs/Bat.prefab
Normal file
@ -0,0 +1,179 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &493245979038171997
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 493245979038171992}
|
||||
- component: {fileID: 493245979038171999}
|
||||
- component: {fileID: 4018407283885727215}
|
||||
- component: {fileID: 5337163787054360807}
|
||||
- component: {fileID: 4224870664944535266}
|
||||
m_Layer: 0
|
||||
m_Name: Bat
|
||||
m_TagString: Enemy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &493245979038171992
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 493245979038171997}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.8, y: 0.8, z: 0.8}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 12
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &493245979038171999
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 493245979038171997}
|
||||
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_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
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_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 1
|
||||
m_Sprite: {fileID: 190768245, guid: fb6771c0fb3c943deb84d273bbe0eb49, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!114 &4018407283885727215
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 493245979038171997}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e136b6711a1f64a90b596e8a68b34b78, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
pinned: 0
|
||||
isHorizontal: 0
|
||||
rangeHorizontal: 0
|
||||
xLeft: 0
|
||||
xRight: 0
|
||||
movementVectorHorizontal: {x: 1, y: 0}
|
||||
isVertical: 1
|
||||
rangeVertical: 0.8
|
||||
yUp: 0
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 0.5
|
||||
--- !u!95 &5337163787054360807
|
||||
Animator:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 493245979038171997}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 60cf97454cc2a49c88849344eaf08885, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!61 &4224870664944535266
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 493245979038171997}
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: 0.092326164, y: -0.08812952}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1.5, y: 1.875}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1.1846523, y: 1.521285}
|
||||
m_EdgeRadius: 0
|
7
Assets/Prefabs/Bat.prefab.meta
Normal file
7
Assets/Prefabs/Bat.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c33beb037603b4e12a75275ec13369ef
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -33,7 +33,7 @@ Transform:
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 15
|
||||
m_RootOrder: 12
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &493245979038171999
|
||||
SpriteRenderer:
|
||||
@ -135,10 +135,16 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
pinned: 0
|
||||
range: 2.09
|
||||
isHorizontal: 1
|
||||
rangeHorizontal: 2.5
|
||||
xLeft: 0
|
||||
xRight: 0
|
||||
movementVector: {x: -1, y: 0}
|
||||
movementVectorHorizontal: {x: -1, y: 0}
|
||||
isVertical: 0
|
||||
rangeVertical: 0
|
||||
yUp: 0
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
--- !u!95 &5337163787054360807
|
||||
Animator:
|
||||
|
@ -13,6 +13,7 @@ GameObject:
|
||||
- component: {fileID: 4018407283885727215}
|
||||
- component: {fileID: 5337163787054360807}
|
||||
- component: {fileID: 4224870664944535266}
|
||||
- component: {fileID: 3214655307310058165}
|
||||
m_Layer: 0
|
||||
m_Name: Snake
|
||||
m_TagString: Enemy
|
||||
@ -33,7 +34,7 @@ Transform:
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: 11
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &493245979038171999
|
||||
SpriteRenderer:
|
||||
@ -100,10 +101,16 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
pinned: 0
|
||||
range: 1.5
|
||||
isHorizontal: 1
|
||||
rangeHorizontal: 2
|
||||
xLeft: 0
|
||||
xRight: 0
|
||||
movementVector: {x: -1, y: 0}
|
||||
movementVectorHorizontal: {x: -1, y: 0}
|
||||
isVertical: 0
|
||||
rangeVertical: 0
|
||||
yUp: 0
|
||||
yDown: 0
|
||||
movementVectorVertical: {x: 0, y: 1}
|
||||
moveSpeed: 1
|
||||
--- !u!95 &5337163787054360807
|
||||
Animator:
|
||||
@ -171,3 +178,38 @@ BoxCollider2D:
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 0.875}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!58 &3214655307310058165
|
||||
CircleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 493245979038171997}
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: -0.0000009536743, y: 0.14860392}
|
||||
serializedVersion: 2
|
||||
m_Radius: 2.1117759
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,11 +4,23 @@ using UnityEngine;
|
||||
|
||||
public class EnemyPatrol : MonoBehaviour {
|
||||
|
||||
public bool pinned = false;
|
||||
public float range;
|
||||
[HideInInspector] public bool pinned = false;
|
||||
|
||||
[Header("Horizontal")]
|
||||
public bool isHorizontal;
|
||||
public float rangeHorizontal;
|
||||
public float xLeft;
|
||||
public float xRight;
|
||||
public Vector2 movementVector = Vector2.right;
|
||||
public Vector2 movementVectorHorizontal = Vector2.right;
|
||||
|
||||
[Header("Vertical")]
|
||||
public bool isVertical;
|
||||
public float rangeVertical;
|
||||
public float yUp;
|
||||
public float yDown;
|
||||
public Vector2 movementVectorVertical = Vector2.up;
|
||||
|
||||
[Header("General")]
|
||||
public float moveSpeed;
|
||||
Animator animator;
|
||||
|
||||
@ -18,19 +30,32 @@ public class EnemyPatrol : MonoBehaviour {
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start() {
|
||||
xLeft = transform.position.x - range;
|
||||
xRight = transform.position.x + range;
|
||||
movementVector *= moveSpeed;
|
||||
xLeft = transform.position.x - rangeHorizontal;
|
||||
xRight = transform.position.x + rangeHorizontal;
|
||||
|
||||
yDown = transform.position.y - rangeVertical;
|
||||
yUp = transform.position.y + rangeVertical;
|
||||
|
||||
movementVectorHorizontal *= moveSpeed;
|
||||
movementVectorVertical *= moveSpeed;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
if (!pinned) {
|
||||
if (transform.position.x >= xRight || transform.position.x <= xLeft) {
|
||||
movementVector = -movementVector;
|
||||
GetComponent<SpriteRenderer>().flipX = !GetComponent<SpriteRenderer>().flipX;
|
||||
if (isHorizontal) {
|
||||
if (transform.position.x >= xRight || transform.position.x <= xLeft) {
|
||||
movementVectorHorizontal = -movementVectorHorizontal;
|
||||
GetComponent<SpriteRenderer>().flipX = !GetComponent<SpriteRenderer>().flipX;
|
||||
}
|
||||
transform.position += new Vector3(movementVectorHorizontal.x, 0, 0) * Time.deltaTime;
|
||||
}
|
||||
if (isVertical) {
|
||||
if (transform.position.y >= yUp || transform.position.y <= yDown) {
|
||||
movementVectorVertical = -movementVectorVertical;
|
||||
}
|
||||
transform.position += new Vector3(0, movementVectorVertical.y, 0) * Time.deltaTime;
|
||||
}
|
||||
transform.position += new Vector3(movementVector.x, 0, 0) * Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,6 +70,11 @@ public class EnemyPatrol : MonoBehaviour {
|
||||
|
||||
void OnDrawGizmos() {
|
||||
Gizmos.color = Color.green;
|
||||
Gizmos.DrawLine(new Vector3(transform.position.x - range, transform.position.y, transform.position.z), new Vector3(transform.position.x + range, transform.position.y, transform.position.z));
|
||||
if (isHorizontal){
|
||||
Gizmos.DrawLine(new Vector3(transform.position.x - rangeHorizontal, transform.position.y, transform.position.z), new Vector3(transform.position.x + rangeHorizontal, transform.position.y, transform.position.z));
|
||||
}
|
||||
if (isVertical) {
|
||||
Gizmos.DrawLine(new Vector3(transform.position.x, transform.position.y - rangeVertical, transform.position.z), new Vector3(transform.position.x, transform.position.y + rangeVertical, transform.position.z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
Assets/Sprites/Characters/$Bat_1.png
Normal file
BIN
Assets/Sprites/Characters/$Bat_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
388
Assets/Sprites/Characters/$Bat_1.png.meta
Normal file
388
Assets/Sprites/Characters/$Bat_1.png.meta
Normal file
@ -0,0 +1,388 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb6771c0fb3c943deb84d273bbe0eb49
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
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: 0
|
||||
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: 32
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 0
|
||||
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: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 180
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 0e7834f4311454e5abdc7417f4b47b19
|
||||
internalID: 721179846
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_1
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 48
|
||||
y: 180
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 3545817a706c54108ad8806465e171fa
|
||||
internalID: 81894702
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_2
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 96
|
||||
y: 180
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 6ed401aab1d464903b899f2386b63e0c
|
||||
internalID: 1985439858
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_3
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 120
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 0a69b9c3783794c3cb0aa59de6174aca
|
||||
internalID: 190768245
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_4
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 48
|
||||
y: 120
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: ecaf96f5d11154c69aa1049dacad54d7
|
||||
internalID: -2141346492
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_5
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 96
|
||||
y: 120
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 8b2b45cffef04431b82732a2f4a6d71e
|
||||
internalID: -534746609
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_6
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 60
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 5652fe3b55f0c49599382d38e660fc9d
|
||||
internalID: -1508989641
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_7
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 48
|
||||
y: 60
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 5df9ab6fc82544781ae55b941ec5c30b
|
||||
internalID: -933552935
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_8
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 96
|
||||
y: 60
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 6c791efe732474bd6a32c00af0258d63
|
||||
internalID: 1890138984
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_9
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: b2ed841bb33dc4d4c96c35428471ed84
|
||||
internalID: 1448077424
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_10
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 48
|
||||
y: 0
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 89cee90c53b6343a3bcbbaf18d69a214
|
||||
internalID: 924810378
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: $Bat_1_11
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 96
|
||||
y: 0
|
||||
width: 48
|
||||
height: 60
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: 0
|
||||
bones: []
|
||||
spriteID: 9b7a976c1c48d4c3faed448c871cac88
|
||||
internalID: -1076324921
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable:
|
||||
$Bat_1_0: 721179846
|
||||
$Bat_1_1: 81894702
|
||||
$Bat_1_10: 924810378
|
||||
$Bat_1_11: -1076324921
|
||||
$Bat_1_2: 1985439858
|
||||
$Bat_1_3: 190768245
|
||||
$Bat_1_4: -2141346492
|
||||
$Bat_1_5: -534746609
|
||||
$Bat_1_6: -1508989641
|
||||
$Bat_1_7: -933552935
|
||||
$Bat_1_8: 1890138984
|
||||
$Bat_1_9: 1448077424
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
361
Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset
Executable file → Normal file
361
Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset
Executable file → Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user