From 6c6abe9ad8aaf70a03915b31a2e50e143bd0bb74 Mon Sep 17 00:00:00 2001 From: maikeljh <mjh191003@gmail.com> Date: Sat, 11 May 2024 13:04:10 +0700 Subject: [PATCH] [Fix] Pet & Shooting --- Assets/Prefabs/Pet/Fighter.prefab | 6 +++--- Assets/Scripts/Pet/FighterAttack.cs | 2 +- Assets/Scripts/Player/PlayerShooting.cs | 12 +++++++++--- Assets/Scripts/Weapon/ShotgunShooting.cs | 16 +++++++++++----- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Assets/Prefabs/Pet/Fighter.prefab b/Assets/Prefabs/Pet/Fighter.prefab index c7c7f65..834c0a6 100644 --- a/Assets/Prefabs/Pet/Fighter.prefab +++ b/Assets/Prefabs/Pet/Fighter.prefab @@ -5603,7 +5603,7 @@ NavMeshAgent: m_Enabled: 1 m_AgentTypeID: 0 m_Radius: 0.5 - m_Speed: 40 + m_Speed: 10 m_Acceleration: 8 avoidancePriority: 50 m_AngularSpeed: 120 @@ -5643,8 +5643,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: intervalAttack: 0.7 - initialDamage: 5 - currentDamage: 0 + initialDamage: 20 + currentDamage: 20 --- !u!114 &270236614910849043 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Pet/FighterAttack.cs b/Assets/Scripts/Pet/FighterAttack.cs index 138fd4b..471a0f0 100644 --- a/Assets/Scripts/Pet/FighterAttack.cs +++ b/Assets/Scripts/Pet/FighterAttack.cs @@ -7,7 +7,7 @@ using static UnityEngine.GraphicsBuffer; public class FighterAttack : PausibleObject { public float intervalAttack = 0.7f; - public double initialDamage = 5; + public double initialDamage = 20; public double currentDamage; PetHealth health; GameObject enemy; diff --git a/Assets/Scripts/Player/PlayerShooting.cs b/Assets/Scripts/Player/PlayerShooting.cs index b5e485b..aaba4ef 100644 --- a/Assets/Scripts/Player/PlayerShooting.cs +++ b/Assets/Scripts/Player/PlayerShooting.cs @@ -88,9 +88,15 @@ namespace Nightmare public void DisableEffects () { // Disable the line renderer and the light. - gunLine.enabled = false; - faceLight.enabled = false; - gunLight.enabled = false; + try + { + gunLine.enabled = false; + faceLight.enabled = false; + gunLight.enabled = false; + } catch (System.Exception) + { + // Do nothing + } } diff --git a/Assets/Scripts/Weapon/ShotgunShooting.cs b/Assets/Scripts/Weapon/ShotgunShooting.cs index 8c5a491..dcf3562 100644 --- a/Assets/Scripts/Weapon/ShotgunShooting.cs +++ b/Assets/Scripts/Weapon/ShotgunShooting.cs @@ -65,13 +65,19 @@ namespace Nightmare public void DisableEffects() { - // Disable the line renderer and the light. - for (int i = 0; i < 10; i++) + try + { + // Disable the line renderer and the light. + for (int i = 0; i < 10; i++) + { + gunLines[i].enabled = false; + } + faceLight.enabled = false; + gunLight.enabled = false; + } catch (System.Exception) { - gunLines[i].enabled = false; + // Do nothing } - faceLight.enabled = false; - gunLight.enabled = false; } public void PowerUp() -- GitLab