diff --git a/Assets/Prefabs/Scorpion.prefab b/Assets/Prefabs/Scorpion.prefab new file mode 100644 index 0000000..b926bfe --- /dev/null +++ b/Assets/Prefabs/Scorpion.prefab @@ -0,0 +1,179 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1303102899095328} + m_IsPrefabParent: 1 +--- !u!1 &1303102899095328 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4612758478389004} + - component: {fileID: 61708904748430096} + - component: {fileID: 50733723059255246} + - component: {fileID: 114448442531622302} + m_Layer: 0 + m_Name: Scorpion + m_TagString: Enemy + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1513538628701824 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4615957218218632} + - component: {fileID: 212910646889249274} + m_Layer: 0 + m_Name: Graphics + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4612758478389004 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1303102899095328} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 7.6580257, y: 3.506653, z: -0.08491792} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4615957218218632} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4615957218218632 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513538628701824} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2, y: 2, z: 1} + m_Children: [] + m_Father: {fileID: 4612758478389004} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!50 &50733723059255246 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1303102899095328} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 0 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &61708904748430096 +BoxCollider2D: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1303102899095328} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: -0.009958029, y: 0.009958148} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.82075834, y: 1.3385675} + m_EdgeRadius: 0 +--- !u!114 &114448442531622302 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1303102899095328} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d221474512c53044b3507bc53b9c7a8, type: 3} + m_Name: + m_EditorClassIdentifier: + speed: 1 + rotationSpeed: 1 + victim: {fileID: 0} + body: {fileID: 50733723059255246} +--- !u!212 &212910646889249274 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513538628701824} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + 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_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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: 0 + m_Sprite: {fileID: 21300000, guid: 15f3203a08153fd45b58ca15caed3ac9, 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.441, y: 0.69} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 diff --git a/Assets/Prefabs/Scorpion.prefab.meta b/Assets/Prefabs/Scorpion.prefab.meta new file mode 100644 index 0000000..8318c88 --- /dev/null +++ b/Assets/Prefabs/Scorpion.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4c5ecfd27b4038941a6e493a8117ea0a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/CodeDEV.unity b/Assets/Scenes/CodeDEV.unity index 19a2452..eba6bdf 100644 --- a/Assets/Scenes/CodeDEV.unity +++ b/Assets/Scenes/CodeDEV.unity @@ -358,7 +358,7 @@ Prefab: - target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743, type: 2} propertyPath: m_AnchoredPosition.x - value: 66.396866 + value: 64.16286 objectReference: {fileID: 0} - target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743, type: 2} @@ -398,6 +398,53 @@ GameObject: m_PrefabParentObject: {fileID: 1998375241450644, guid: 460d856ea4eb14cedb5fecde1fe6d743, type: 2} m_PrefabInternal: {fileID: 1379476068} +--- !u!1001 &1597985551 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_LocalPosition.x + value: 7.6580257 + objectReference: {fileID: 0} + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_LocalPosition.y + value: 3.506653 + objectReference: {fileID: 0} + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_LocalPosition.z + value: -0.08491792 + objectReference: {fileID: 0} + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4612758478389004, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 50733723059255246, guid: 4c5ecfd27b4038941a6e493a8117ea0a, + type: 2} + propertyPath: m_GravityScale + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 4c5ecfd27b4038941a6e493a8117ea0a, type: 2} + m_IsPrefabParent: 0 --- !u!1 &1624368723 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Entities/Attack/MeleeAttack.cs b/Assets/Scripts/Entities/Attack/MeleeAttack.cs index 0539c7c..77e5b48 100644 --- a/Assets/Scripts/Entities/Attack/MeleeAttack.cs +++ b/Assets/Scripts/Entities/Attack/MeleeAttack.cs @@ -5,9 +5,9 @@ namespace Assets.Scripts.Entities.Attack { [Serializable] class MeleeAttack : IAttack { - int damage = 12; + int damage = 10; float cooldown = 1; - float range = 1.5f; + float range = 2f; GameObject owner; public MeleeAttack(GameObject owner) { diff --git a/Assets/Scripts/Entities/Enemy.cs b/Assets/Scripts/Entities/Enemy.cs index c09ec00..6172e57 100644 --- a/Assets/Scripts/Entities/Enemy.cs +++ b/Assets/Scripts/Entities/Enemy.cs @@ -10,20 +10,16 @@ namespace Assets.Scripts.Entities { private float speed = 1; [SerializeField] private float rotationSpeed = 1; - + [SerializeField] protected GameObject victim; + [SerializeField] private Rigidbody2D body; + private float nextAttackTime; public Enemy(int mHP) : base(mHP) { } - private void Start() { - body = gameObject.GetComponent(); - - } - - private float nextAttackTime; void Update() { if ( victim == null || attack == null ) { return; diff --git a/Assets/Scripts/Entities/Scorpion.cs b/Assets/Scripts/Entities/Scorpion.cs index daf3532..0a47784 100644 --- a/Assets/Scripts/Entities/Scorpion.cs +++ b/Assets/Scripts/Entities/Scorpion.cs @@ -6,6 +6,10 @@ using Assets.Scripts.Entities.Attack; namespace Assets.Scripts.Entities { class Scorpion : Enemy { public Scorpion() : base(30) { + + } + + private void Start() { SetAttack(new MeleeAttack(this.gameObject)); } } diff --git a/Assets/graphics/textures/Entities/Enemies/scorpion.png.meta b/Assets/graphics/textures/Entities/Enemies/scorpion.png.meta index 17e4e37..81a556a 100644 --- a/Assets/graphics/textures/Entities/Enemies/scorpion.png.meta +++ b/Assets/graphics/textures/Entities/Enemies/scorpion.png.meta @@ -43,7 +43,7 @@ TextureImporter: spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 + spritePixelsToUnits: 1000 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 @@ -67,6 +67,39 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 76be908..fef188b 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -8,6 +8,7 @@ TagManager: - door - DoorRoot - SpawnlistRoot + - Enemy layers: - Default - TransparentFX