From a175dc531cd2d5ba083db641be3de7dde517368f Mon Sep 17 00:00:00 2001 From: maikeljh <mjh191003@gmail.com> Date: Fri, 10 May 2024 01:48:15 +0700 Subject: [PATCH] [Fix] Buff --- Assets/Animation/GameOverClip.anim | 16 ++++++++-------- Assets/Prefabs/Pet/Buff.prefab | 17 ----------------- Assets/Scripts/Managers/EnemyManager.cs | 3 ++- Assets/Scripts/Pet/BuffBehavior.cs | 2 +- Assets/Scripts/Pet/BuffMovement.cs | 2 -- 5 files changed, 11 insertions(+), 29 deletions(-) diff --git a/Assets/Animation/GameOverClip.anim b/Assets/Animation/GameOverClip.anim index 226ac3a..24325a9 100644 --- a/Assets/Animation/GameOverClip.anim +++ b/Assets/Animation/GameOverClip.anim @@ -450,7 +450,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 @@ -480,7 +480,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 @@ -510,7 +510,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 @@ -540,7 +540,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 @@ -1953,7 +1953,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 @@ -1983,7 +1983,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 @@ -2013,7 +2013,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 @@ -2043,7 +2043,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.50016665 + time: 0.5 value: 1 inSlope: 0 outSlope: 0 diff --git a/Assets/Prefabs/Pet/Buff.prefab b/Assets/Prefabs/Pet/Buff.prefab index 240497b..14094c1 100644 --- a/Assets/Prefabs/Pet/Buff.prefab +++ b/Assets/Prefabs/Pet/Buff.prefab @@ -544,9 +544,6 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 61658b50bcfbe8640ac586f05f6340c4, type: 3} insertIndex: -1 addedObject: {fileID: 7663078657916812462} - - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 61658b50bcfbe8640ac586f05f6340c4, type: 3} - insertIndex: -1 - addedObject: {fileID: -1357968397051319622} - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 61658b50bcfbe8640ac586f05f6340c4, type: 3} insertIndex: -1 addedObject: {fileID: 8547245238292844958} @@ -651,20 +648,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: increaseRate: 0.2 ---- !u!114 &-1357968397051319622 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6708288964639503651} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0e48b3f76a0d9be4f96e3346abc74bf8, type: 3} - m_Name: - m_EditorClassIdentifier: - moveSpeed: 4 - safeDistance: 5 --- !u!195 &8547245238292844958 NavMeshAgent: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Managers/EnemyManager.cs b/Assets/Scripts/Managers/EnemyManager.cs index 8404fb1..2102e0b 100644 --- a/Assets/Scripts/Managers/EnemyManager.cs +++ b/Assets/Scripts/Managers/EnemyManager.cs @@ -98,7 +98,8 @@ namespace Nightmare { for (int i = 0; i < petCount; i++) { - Instantiate(pet, enemyInstance.transform); + GameObject instantiatedItem = Instantiate(pet, enemyInstance.transform.position, Quaternion.identity); + instantiatedItem.transform.SetParent(enemyInstance.transform); } } } diff --git a/Assets/Scripts/Pet/BuffBehavior.cs b/Assets/Scripts/Pet/BuffBehavior.cs index 2c2142f..b757833 100644 --- a/Assets/Scripts/Pet/BuffBehavior.cs +++ b/Assets/Scripts/Pet/BuffBehavior.cs @@ -9,7 +9,6 @@ public class BuffBehavior : PausibleObject public double increaseRate = 0.2; void Awake() { - enemyAttack = GetComponentInParent<EnemyAttack>(includeInactive: true); StartPausible(); } @@ -21,6 +20,7 @@ public class BuffBehavior : PausibleObject void Start() { + enemyAttack = GetComponentInParent<EnemyAttack>(includeInactive: true); enemyAttack.attackDamage += (increaseRate * enemyAttack.initialDamage); } diff --git a/Assets/Scripts/Pet/BuffMovement.cs b/Assets/Scripts/Pet/BuffMovement.cs index 30e15c3..c135293 100644 --- a/Assets/Scripts/Pet/BuffMovement.cs +++ b/Assets/Scripts/Pet/BuffMovement.cs @@ -36,8 +36,6 @@ public class BuffMovement : MonoBehaviour Debug.Log("not safe"); Vector3 newPosition = transform.position + direction.normalized * safeDistance; Move(newPosition); - } - } } -- GitLab