diff --git a/MrBigsock/Assets/Code/Character.cs b/MrBigsock/Assets/Code/Character.cs index 5e263ce6a53557b1e19921c2b2b7cbc0a062afa6..a355487f889102c61792b7021287da7fe8c6932e 100644 --- a/MrBigsock/Assets/Code/Character.cs +++ b/MrBigsock/Assets/Code/Character.cs @@ -217,7 +217,7 @@ namespace BigSock { // Trigger the event for taking damage. OnTakeDamage?.Invoke(this, attack.Actor, attack); - if (TakeDamageAudio != null){ + if(TakeDamageAudio != null && source?.Count > 0 && source[0] != null) { source[0].clip = TakeDamageAudio; source[0].Play(); } diff --git a/MrBigsock/Assets/Code/PlayerController.cs b/MrBigsock/Assets/Code/PlayerController.cs index f27bd483930b9c3e48c2e1b28c775eeb65939953..1393f31e366ab948443a53be06f53df36fb45844 100644 --- a/MrBigsock/Assets/Code/PlayerController.cs +++ b/MrBigsock/Assets/Code/PlayerController.cs @@ -188,7 +188,7 @@ namespace BigSock { // Check ability 2. CheckAbilityInput(KeyCode.Z, _testAttack2); // Check ability 3. - CheckAbilityInput(KeyCode.X, _dodge); + CheckAbilityInput(KeyCode.LeftShift, _dodge); CheckAbilityInput(KeyCode.C, _testAttack3); diff --git a/MrBigsock/Assets/Code/Services/PrefabService.cs b/MrBigsock/Assets/Code/Services/PrefabService.cs index d39ec9a4026b39a1d8b7d0aedcb90fd83bf10224..3586eebbc3159b5f31ab2eec9c99ca3e8c25ba8c 100644 --- a/MrBigsock/Assets/Code/Services/PrefabService.cs +++ b/MrBigsock/Assets/Code/Services/PrefabService.cs @@ -41,14 +41,22 @@ namespace BigSock.Service { public GameObject Instance(string name, Vector3? pos = null) => Instance(_prefabs[_sanitize(name)], pos); - private GameObject Instance(GameObject obj, Transform parent) - { + private GameObject Instance(GameObject obj, Transform parent) { var res = MonoBehaviour.Instantiate(obj, parent); return res; } public GameObject Instance(string name, Transform parent) => Instance(_prefabs[_sanitize(name)], parent); + + public GameObject Instance(GameObject obj, Vector3 position, Quaternion rotation, Transform parent) { + return MonoBehaviour.Instantiate(obj, position, rotation, parent); + } + public GameObject Instance(GameObject obj, Vector3 position, Quaternion rotation) { + return MonoBehaviour.Instantiate(obj, position, rotation); + } + + /* Destroy an instance. */ diff --git a/MrBigsock/Assets/Prefabs/Enemy_Slime.prefab b/MrBigsock/Assets/Prefabs/Enemy_Slime.prefab index 7c7624f151db0fb59c56ffd93732208e2e5d56e1..7288d1a079b46defa98c06c69b4a12a876afd657 100644 --- a/MrBigsock/Assets/Prefabs/Enemy_Slime.prefab +++ b/MrBigsock/Assets/Prefabs/Enemy_Slime.prefab @@ -175,7 +175,7 @@ MonoBehaviour: TakeDamageAudio: {fileID: 8300000, guid: f1cd1110ebb2e3f4289a7667f4fea401, type: 3} baseMovementSpeed: 2 baseDamage: 1 - knockbackForce: 2 + knockbackForce: 3 baseHP: 10 baseMaxHP: 10 dropXP: 0 diff --git a/MrBigsock/Assets/Prefabs/attack.prefab b/MrBigsock/Assets/Prefabs/attack.prefab index 3eacefd09b62ecbda996ba020d96fee9d14152f8..8b60b9425a269e7bb29d93d2fdb32a5ada3da3a5 100644 --- a/MrBigsock/Assets/Prefabs/attack.prefab +++ b/MrBigsock/Assets/Prefabs/attack.prefab @@ -105,7 +105,7 @@ BoxCollider2D: m_SpriteTilingProperty: border: {x: 0, y: 0, z: 0, w: 0} pivot: {x: 0.5, y: 0.5} - oldSize: {x: 1.125, y: 0.75} + oldSize: {x: 2.25, y: 1.5} newSize: {x: 1, y: 1} adaptiveTilingThreshold: 0.5 drawMode: 0 diff --git a/MrBigsock/Assets/Prefabs/enemy_orc_range.prefab b/MrBigsock/Assets/Prefabs/enemy_orc_range.prefab index 5d86da904bf40c1508576ae41d25e3a72cbcf475..608d9a23734263d5a8a8866ccf547a00dcb0851c 100644 --- a/MrBigsock/Assets/Prefabs/enemy_orc_range.prefab +++ b/MrBigsock/Assets/Prefabs/enemy_orc_range.prefab @@ -171,10 +171,11 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: baseAttackSpeed: 1 + source: [] TakeDamageAudio: {fileID: 8300000, guid: 0d78a0205a770454c86c53710a0b4ff1, type: 3} baseMovementSpeed: 1 baseDamage: 1 - knockbackForce: 150 + knockbackForce: 2 baseHP: 10 baseMaxHP: 10 dropXP: 0 diff --git a/MrBigsock/Assets/Prefabs/enemy_orc_warrior.prefab b/MrBigsock/Assets/Prefabs/enemy_orc_warrior.prefab index b450ddb288f0b486bf413b312845e27496a8266c..44ec3f20590bb7947b28f15ac2238e9a86356581 100644 --- a/MrBigsock/Assets/Prefabs/enemy_orc_warrior.prefab +++ b/MrBigsock/Assets/Prefabs/enemy_orc_warrior.prefab @@ -144,6 +144,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: baseAttackSpeed: 1 + source: [] TakeDamageAudio: {fileID: 8300000, guid: 0d78a0205a770454c86c53710a0b4ff1, type: 3} baseMovementSpeed: 4 baseDamage: 1 diff --git a/MrBigsock/Assets/Prefabs/skleton-range.prefab b/MrBigsock/Assets/Prefabs/skleton-range.prefab index cc83d8c7843789dd5461ec02991a340c9938053e..90b88f7fbb1419bb9759eb630d57476523dc72b0 100644 --- a/MrBigsock/Assets/Prefabs/skleton-range.prefab +++ b/MrBigsock/Assets/Prefabs/skleton-range.prefab @@ -170,9 +170,11 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: baseAttackSpeed: 1 + source: [] + TakeDamageAudio: {fileID: 0} baseMovementSpeed: 1 baseDamage: 1 - knockbackForce: 150 + knockbackForce: 2 baseHP: 10 baseMaxHP: 10 dropXP: 0