타이쿤씬 재정비 중
This commit is contained in:
parent
7f02053158
commit
07d3763889
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater
|
||||
namespace DDD
|
||||
{
|
||||
public class AspectRatioController : MonoBehaviour
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace BlueWater.Audios
|
||||
namespace DDD.Audios
|
||||
{
|
||||
[Serializable]
|
||||
public class SfxPitch
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Audios
|
||||
namespace DDD.Audios
|
||||
{
|
||||
[Serializable]
|
||||
public class BgmData
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Audios
|
||||
namespace DDD.Audios
|
||||
{
|
||||
[CreateAssetMenu(fileName = "BgmData", menuName = "ScriptableObjects/Audio/BgmData")]
|
||||
public class BgmDataSo : ScriptableObject
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Audios
|
||||
namespace DDD.Audios
|
||||
{
|
||||
[Serializable]
|
||||
public class SfxData
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Audios
|
||||
namespace DDD.Audios
|
||||
{
|
||||
[CreateAssetMenu(fileName = "SfxData", menuName = "ScriptableObjects/Audio/SfxData")]
|
||||
public class SfxDataSo : ScriptableObject
|
||||
|
@ -4,7 +4,7 @@ using BehaviorDesigner.Runtime.Tasks;
|
||||
using UnityEngine;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom")]
|
||||
[Serializable]
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Enemies;
|
||||
using DDD.Enemies;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom")]
|
||||
[Serializable]
|
||||
|
@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Enemies;
|
||||
using DDD.Enemies;
|
||||
using UnityEngine;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom")]
|
||||
[Serializable]
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Players;
|
||||
using DDD.Players;
|
||||
using UnityEngine;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[Serializable]
|
||||
[TaskCategory("Custom")]
|
||||
|
@ -1,6 +1,6 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom")]
|
||||
public class ReturnSuccess : Action
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Interfaces;
|
||||
using DDD.Interfaces;
|
||||
using UnityEngine;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom")]
|
||||
[Serializable]
|
||||
|
@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Enemies.Bosses;
|
||||
using UnityEngine;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Enemies.Bosses.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Enemy/Boss")]
|
||||
[Serializable]
|
||||
public class ActivateSkill : Action
|
||||
{
|
||||
[SerializeField]
|
||||
private BossSkillName _bossSkillName;
|
||||
|
||||
private BossSkillController _bossSkillController;
|
||||
|
||||
public override void OnAwake()
|
||||
{
|
||||
_bossSkillController = GetComponent<BossSkillController>();
|
||||
}
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
_bossSkillController.ActivateSkill(_bossSkillName.ToString());
|
||||
}
|
||||
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
return _bossSkillController.IsSkillActive ? TaskStatus.Running : TaskStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbf37dc0abe6468988411b3fa27179ee
|
||||
timeCreated: 1717194018
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 407c41de314749f0bd30514c6b81c7e3
|
||||
timeCreated: 1717196125
|
@ -1,27 +0,0 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Enemies.Bosses;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Enemies.Bosses.Conditionals
|
||||
{
|
||||
[TaskCategory("Custom/Enemy/Boss")]
|
||||
[Serializable]
|
||||
public class CanSkill : Conditional
|
||||
{
|
||||
[SerializeField]
|
||||
private BossSkillName _bossSkillName;
|
||||
|
||||
private BossSkillController _bossSkillController;
|
||||
|
||||
public override void OnAwake()
|
||||
{
|
||||
_bossSkillController = GetComponent<BossSkillController>();
|
||||
}
|
||||
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
return _bossSkillController.CanSkill(_bossSkillName.ToString()) ? TaskStatus.Success : TaskStatus.Failure;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 194f72b456454df49f67adf5eab5246d
|
||||
timeCreated: 1717196135
|
@ -1,7 +1,7 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews;
|
||||
using DDD.Npcs.Crews;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew")]
|
||||
public class IsCompletedMission : Action
|
||||
|
@ -1,7 +1,7 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews.Bartender;
|
||||
using DDD.Npcs.Crews.Bartender;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew/BartenderCrew")]
|
||||
public class MakingCocktail : Action
|
||||
|
@ -1,7 +1,7 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews;
|
||||
using DDD.Npcs.Crews;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew")]
|
||||
public class MoveToRandomPositionInRange : Action
|
||||
|
@ -1,9 +1,9 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews.Server;
|
||||
using BlueWater.Tycoons;
|
||||
using DDD.Npcs.Crews.Server;
|
||||
using DDD.Tycoons;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew/ServerCrew")]
|
||||
public class Refind : Action
|
||||
|
@ -1,7 +1,7 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews;
|
||||
using DDD.Npcs.Crews;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew")]
|
||||
public class CheckOnMission : Conditional
|
||||
|
@ -1,7 +1,7 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews.Bartender;
|
||||
using DDD.Npcs.Crews.Bartender;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew/BartenderCrew")]
|
||||
public class CheckOrderedCocktail : Conditional
|
||||
|
@ -1,7 +1,7 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews;
|
||||
using DDD.Npcs.Crews;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew")]
|
||||
public class OnMission : Conditional
|
||||
|
@ -1,8 +1,8 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews.Server;
|
||||
using DDD.Npcs.Crews.Server;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew/ServerCrew")]
|
||||
public class Serving : Conditional
|
||||
|
@ -1,7 +1,7 @@
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Crews.Server;
|
||||
using DDD.Npcs.Crews.Server;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Crew/ServerCrew")]
|
||||
public class TakeServingItem : Conditional
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
using UnityEngine;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using BlueWater.Tycoons;
|
||||
using DDD.Npcs.Customers;
|
||||
using DDD.Tycoons;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Interfaces;
|
||||
using BlueWater.Players.Tycoons;
|
||||
using DDD.Interfaces;
|
||||
using DDD.Players.Tycoons;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
using UnityEngine;
|
||||
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using BlueWater.Utility;
|
||||
using BlueWater.Tycoons;
|
||||
using DDD.Npcs.Customers;
|
||||
using DDD.Tycoons;
|
||||
using DDD.Utility;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Items;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using BlueWater.Uis;
|
||||
using DDD.Items;
|
||||
using DDD.Npcs.Customers;
|
||||
using DDD.Uis;
|
||||
using PixelCrushers.DialogueSystem;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using DDD.Npcs.Customers;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using BehaviorDesigner.Runtime.Tasks;
|
||||
using BlueWater.Items;
|
||||
using BlueWater.Npcs.Customers;
|
||||
using BlueWater.Uis;
|
||||
using DDD.Items;
|
||||
using DDD.Npcs.Customers;
|
||||
using DDD.Uis;
|
||||
using PixelCrushers.DialogueSystem;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace BlueWater.BehaviorTrees.Actions
|
||||
namespace DDD.BehaviorTrees.Actions
|
||||
{
|
||||
[TaskCategory("Custom/Npc/Customer")]
|
||||
[Serializable]
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using BlueWater.Players.Tycoons;
|
||||
using DDD.Players.Tycoons;
|
||||
using Pathfinding;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace BlueWater.Enemies
|
||||
namespace DDD.Enemies
|
||||
{
|
||||
public class AiMovement : MonoBehaviour
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using System.Collections;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater
|
||||
namespace DDD
|
||||
{
|
||||
public class AnimationController : MonoBehaviour
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater
|
||||
namespace DDD
|
||||
{
|
||||
[Serializable]
|
||||
public class CharacterData
|
||||
|
@ -1,166 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using BlueWater.Interfaces;
|
||||
using BlueWater.Uis;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater
|
||||
{
|
||||
public class CombatSkillController : MonoBehaviour, ISkillHandler
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
// Components
|
||||
private IDashable _dashable;
|
||||
private IComboAttackable _comboAttackable;
|
||||
private IStunnable _stunnable;
|
||||
|
||||
// Variables
|
||||
[field: SerializeField]
|
||||
public List<BaseSkill> Skills { get; private set; }
|
||||
public Dictionary<string, BaseSkill> SkillInstances { get; private set; }
|
||||
public BaseSkill CurrentActivatingSkill { get; private set; }
|
||||
|
||||
public bool IsSkillEnabled { get; private set; } = true;
|
||||
public bool IsActivatingSkill { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
InitializeComponents();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (SkillInstances == null) return;
|
||||
|
||||
foreach (var element in SkillInstances.Values)
|
||||
{
|
||||
if (!element) continue;
|
||||
|
||||
Destroy(element.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
private void InitializeComponents()
|
||||
{
|
||||
_dashable = GetComponent<IDashable>();
|
||||
_comboAttackable = GetComponent<IComboAttackable>();
|
||||
_stunnable = GetComponent<IStunnable>();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
SkillInstances = new Dictionary<string, BaseSkill>(Skills.Count);
|
||||
|
||||
foreach (var element in Skills)
|
||||
{
|
||||
var newSkill = Instantiate(element);
|
||||
newSkill.Initialize(gameObject);
|
||||
SkillInstances.Add(newSkill.SkillName, newSkill);
|
||||
}
|
||||
|
||||
CurrentActivatingSkill = SkillInstances[Skills[0].SkillName];
|
||||
CombatUiManager.Instance.CombatSkillUi.ResetSkillUi();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
public void EnableSkill() => IsSkillEnabled = true;
|
||||
public void DisableSkill() => IsSkillEnabled = false;
|
||||
|
||||
public bool HasSkill(string skillName = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(skillName)) skillName = CurrentActivatingSkill.SkillName;
|
||||
|
||||
if (SkillInstances.ContainsKey(skillName)) return true;
|
||||
|
||||
Debug.Log($"{skillName}(이)라는 스킬을 찾을 수 없습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CanSkill(string skillName = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(skillName)) skillName = CurrentActivatingSkill.SkillName;
|
||||
|
||||
if (!IsSkillEnabled || IsActivatingSkill) return false;
|
||||
|
||||
var isDashing = _dashable?.IsDashing ?? false;
|
||||
var isAttacking = _comboAttackable?.CurrentComboAttackCount > 0;
|
||||
var isStunned = _stunnable?.IsStunned ?? false;
|
||||
|
||||
if (isDashing || isAttacking || isStunned) return false;
|
||||
|
||||
var canSkill = SkillInstances[skillName].CanSkill();
|
||||
if (!canSkill)
|
||||
{
|
||||
CombatUiManager.Instance.CombatSkillUi.PunchAnimation();
|
||||
}
|
||||
|
||||
return canSkill;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HasSkill()만 확인하고 스킬을 강제로 사용
|
||||
/// </summary>
|
||||
public void ActivateSkill(string skillName = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(skillName)) skillName = CurrentActivatingSkill.SkillName;
|
||||
|
||||
if (!HasSkill(skillName)) return;
|
||||
|
||||
IsSkillEnabled = false;
|
||||
IsActivatingSkill = true;
|
||||
CurrentActivatingSkill = SkillInstances[skillName];
|
||||
|
||||
CurrentActivatingSkill.ActivateSkill(EndSkill);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HasSkill(), CanSkill()를 모두 확인하고 스킬을 사용하기까지 모든 과정
|
||||
/// </summary>
|
||||
public void TryActivateSkill(string skillName = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(skillName)) skillName = CurrentActivatingSkill.SkillName;
|
||||
|
||||
if (!CanSkill(skillName)) return;
|
||||
|
||||
ActivateSkill(skillName);
|
||||
}
|
||||
|
||||
private void EndSkill()
|
||||
{
|
||||
IsSkillEnabled = true;
|
||||
IsActivatingSkill = false;
|
||||
|
||||
CombatUiManager.Instance.CombatSkillUi.CoolDown(CurrentActivatingSkill.Cooldown);
|
||||
}
|
||||
|
||||
public void StopAllCoroutine()
|
||||
{
|
||||
foreach (var element in SkillInstances.Values)
|
||||
{
|
||||
element.StopAllCoroutines();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d15d270547a76a547b91e71c596e4fc7
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0516aec7cd5f7f44b9a6777cf5f749d4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,139 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Interfaces;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
public abstract class AnimatorBoss : Boss, ICurrentDirection
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
// Components
|
||||
[field: Title("애니메이터 보스 컴포넌트")]
|
||||
[field: SerializeField]
|
||||
public SpriteRenderer SpriteRenderer { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public Animator Animator { get; private set; }
|
||||
|
||||
// Classes
|
||||
[field: SerializeField]
|
||||
public AnimationController AnimationController { get; private set; }
|
||||
|
||||
private bool _isMoving;
|
||||
public bool IsMoving
|
||||
{
|
||||
get => _isMoving;
|
||||
set
|
||||
{
|
||||
_isMoving = value;
|
||||
AnimationController.SetAnimationParameter("isMoving", _isMoving);
|
||||
}
|
||||
}
|
||||
|
||||
private Vector3 _currentDirection = Vector3.right;
|
||||
public Vector3 CurrentDirection
|
||||
{
|
||||
get => _currentDirection;
|
||||
set
|
||||
{
|
||||
if (value == Vector3.zero) return;
|
||||
|
||||
_currentDirection = value;
|
||||
AnimationController.SetAnimationParameter("xDirection", _currentDirection.x);
|
||||
AnimationController.SetAnimationParameter("zDirection", _currentDirection.z);
|
||||
}
|
||||
}
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
HandleMovement();
|
||||
FlipVisualLook();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
[Button("컴포넌트 초기화")]
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
SpriteRenderer = VisualLook.GetComponent<SpriteRenderer>();
|
||||
SpriteRenderer.enabled = false;
|
||||
Animator = VisualLook.GetComponent<Animator>();
|
||||
AnimationController = GetComponent<AnimationController>();
|
||||
|
||||
MaterialInstance = Instantiate(SpriteRenderer.material);
|
||||
SpriteRenderer.material = MaterialInstance;
|
||||
|
||||
BossHealthPoint.SetMaterialInstance(MaterialInstance);
|
||||
IsInitialized = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override IEnumerator DissolveCoroutine(float start, float end, float dissolveTime)
|
||||
{
|
||||
if (!IsDissolveActive)
|
||||
{
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, end);
|
||||
yield break;
|
||||
}
|
||||
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, start);
|
||||
SpriteRenderer.enabled = true;
|
||||
|
||||
var elapsedTime = 0f;
|
||||
while (elapsedTime <= dissolveTime)
|
||||
{
|
||||
var value = Mathf.Lerp(start, end, elapsedTime / dissolveTime);
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, value);
|
||||
elapsedTime += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, end);
|
||||
}
|
||||
|
||||
private void FlipVisualLook()
|
||||
{
|
||||
var localScale = VisualLook.localScale;
|
||||
localScale.x = CurrentDirection.x switch
|
||||
{
|
||||
> 0.01f => Mathf.Abs(localScale.x),
|
||||
< -0.01f => -Mathf.Abs(localScale.x),
|
||||
_ => localScale.x
|
||||
};
|
||||
VisualLook.localScale = localScale;
|
||||
}
|
||||
|
||||
private void HandleMovement()
|
||||
{
|
||||
if (!AstarAi.canMove || AstarAi.isStopped)
|
||||
{
|
||||
IsMoving = false;
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentDirection = AstarAi.velocity.normalized;
|
||||
IsMoving = AstarAi.velocity != Vector3.zero || AstarAi.velocity != Vector3.positiveInfinity;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb9fe76049bc1454b8a03e0734a0e368
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- _aiMovement: {fileID: 11400000, guid: 5d32cc099076ade42ab5744c9bb621bb, type: 2}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,204 +0,0 @@
|
||||
using System.Collections;
|
||||
using BehaviorDesigner.Runtime;
|
||||
using BlueWater.Interfaces;
|
||||
using Pathfinding;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
public enum BossType
|
||||
{
|
||||
None = 0,
|
||||
TitanSlime,
|
||||
Rhinoceros,
|
||||
SandMole,
|
||||
MiniSandMole,
|
||||
GhostBarrel,
|
||||
BoomBarrel,
|
||||
SwordBarrel,
|
||||
LavaBarrel
|
||||
}
|
||||
|
||||
public enum BossSkillName
|
||||
{
|
||||
___SlimeSkillList___ = 0,
|
||||
JumpSlam,
|
||||
___RhinocerosSkillList___,
|
||||
BullCharge,
|
||||
HammerSlam,
|
||||
MeteorSwing,
|
||||
SeismicThrust,
|
||||
SkyFallSmash,
|
||||
___SandMoleSkillList___,
|
||||
GateOfSpikes,
|
||||
MultiThrowSpikes,
|
||||
SingleRoll,
|
||||
SpikeBarrage
|
||||
}
|
||||
|
||||
public abstract class Boss : MonoBehaviour, ITarget, IMaterialInstance
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
// Components
|
||||
[field: Title("보스 컴포넌트")]
|
||||
[field: SerializeField]
|
||||
public Rigidbody Rigidbody { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public CapsuleCollider CharacterCollider { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public BehaviorTree BehaviorTree { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public Transform VisualLook { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public BoxCollider HitBoxCollider { get; private set; }
|
||||
|
||||
// Classes
|
||||
[field: SerializeField, Required]
|
||||
public BossData BossData { get; private set; }
|
||||
|
||||
[field: SerializeField, Required]
|
||||
public BossHealthPoint BossHealthPoint { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public AiMovement AIMovement { get; private set; }
|
||||
|
||||
[field: SerializeField, Required]
|
||||
public BossSkillController BossSkillController { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public Collider Target { get; protected set; }
|
||||
|
||||
public IAstarAI AstarAi;
|
||||
public Material MaterialInstance { get; protected set; }
|
||||
|
||||
[Title("디졸브 스폰 효과")]
|
||||
[SerializeField]
|
||||
protected bool IsDissolveActive = true;
|
||||
|
||||
[SerializeField]
|
||||
protected float SpawnDissolveTime = 2f;
|
||||
|
||||
[SerializeField]
|
||||
protected float DieDissolveTime = 1f;
|
||||
|
||||
protected bool IsInitialized;
|
||||
|
||||
// Hashes
|
||||
protected static readonly int _dissolveValueHash = Shader.PropertyToID("_DissolveValue");
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
InitializeComponents();
|
||||
}
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
BossHealthPoint.OnDead += Die;
|
||||
|
||||
Target = GameManager.Instance.CurrentCombatPlayer.GetComponent<Collider>();
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void FixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnDisable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
BossHealthPoint.OnDead -= Die;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
[Button("컴포넌트 초기화")]
|
||||
protected virtual void InitializeComponents()
|
||||
{
|
||||
Rigidbody = GetComponent<Rigidbody>();
|
||||
CharacterCollider = GetComponent<CapsuleCollider>();
|
||||
BehaviorTree = GetComponent<BehaviorTree>();
|
||||
VisualLook = transform.Find("VisualLook");
|
||||
HitBoxCollider = transform.Find("HitBox").GetComponent<BoxCollider>();
|
||||
|
||||
BossHealthPoint = GetComponent<BossHealthPoint>();
|
||||
AIMovement = GetComponent<AiMovement>();
|
||||
BossSkillController = GetComponent<BossSkillController>();
|
||||
|
||||
AstarAi = GetComponent<IAstarAI>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
// Abstract methods
|
||||
public virtual void Initialize() { }
|
||||
protected abstract IEnumerator DissolveCoroutine(float start, float end, float dissolveTime);
|
||||
|
||||
protected abstract void Die();
|
||||
|
||||
// Wrapping
|
||||
// BossHealthPoint
|
||||
public int CurrentHealthPoint
|
||||
{
|
||||
get => BossHealthPoint.CurrentHealthPoint;
|
||||
private set => BossHealthPoint.SetCurrentHealthPoint(value);
|
||||
}
|
||||
|
||||
// AiMovement
|
||||
public void EnableMove() => AIMovement.EnableMove();
|
||||
public void StopMove() => AIMovement.StopMove();
|
||||
public void Move(Vector3 position) => AIMovement.Move(position);
|
||||
public void MoveTarget(Collider target) => AIMovement.MoveTarget(target);
|
||||
public void Teleport(Vector3 position) => AIMovement.Teleport(position);
|
||||
public bool HasReachedDestination() => AIMovement.HasReachedDestination();
|
||||
public void SetMoveSpeed(float speed) => AIMovement.SetMoveSpeed(speed);
|
||||
public bool IsPositionMovable(Vector3 endPosition) => AIMovement.IsPositionMovable(endPosition);
|
||||
|
||||
// BossSkillController
|
||||
public bool IsSkillActive => BossSkillController.IsSkillActive;
|
||||
public void ActivateSkill(string skillName) => BossSkillController.ActivateSkill(skillName);
|
||||
public bool CanSkill(string skillName) => BossSkillController.CanSkill(skillName);
|
||||
|
||||
// BossData
|
||||
public LayerMask TargetLayer => BossData.TargetLayer;
|
||||
|
||||
// Methods
|
||||
public void ForceKillBoss()
|
||||
{
|
||||
BossHealthPoint.TakeDamage(100000);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55f94b7f5d2345ae8f2c6e0d24a6c132
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- _aiMovement: {fileID: 11400000, guid: 5d32cc099076ade42ab5744c9bb621bb, type: 2}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
[Serializable]
|
||||
public class BossConfiguration
|
||||
{
|
||||
[field: SerializeField]
|
||||
public BossType BossType { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public GameObject Prefab { get; private set; }
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 493cd564faa54676ab1d07525f0fc08d
|
||||
timeCreated: 1717080962
|
@ -1,12 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
[CreateAssetMenu(fileName = "BossConfiguration", menuName = "ScriptableObjects/Enemy/BossConfiguration")]
|
||||
public class BossConfigurationSo : ScriptableObject
|
||||
{
|
||||
[field: SerializeField]
|
||||
public List<BossConfiguration> BossConfigurationList { get; private set; }
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 538ecd6004934faaaefc0e4c86d80d4e
|
||||
timeCreated: 1717082632
|
@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
[Serializable]
|
||||
public class BossData : ScriptableObject
|
||||
{
|
||||
// Variables
|
||||
[field: SerializeField]
|
||||
public string Name { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public string DisplayName { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public string CharacterIdx { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public int MaxHealthPoint { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public LayerMask TargetLayer { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public List<BaseSkill> SkillDataList { get; private set; }
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e109ac00ba047caa8a1efb08c3cb83e
|
||||
timeCreated: 1717086932
|
@ -1,195 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using BlueWater.Audios;
|
||||
using BlueWater.Interfaces;
|
||||
using BlueWater.Uis;
|
||||
using BlueWater.Utility;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
public class BossHealthPoint : MonoBehaviour, IDamageable
|
||||
{
|
||||
// 컴포넌트
|
||||
[Title("컴포넌트")]
|
||||
[SerializeField]
|
||||
private CapsuleCollider _characterCollider;
|
||||
|
||||
[SerializeField]
|
||||
private Transform _particleInstantiateLocation;
|
||||
|
||||
// 체력 설정
|
||||
[field: Title("체력 설정")]
|
||||
[field: SerializeField]
|
||||
public int MaxHealthPoint { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public int CurrentHealthPoint { get; private set; }
|
||||
|
||||
public bool IsInvincible { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public float InvincibilityDuration { get; private set; } = 0.1f;
|
||||
|
||||
// 효과 설정
|
||||
[Title("효과 설정")]
|
||||
[SerializeField]
|
||||
private string _attackedSfxName;
|
||||
|
||||
[SerializeField]
|
||||
private string _dieSfxName;
|
||||
|
||||
[SerializeField]
|
||||
private ParticleSystem _attackedParticle;
|
||||
|
||||
[SerializeField]
|
||||
private ParticleSystem _dieParticle;
|
||||
|
||||
private Material _materialInstance;
|
||||
private FieldBossHealthPointUi _fieldBossHealthPointUi;
|
||||
private WaitForSeconds _flashWhiteWaitTime;
|
||||
private Coroutine _flashWhiteCoroutine;
|
||||
private Coroutine _damageIntervalCoroutine;
|
||||
|
||||
private bool _enableHealthChangedEvent;
|
||||
private string _bossName;
|
||||
|
||||
// Hashes
|
||||
private static readonly int _isHitHash = Shader.PropertyToID("_IsHit");
|
||||
|
||||
// Events
|
||||
public event Action<int, string> OnHealthChanged;
|
||||
public event Action OnDead;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
// Unity events
|
||||
private void Start()
|
||||
{
|
||||
_flashWhiteWaitTime = new WaitForSeconds(InvincibilityDuration);
|
||||
_fieldBossHealthPointUi = CombatUiManager.Instance.FieldBossHealthPointUi;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (!_enableHealthChangedEvent || !_fieldBossHealthPointUi) return;
|
||||
|
||||
OnHealthChanged -= _fieldBossHealthPointUi.SetCurrentHealthPoint;
|
||||
}
|
||||
|
||||
// Initialize methods
|
||||
[Button("셋팅 초기화")]
|
||||
private void InitializeComponent()
|
||||
{
|
||||
_characterCollider = GetComponent<CapsuleCollider>();
|
||||
}
|
||||
|
||||
public void Initialize(bool enableHealthChangedEvent, int maxHealthPoint, string bossName, Transform particleInstantiateLocation = null)
|
||||
{
|
||||
_enableHealthChangedEvent = enableHealthChangedEvent;
|
||||
MaxHealthPoint = maxHealthPoint;
|
||||
_bossName = bossName;
|
||||
_particleInstantiateLocation = particleInstantiateLocation;
|
||||
_fieldBossHealthPointUi ??= CombatUiManager.Instance.FieldBossHealthPointUi;
|
||||
|
||||
if (_enableHealthChangedEvent)
|
||||
{
|
||||
OnHealthChanged += _fieldBossHealthPointUi.SetCurrentHealthPoint;
|
||||
_fieldBossHealthPointUi.SetBoss(MaxHealthPoint, _bossName);
|
||||
}
|
||||
|
||||
SetCurrentHealthPoint(MaxHealthPoint);
|
||||
}
|
||||
|
||||
// Methods
|
||||
public void SetCurrentHealthPoint(int changedHealthPoint)
|
||||
{
|
||||
CurrentHealthPoint = changedHealthPoint;
|
||||
OnHealthChanged?.Invoke(changedHealthPoint, _bossName);
|
||||
}
|
||||
|
||||
public bool CanDamage() => !IsInvincible;
|
||||
|
||||
public void TakeDamage(int damageAmount)
|
||||
{
|
||||
IsInvincible = true;
|
||||
var changeHp = Mathf.Max(CurrentHealthPoint - damageAmount, 0);
|
||||
SetCurrentHealthPoint(changeHp);
|
||||
|
||||
Utils.StartUniqueCoroutine(this, ref _flashWhiteCoroutine, FlashWhiteCoroutine());
|
||||
|
||||
// if (_renderer.material.HasInt(_isHitHash))
|
||||
// {
|
||||
// Utils.StartUniqueCoroutine(this, ref _flashWhiteCoroutine, FlashWhiteCoroutine());
|
||||
// }
|
||||
|
||||
// 죽었는지 체크
|
||||
if (changeHp == 0)
|
||||
{
|
||||
Die();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackedParticle)
|
||||
{
|
||||
var instantiateHitParticle = Instantiate(_attackedParticle, _characterCollider.bounds.center,
|
||||
_attackedParticle.transform.rotation, _particleInstantiateLocation);
|
||||
instantiateHitParticle.Play();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(_attackedSfxName))
|
||||
{
|
||||
AudioManager.Instance.PlaySfx(_attackedSfxName);
|
||||
}
|
||||
|
||||
Utils.StartUniqueCoroutine(this, ref _damageIntervalCoroutine, Utils.CoolDownCoroutine(InvincibilityDuration, EndDamageIntervalCoroutine));
|
||||
}
|
||||
|
||||
public void TryTakeDamage(int damageAmount)
|
||||
{
|
||||
if (!CanDamage()) return;
|
||||
|
||||
TakeDamage(damageAmount);
|
||||
}
|
||||
|
||||
public void Die()
|
||||
{
|
||||
if (_dieParticle)
|
||||
{
|
||||
var instantiateHitParticle = Instantiate(_dieParticle, _characterCollider.bounds.center,
|
||||
_dieParticle.transform.rotation, _particleInstantiateLocation);
|
||||
instantiateHitParticle.Play();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(_dieSfxName))
|
||||
{
|
||||
AudioManager.Instance.PlaySfx(_dieSfxName);
|
||||
}
|
||||
|
||||
OnDead?.Invoke();
|
||||
}
|
||||
|
||||
private IEnumerator FlashWhiteCoroutine()
|
||||
{
|
||||
_materialInstance.SetInt(_isHitHash, 1);
|
||||
|
||||
yield return _flashWhiteWaitTime;
|
||||
|
||||
_materialInstance.SetInt(_isHitHash, 0);
|
||||
|
||||
Utils.EndUniqueCoroutine(this, ref _flashWhiteCoroutine);
|
||||
}
|
||||
|
||||
private void EndDamageIntervalCoroutine()
|
||||
{
|
||||
IsInvincible = false;
|
||||
Utils.EndUniqueCoroutine(this, ref _damageIntervalCoroutine);
|
||||
}
|
||||
|
||||
public void SetMaterialInstance(Material materialInstance) => _materialInstance = materialInstance;
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b9900c0671da864e910821e6447affc
|
@ -1,115 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
public class BossSkillController : MonoBehaviour
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
// Components
|
||||
[SerializeField]
|
||||
private List<BaseSkill> _skillList;
|
||||
private Dictionary<string, BaseSkill> _instantiateSkillDictionary;
|
||||
|
||||
// Variables
|
||||
public bool IsSkillActive { get; private set; }
|
||||
|
||||
// Events
|
||||
public event Action OnStartSkill;
|
||||
public event Action OnEndSkill;
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity methods
|
||||
#region Unity methods
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_instantiateSkillDictionary == null) return;
|
||||
|
||||
foreach (var element in _instantiateSkillDictionary.Values)
|
||||
{
|
||||
if (element && element.gameObject)
|
||||
{
|
||||
Destroy(element.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
public void Initialize(List<BaseSkill> skillList)
|
||||
{
|
||||
_skillList = skillList;
|
||||
_instantiateSkillDictionary = new Dictionary<string, BaseSkill>(_skillList.Count);
|
||||
|
||||
for (var i = 0; i < _skillList.Count; i++)
|
||||
{
|
||||
var instantiateSkill = Instantiate(_skillList[i]);
|
||||
instantiateSkill.Initialize(gameObject);
|
||||
_instantiateSkillDictionary.Add(instantiateSkill.SkillName, instantiateSkill);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
// Events methods
|
||||
/// <summary>
|
||||
/// 사용하기 전에 CanSkill() 함수를 통해서 사용이 가능한 스킬인지 먼저 체크해야 합니다.
|
||||
/// </summary>
|
||||
/// <param name="skillName"></param>
|
||||
[Button("스킬 사용")]
|
||||
public void ActivateSkill(string skillName)
|
||||
{
|
||||
if (!_instantiateSkillDictionary.TryGetValue(skillName, out var skill))
|
||||
{
|
||||
Debug.Log($"{skillName}(이)라는 스킬을 찾을 수 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
OnStartSkill?.Invoke();
|
||||
IsSkillActive = true;
|
||||
skill.ActivateSkill(EndSkill);
|
||||
}
|
||||
|
||||
// Methods
|
||||
public bool CanSkill(string skillName)
|
||||
{
|
||||
if (!_instantiateSkillDictionary.TryGetValue(skillName, out var skill))
|
||||
{
|
||||
Debug.Log($"{skillName}(이)라는 스킬을 찾을 수 없습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsSkillActive) return false;
|
||||
|
||||
return skill.CanSkill();
|
||||
}
|
||||
|
||||
private void EndSkill()
|
||||
{
|
||||
OnEndSkill?.Invoke();
|
||||
IsSkillActive = false;
|
||||
}
|
||||
|
||||
public void StopAllCoroutine()
|
||||
{
|
||||
foreach (var element in _instantiateSkillDictionary.Values)
|
||||
{
|
||||
element.StopAllCoroutines();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e547505a3a98b44c9660eec12b91720
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2c5a71eee946fc499c20a926e14fbc4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,115 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Maps;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
public enum BoomBarrelSkill
|
||||
{
|
||||
None = 0,
|
||||
}
|
||||
|
||||
public enum BoomBarrelSkin
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public enum BoomBarrelAnimation
|
||||
{
|
||||
None = 0,
|
||||
Empty,
|
||||
Idle,
|
||||
In,
|
||||
Out
|
||||
}
|
||||
|
||||
public class BoomBarrel : SpineBoss
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
public BoomBarrelData BoomBarrelData { get; private set; }
|
||||
public GhostBarrelMapController GhostBarrelMapController { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
//BossHealthPoint.OnHealthChanged -= SummonMiniSandMole;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
BoomBarrelData = BossData as BoomBarrelData;
|
||||
GhostBarrelMapController = MapManager.Instance.GhostBarrelMapController;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine()
|
||||
{
|
||||
HitBoxCollider.enabled = false;
|
||||
BossHealthPoint.Initialize(true, BossData.MaxHealthPoint,
|
||||
BossData.DisplayName, GhostBarrelMapController.ParticleInstanceLocation);
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
|
||||
SpineController.PlayAnimation(BoomBarrelAnimation.Empty.ToString(), false);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
StartCoroutine(DieCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator DieCoroutine()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
// TODO : 죽는 애니메이션 추가
|
||||
//SpineController.SetSkin(SandMoleSkin.Idle.ToString());
|
||||
//var dieTrack = SpineController.PlayAnimation(SandMoleAnimation.Die.ToString(), false);
|
||||
|
||||
//await SpineController.WaitForAnimationCompletion(dieTrack);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(1f, 0f, DieDissolveTime));
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81ecdc79816d02940b99b2e913878fce
|
||||
timeCreated: 1717140083
|
@ -1,10 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
[CreateAssetMenu(fileName = "BoomBarrelData", menuName = "ScriptableObjects/Enemy/BoomBarrelData")]
|
||||
public class BoomBarrelData : BossData
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a42d30b03045b94f8c864af3e20f5b5
|
||||
timeCreated: 1717087643
|
@ -1,121 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Maps;
|
||||
using BlueWater.Items;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
public enum GhostBarrelSkill
|
||||
{
|
||||
None = 0,
|
||||
}
|
||||
|
||||
public enum GhostBarrelSkin
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public enum GhostBarrelAnimation
|
||||
{
|
||||
None = 0,
|
||||
Empty,
|
||||
Idle,
|
||||
In,
|
||||
Out
|
||||
}
|
||||
|
||||
public class GhostBarrel : SpineBoss
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
public GhostBarrelData GhostBarrelData { get; private set; }
|
||||
public GhostBarrelMapController GhostBarrelMapController { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
//BossHealthPoint.OnHealthChanged -= SummonMiniSandMole;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
//SandMoleStatus = GetComponent<SandMoleStatus>();
|
||||
GhostBarrelData = BossData as GhostBarrelData;
|
||||
GhostBarrelMapController = MapManager.Instance.GhostBarrelMapController;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine()
|
||||
{
|
||||
HitBoxCollider.enabled = false;
|
||||
BossHealthPoint.Initialize(true, GhostBarrelData.MaxHealthPoint,
|
||||
GhostBarrelData.DisplayName, GhostBarrelMapController.ParticleInstanceLocation);
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
SetMoveSpeed(GhostBarrelData.MoveSpeed);
|
||||
StopMove();
|
||||
|
||||
SpineController.PlayAnimation(BoomBarrelAnimation.In.ToString(), false);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
StartCoroutine(DieCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator DieCoroutine()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
StopMove();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
GhostBarrelMapController.ClearMap(gameObject);
|
||||
// TODO : 죽는 애니메이션 추가
|
||||
//SpineController.SetSkin(SandMoleSkin.Idle.ToString());
|
||||
//var dieTrack = SpineController.PlayAnimation(SandMoleAnimation.Die.ToString(), false);
|
||||
|
||||
//await SpineController.WaitForAnimationCompletion(dieTrack);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(1f, 0f, DieDissolveTime));
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5429f1458968e804687a7325075f4ec4
|
||||
timeCreated: 1717140083
|
@ -1,11 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
[CreateAssetMenu(fileName = "GhostBarrelData", menuName = "ScriptableObjects/Enemy/GhostBarrelData")]
|
||||
public class GhostBarrelData : BossData
|
||||
{
|
||||
[field: SerializeField]
|
||||
public float MoveSpeed { get; private set; } = 3f;
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5faa6532acd37e4ca11754371f8e8df
|
||||
timeCreated: 1717087643
|
@ -1,115 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Maps;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
public enum LavaBarrelSkill
|
||||
{
|
||||
None = 0,
|
||||
}
|
||||
|
||||
public enum LavaBarrelSkin
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public enum LavaBarrelAnimation
|
||||
{
|
||||
None = 0,
|
||||
Empty,
|
||||
Idle,
|
||||
In,
|
||||
Out
|
||||
}
|
||||
|
||||
public class LavaBarrel : SpineBoss
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
public LavaBarrelData LavaBarrelData { get; private set; }
|
||||
public GhostBarrelMapController GhostBarrelMapController { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
//BossHealthPoint.OnHealthChanged -= SummonMiniSandMole;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
LavaBarrelData = BossData as LavaBarrelData;
|
||||
GhostBarrelMapController = MapManager.Instance.GhostBarrelMapController;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine()
|
||||
{
|
||||
HitBoxCollider.enabled = false;
|
||||
BossHealthPoint.Initialize(true, BossData.MaxHealthPoint,
|
||||
BossData.DisplayName, GhostBarrelMapController.ParticleInstanceLocation);
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
|
||||
SpineController.PlayAnimation(BoomBarrelAnimation.Empty.ToString(), false);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
StartCoroutine(DieCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator DieCoroutine()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
// TODO : 죽는 애니메이션 추가
|
||||
//SpineController.SetSkin(SandMoleSkin.Idle.ToString());
|
||||
//var dieTrack = SpineController.PlayAnimation(SandMoleAnimation.Die.ToString(), false);
|
||||
|
||||
//await SpineController.WaitForAnimationCompletion(dieTrack);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(1f, 0f, DieDissolveTime));
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a295a3476b42f6841b374883d52dab2c
|
||||
timeCreated: 1717140083
|
@ -1,10 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
[CreateAssetMenu(fileName = "LavaBarrelData", menuName = "ScriptableObjects/Enemy/LavaBarrelData")]
|
||||
public class LavaBarrelData : BossData
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1168ae704d4881b478b5b429655f398c
|
||||
timeCreated: 1717087643
|
@ -1,115 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Maps;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
public enum SwordBarrelSkill
|
||||
{
|
||||
None = 0,
|
||||
}
|
||||
|
||||
public enum SwordBarrelSkin
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public enum SwordBarrelAnimation
|
||||
{
|
||||
None = 0,
|
||||
Empty,
|
||||
Idle,
|
||||
In,
|
||||
Out
|
||||
}
|
||||
|
||||
public class SwordBarrel : SpineBoss
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
public SwordBarrelData SwordBarrelData { get; private set; }
|
||||
public GhostBarrelMapController GhostBarrelMapController { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
//BossHealthPoint.OnHealthChanged -= SummonMiniSandMole;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
SwordBarrelData = BossData as SwordBarrelData;
|
||||
GhostBarrelMapController = MapManager.Instance.GhostBarrelMapController;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine()
|
||||
{
|
||||
HitBoxCollider.enabled = false;
|
||||
BossHealthPoint.Initialize(true, BossData.MaxHealthPoint,
|
||||
BossData.DisplayName, GhostBarrelMapController.ParticleInstanceLocation);
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
|
||||
SpineController.PlayAnimation(BoomBarrelAnimation.Empty.ToString(), false);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
StartCoroutine(DieCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator DieCoroutine()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
// TODO : 죽는 애니메이션 추가
|
||||
//SpineController.SetSkin(SandMoleSkin.Idle.ToString());
|
||||
//var dieTrack = SpineController.PlayAnimation(SandMoleAnimation.Die.ToString(), false);
|
||||
|
||||
//await SpineController.WaitForAnimationCompletion(dieTrack);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(1f, 0f, DieDissolveTime));
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4ea6fbc02d91f74cb14877b7c97c990
|
||||
timeCreated: 1717140083
|
@ -1,10 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.GhostBarrel
|
||||
{
|
||||
[CreateAssetMenu(fileName = "SwordBarrelData", menuName = "ScriptableObjects/Enemy/SwordBarrelData")]
|
||||
public class SwordBarrelData : BossData
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9bd2cf362c429924ba00b75780b0c68e
|
||||
timeCreated: 1717087643
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10497ffeccc7b6e4eb752997bb45a42c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,97 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Items;
|
||||
using BlueWater.Maps;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.Rhinoceros
|
||||
{
|
||||
public enum RhinocerosSkill
|
||||
{
|
||||
None = 0,
|
||||
BullCharge = 1,
|
||||
HammerSlam = 2,
|
||||
MeteorSwing = 3,
|
||||
SeismicThrust = 4,
|
||||
SkyFallSmash = 5
|
||||
}
|
||||
|
||||
public class Rhinoceros : AnimatorBoss
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
[field: Title("Rhinoceros 컴포넌트")]
|
||||
public RhinocerosData RhinocerosData { get; private set; }
|
||||
public BossMapController BossMapController { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
RhinocerosData = BossData as RhinocerosData;
|
||||
BossMapController = MapManager.Instance.RhinocerosMapController;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine()
|
||||
{
|
||||
BossHealthPoint.Initialize(true, RhinocerosData.MaxHealthPoint,
|
||||
RhinocerosData.DisplayName, BossMapController.ParticleInstanceLocation);
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
SetMoveSpeed(RhinocerosData.MoveSpeed);
|
||||
StopMove();
|
||||
|
||||
yield return IsInitialized;
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
StartCoroutine(DieCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator DieCoroutine()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
StopMove();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
AnimationController.SetAnimationTrigger("isDead");
|
||||
BossMapController.ClearMap(gameObject);
|
||||
|
||||
yield return new WaitUntil(() => AnimationController.GetCurrentAnimationNormalizedTime() >= 1f);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(1f, 0f, DieDissolveTime));
|
||||
|
||||
ItemManager.Instance.ItemDropRandomPosition(BossData.CharacterIdx, transform.position);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 180aea888cb248d895af570342f619ce
|
||||
timeCreated: 1717140083
|
@ -1,11 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.Rhinoceros
|
||||
{
|
||||
[CreateAssetMenu(fileName = "RhinocerosData", menuName = "ScriptableObjects/Enemy/RhinocerosData")]
|
||||
public class RhinocerosData : BossData
|
||||
{
|
||||
[field: SerializeField]
|
||||
public float MoveSpeed { get; private set; } = 3f;
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 744338464e134ec78cf6918c8e0383ac
|
||||
timeCreated: 1717087643
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8043c4132b3a42e48bfc0d42e7bb443f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,85 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Audios;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.SandMole
|
||||
{
|
||||
public class MiniSandMole : SandMole
|
||||
{
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine()
|
||||
{
|
||||
HitBoxCollider.enabled = false;
|
||||
BossHealthPoint.Initialize(false, BossData.MaxHealthPoint,
|
||||
BossData.DisplayName, SandMoleMapController.ParticleInstanceLocation);
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
SetMoveSpeed(SandMoleData.MoveSpeed);
|
||||
StopMove();
|
||||
|
||||
yield return IsInitialized;
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
|
||||
SpineController.SetSkin(SandMoleSkin.Normal.ToString());
|
||||
var isRoar = false;
|
||||
var roarTrack = SpineController.PlayAnimation(SandMoleAnimation.Roar.ToString(), false);
|
||||
while (!roarTrack.IsComplete)
|
||||
{
|
||||
if (CurrentHealthPoint == 0) yield break;
|
||||
|
||||
if (roarTrack.TrackTime >= 1f && !isRoar)
|
||||
{
|
||||
AudioManager.Instance.PlaySfx("MiniSandMoleCry");
|
||||
isRoar = true;
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
StartCoroutine(DieCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator DieCoroutine()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
SandMoleStatus.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
StopMove();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
SpineController.SetSkin(SandMoleSkin.Idle.ToString());
|
||||
var dieTrack = SpineController.PlayAnimation(SandMoleAnimation.Die.ToString(), false);
|
||||
|
||||
yield return new WaitUntil(() => dieTrack.IsComplete);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(1f, 0f, DieDissolveTime));
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2c9c11e3a59f3846831e295e4ace612
|
||||
timeCreated: 1717140083
|
@ -1,189 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BlueWater.Audios;
|
||||
using BlueWater.Items;
|
||||
using BlueWater.Maps;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.SandMole
|
||||
{
|
||||
public enum SandMoleSkill
|
||||
{
|
||||
None = 0,
|
||||
GateOfSpikes,
|
||||
MultiThrowSpikes,
|
||||
SingleRoll,
|
||||
SpikeBarrage
|
||||
}
|
||||
|
||||
public enum SandMoleSkin
|
||||
{
|
||||
Idle = 0,
|
||||
Normal,
|
||||
Spin
|
||||
}
|
||||
|
||||
public enum SandMoleAnimation
|
||||
{
|
||||
None = 0,
|
||||
Die,
|
||||
DigIn,
|
||||
DigOut,
|
||||
Idle,
|
||||
Roar,
|
||||
Spin,
|
||||
SpinReady,
|
||||
SpinReady2,
|
||||
Stun,
|
||||
ShootingStart,
|
||||
ShootingIdle,
|
||||
ShootingEnd
|
||||
}
|
||||
|
||||
public class SandMole : SpineBoss
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
[field: Title("SandMole 컴포넌트")]
|
||||
[field: SerializeField, Required]
|
||||
public SandMoleStatus SandMoleStatus { get; private set; }
|
||||
|
||||
private List<SummonMiniSandMole> _summonMiniSandMoles;
|
||||
|
||||
public SandMoleData SandMoleData { get; private set; }
|
||||
public SandMoleMapController SandMoleMapController { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
HandleMovement();
|
||||
FlipVisualLook();
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
BossHealthPoint.OnHealthChanged -= SummonMiniSandMole;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
SandMoleStatus = GetComponent<SandMoleStatus>();
|
||||
SandMoleData = BossData as SandMoleData;
|
||||
if (SandMoleData != null)
|
||||
{
|
||||
_summonMiniSandMoles = SandMoleData.SummonMiniSandMoles.ConvertAll(mole => new SummonMiniSandMole(mole));
|
||||
}
|
||||
SandMoleMapController = MapManager.Instance.SandMoleMapController;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine()
|
||||
{
|
||||
HitBoxCollider.enabled = false;
|
||||
BossHealthPoint.Initialize(true, SandMoleData.MaxHealthPoint,
|
||||
SandMoleData.DisplayName, SandMoleMapController.ParticleInstanceLocation);
|
||||
BossHealthPoint.OnHealthChanged += SummonMiniSandMole;
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
SetMoveSpeed(SandMoleData.MoveSpeed);
|
||||
StopMove();
|
||||
|
||||
yield return IsInitialized;
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
|
||||
SpineController.SetSkin(SandMoleSkin.Normal.ToString());
|
||||
var isCameraShakeActive = false;
|
||||
var roarTrack = SpineController.PlayAnimation(SandMoleAnimation.Roar.ToString(), false);
|
||||
while (!roarTrack.IsComplete)
|
||||
{
|
||||
if (CurrentHealthPoint == 0) yield break;
|
||||
|
||||
if (roarTrack.TrackTime >= 1f && !isCameraShakeActive)
|
||||
{
|
||||
AudioManager.Instance.PlaySfx("SandMoleCry");
|
||||
VisualFeedbackManager.Instance.CameraShake(CombatCameraManager.Instance.BaseCombatCamera, 2f, 1f);
|
||||
isCameraShakeActive = true;
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
StartCoroutine(DieCoroutine());
|
||||
}
|
||||
|
||||
private IEnumerator DieCoroutine()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
SandMoleStatus.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
StopMove();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
SpineController.SetSkin(SandMoleSkin.Idle.ToString());
|
||||
var dieTrack = SpineController.PlayAnimation(SandMoleAnimation.Die.ToString(), false);
|
||||
SandMoleMapController.ClearMap(gameObject);
|
||||
|
||||
yield return new WaitUntil(() => dieTrack.IsComplete);
|
||||
|
||||
yield return StartCoroutine(DissolveCoroutine(1f, 0f, DieDissolveTime));
|
||||
|
||||
ItemManager.Instance.ItemDropRandomPosition(BossData.CharacterIdx, transform.position);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
private void SummonMiniSandMole(int currentHp, string bossName)
|
||||
{
|
||||
if (currentHp == 0) return;
|
||||
|
||||
var currentHealthPercentage = (float)currentHp / BossData.MaxHealthPoint * 100f;
|
||||
|
||||
foreach (var element in _summonMiniSandMoles)
|
||||
{
|
||||
if (currentHealthPercentage > element.HealthPercentage || element.SummonTrigger) continue;
|
||||
|
||||
SandMoleMapController.SummonMiniSandMole();
|
||||
element.SummonTrigger = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e606f828f61d0241be522a81ccc2915
|
||||
timeCreated: 1717140083
|
@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.SandMole
|
||||
{
|
||||
[CreateAssetMenu(fileName = "SandMoleData", menuName = "ScriptableObjects/Enemy/SandMoleData")]
|
||||
public class SandMoleData : BossData
|
||||
{
|
||||
[field: SerializeField]
|
||||
public float MoveSpeed { get; private set; } = 3f;
|
||||
|
||||
[field: SerializeField]
|
||||
public List<SummonMiniSandMole> SummonMiniSandMoles { get; private set; }
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32c16666a1f9189489ca45f420907595
|
||||
timeCreated: 1717087643
|
@ -1,81 +0,0 @@
|
||||
using BlueWater.Audios;
|
||||
using BlueWater.Interfaces;
|
||||
using BlueWater.Players;
|
||||
using BlueWater.Utility;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.SandMole
|
||||
{
|
||||
public class SandMoleStatus : MonoBehaviour, IStunnable
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
[SerializeField]
|
||||
private SpineController _spineController;
|
||||
|
||||
// Stun
|
||||
[Title("기절 효과")]
|
||||
[SerializeField]
|
||||
private ParticleSystem _stunParticle;
|
||||
|
||||
public bool IsStunEnabled { get; private set; } = true;
|
||||
public bool IsStunned { get; private set; }
|
||||
|
||||
private Coroutine _stunCoolDownCoroutine;
|
||||
|
||||
#endregion
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
InitializeComponents();
|
||||
}
|
||||
|
||||
[Button("컴포넌트 초기화")]
|
||||
private void InitializeComponents()
|
||||
{
|
||||
_spineController = GetComponent<SpineController>();
|
||||
}
|
||||
|
||||
// Stun
|
||||
public bool CanStun() => IsStunEnabled;
|
||||
|
||||
public void Stun(float duration)
|
||||
{
|
||||
AudioManager.Instance.PlaySfx("SandMoleStunned");
|
||||
_spineController.SetSkin(SandMoleSkin.Normal.ToString());
|
||||
_spineController.PlayAnimation(SandMoleAnimation.Stun.ToString(), false);
|
||||
IsStunned = true;
|
||||
if (_stunParticle)
|
||||
{
|
||||
_stunParticle.Play();
|
||||
}
|
||||
|
||||
Utils.StartUniqueCoroutine(this, ref _stunCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndStun));
|
||||
}
|
||||
|
||||
public void TryStun(float duration)
|
||||
{
|
||||
if (!CanStun()) return;
|
||||
|
||||
Stun(duration);
|
||||
}
|
||||
|
||||
public void EndStun()
|
||||
{
|
||||
_spineController.SetSkin(SandMoleSkin.Normal.ToString());
|
||||
_spineController.PlayAnimation(SandMoleAnimation.Idle.ToString(), false);
|
||||
|
||||
Utils.EndUniqueCoroutine(this, ref _stunCoolDownCoroutine);
|
||||
_stunParticle.Stop();
|
||||
_stunParticle.Clear();
|
||||
IsStunned = false;
|
||||
}
|
||||
|
||||
public void StopAllCoroutine()
|
||||
{
|
||||
StopAllCoroutines();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9aa905dd159cefc4cbeb417c688b9639
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.SandMole
|
||||
{
|
||||
[Serializable]
|
||||
public class SummonMiniSandMole
|
||||
{
|
||||
[field: SerializeField]
|
||||
public float HealthPercentage { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public bool SummonTrigger { get; set; }
|
||||
|
||||
public SummonMiniSandMole(SummonMiniSandMole summonMiniSandMole)
|
||||
{
|
||||
HealthPercentage = summonMiniSandMole.HealthPercentage;
|
||||
SummonTrigger = summonMiniSandMole.SummonTrigger;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12827405845b15247b5415e44cd8a33c
|
@ -1,142 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Interfaces;
|
||||
using BlueWater.Players;
|
||||
using Sirenix.OdinInspector;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses
|
||||
{
|
||||
public abstract class SpineBoss : Boss, ICurrentDirection
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
// Components
|
||||
[field: Title("스파인 보스 컴포넌트")]
|
||||
[field: SerializeField]
|
||||
public MeshRenderer MeshRenderer { get; private set; }
|
||||
|
||||
// Classes
|
||||
[field: SerializeField]
|
||||
public SpineController SpineController { get; private set; }
|
||||
|
||||
public bool IsMoving { get; private set; }
|
||||
|
||||
private Vector3 _currentDirection = Vector3.right;
|
||||
public Vector3 CurrentDirection
|
||||
{
|
||||
get => _currentDirection;
|
||||
set
|
||||
{
|
||||
if (value == Vector3.zero) return;
|
||||
|
||||
_currentDirection = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Unity events
|
||||
#region Unity events
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
var originalMaterial = SpineController.SkeletonAnimation.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial;
|
||||
var newMaterial = SpineController.SkeletonAnimation.CustomMaterialOverride[originalMaterial];
|
||||
MaterialInstance = Instantiate(newMaterial);
|
||||
SpineController.SkeletonAnimation.CustomMaterialOverride[originalMaterial] = MaterialInstance;
|
||||
|
||||
BossHealthPoint.SetMaterialInstance(MaterialInstance);
|
||||
IsInitialized = true;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
HandleMovement();
|
||||
FlipVisualLook();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
[Button("컴포넌트 초기화")]
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
MeshRenderer = VisualLook.GetComponent<MeshRenderer>();
|
||||
MeshRenderer.enabled = false;
|
||||
SpineController = GetComponent<SpineController>();
|
||||
|
||||
// var originalMaterial = VisualLook.GetComponent<SkeletonAnimation>().SkeletonDataAsset.atlasAssets[0].PrimaryMaterial;
|
||||
// MaterialInstance = Instantiate(MeshRenderer.material);
|
||||
// SpineController.SkeletonAnimation.CustomMaterialOverride[originalMaterial] = MaterialInstance;
|
||||
// print($"originalMaterial : {originalMaterial.name}, custom : {SpineController.SkeletonAnimation.CustomMaterialOverride[originalMaterial]}");
|
||||
//
|
||||
// BossHealthPoint.SetMaterialInstance(MaterialInstance);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override IEnumerator DissolveCoroutine(float start, float end, float dissolveTime)
|
||||
{
|
||||
if (!IsDissolveActive)
|
||||
{
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, end);
|
||||
yield break;
|
||||
}
|
||||
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, start);
|
||||
MeshRenderer.enabled = true;
|
||||
|
||||
var elapsedTime = 0f;
|
||||
while (elapsedTime <= dissolveTime)
|
||||
{
|
||||
var value = Mathf.Lerp(start, end, elapsedTime / dissolveTime);
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, value);
|
||||
elapsedTime += Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
|
||||
MaterialInstance.SetFloat(_dissolveValueHash, end);
|
||||
}
|
||||
|
||||
protected virtual void FlipVisualLook()
|
||||
{
|
||||
var localScale = VisualLook.localScale;
|
||||
localScale.x = CurrentDirection.x switch
|
||||
{
|
||||
> 0.01f => -Mathf.Abs(localScale.x),
|
||||
< -0.01f => Mathf.Abs(localScale.x),
|
||||
_ => localScale.x
|
||||
};
|
||||
VisualLook.localScale = localScale;
|
||||
}
|
||||
|
||||
protected virtual void HandleMovement()
|
||||
{
|
||||
if (AstarAi == null) return;
|
||||
|
||||
if (!AstarAi.canMove || AstarAi.isStopped)
|
||||
{
|
||||
IsMoving = false;
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentDirection = AstarAi.velocity.normalized;
|
||||
IsMoving = AstarAi.velocity != Vector3.zero || AstarAi.velocity != Vector3.positiveInfinity;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1db8f02f97227534c8bc86e6ac990caf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- _aiMovement: {fileID: 11400000, guid: 5d32cc099076ade42ab5744c9bb621bb, type: 2}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f87f5788f56230d46866b2a9a5c164c6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,112 +0,0 @@
|
||||
using System.Collections;
|
||||
using BlueWater.Items;
|
||||
using BlueWater.Maps;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.TitanSlime
|
||||
{
|
||||
public class TitanSlime : AnimatorBoss
|
||||
{
|
||||
// Variables
|
||||
#region Variables
|
||||
|
||||
[Title("TitanSlime 컴포넌트")]
|
||||
[SerializeField]
|
||||
private SpriteRenderer _rabbit;
|
||||
|
||||
public TitanSlimeData TitanSlimeData { get; private set; }
|
||||
|
||||
[field: SerializeField]
|
||||
public TitanSlimeState TitanSlimeState { get; private set; }
|
||||
|
||||
private TitanSlimeMapController _titanSlimeMapController;
|
||||
|
||||
public float MinCoolDown { get; private set; }
|
||||
public float MaxCoolDown { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
// Initialize methods
|
||||
#region Initialize methods
|
||||
|
||||
protected override void InitializeComponents()
|
||||
{
|
||||
base.InitializeComponents();
|
||||
|
||||
_rabbit = VisualLook.Find("Rabbit").GetComponent<SpriteRenderer>();
|
||||
TitanSlimeData = BossData as TitanSlimeData;
|
||||
_titanSlimeMapController = MapManager.Instance.TitanSlimeMapController;
|
||||
}
|
||||
|
||||
public void Initialize(int level, bool hasRabbit)
|
||||
{
|
||||
StartCoroutine(InitializeCoroutine(level, hasRabbit));
|
||||
}
|
||||
|
||||
private IEnumerator InitializeCoroutine(int level, bool hasRabbit)
|
||||
{
|
||||
HitBoxCollider.enabled = false;
|
||||
_rabbit.enabled = false;
|
||||
var titanSlimeState = TitanSlimeData.TitanSlimeState.Find(list => list.Level == level);
|
||||
TitanSlimeState = new TitanSlimeState(titanSlimeState, hasRabbit);
|
||||
transform.localScale = Vector3.one * TitanSlimeState.Size;
|
||||
MinCoolDown = TitanSlimeState.RandomCooldown.x;
|
||||
MaxCoolDown = TitanSlimeState.RandomCooldown.y;
|
||||
|
||||
BossHealthPoint.Initialize(TitanSlimeState.HasRabbit, TitanSlimeState.MaxHp,
|
||||
TitanSlimeData.DisplayName, _titanSlimeMapController.ParticleInstanceLocation);
|
||||
BossSkillController.Initialize(BossData.SkillDataList);
|
||||
|
||||
if (TitanSlimeState.HasRabbit && titanSlimeState.Level == 1)
|
||||
{
|
||||
yield return IsInitialized;
|
||||
yield return StartCoroutine(DissolveCoroutine(0f, 1f, SpawnDissolveTime));
|
||||
}
|
||||
else
|
||||
{
|
||||
SpriteRenderer.enabled = true;
|
||||
}
|
||||
_rabbit.enabled = TitanSlimeState.HasRabbit;
|
||||
|
||||
BehaviorTree.EnableBehavior();
|
||||
HitBoxCollider.enabled = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Methods
|
||||
#region Methods
|
||||
|
||||
protected override void Die()
|
||||
{
|
||||
BossSkillController.StopAllCoroutine();
|
||||
BehaviorTree.DisableBehavior();
|
||||
|
||||
HitBoxCollider.enabled = false;
|
||||
if (Rigidbody)
|
||||
{
|
||||
Rigidbody.linearVelocity = Vector3.zero;
|
||||
Rigidbody.isKinematic = true;
|
||||
}
|
||||
|
||||
if (TitanSlimeState.Level == 4 && TitanSlimeState.HasRabbit)
|
||||
{
|
||||
ItemManager.Instance.ItemDropRandomPosition(BossData.CharacterIdx, transform.position);
|
||||
_titanSlimeMapController.ClearMap(gameObject);
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
if (TitanSlimeState.Level <= 4)
|
||||
{
|
||||
EnemyManager.Instance.SpawnSplitSlimes(transform.position, TitanSlimeState.Level + 1,
|
||||
TitanSlimeState.HasRabbit, _titanSlimeMapController.EnemyInstanceLocation);
|
||||
}
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
public void AddForce(Vector3 force, ForceMode forceMode) => Rigidbody.AddForce(force, forceMode);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1abdf1f584905f42a67891cc2c6d6f3
|
@ -1,62 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BlueWater.Maps;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Enemies.Bosses.TitanSlime
|
||||
{
|
||||
public class TitanSlimeAttackedParticle : MonoBehaviour
|
||||
{
|
||||
private ParticleSystem _titanSlimeAttackedParticle;
|
||||
|
||||
[SerializeField]
|
||||
private Vector2 _randomDestroy = new(5f, 7f);
|
||||
|
||||
[SerializeField]
|
||||
private GameObject[] _stainPrefabs;
|
||||
|
||||
private Transform _instantiateLocation;
|
||||
private List<ParticleCollisionEvent> _collisionEvents;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_titanSlimeAttackedParticle = GetComponent<ParticleSystem>();
|
||||
_instantiateLocation = FindAnyObjectByType<TitanSlimeMapController>().ParticleInstanceLocation;
|
||||
_collisionEvents = new List<ParticleCollisionEvent>();
|
||||
}
|
||||
|
||||
private void OnParticleCollision(GameObject other)
|
||||
{
|
||||
var numCollisionEvents = _titanSlimeAttackedParticle.GetCollisionEvents(other, _collisionEvents);
|
||||
for (var i = 0; i < numCollisionEvents; i++)
|
||||
{
|
||||
InstantiateStain(_collisionEvents[i].intersection);
|
||||
}
|
||||
}
|
||||
|
||||
private void InstantiateStain(Vector3 position)
|
||||
{
|
||||
position.y += 0.01f;
|
||||
var stain = Instantiate(_stainPrefabs[Random.Range(0, _stainPrefabs.Length)], position, Quaternion.Euler(90, 0, 0), _instantiateLocation);
|
||||
var randomDestroyTime = Random.Range(_randomDestroy.x, _randomDestroy.y);
|
||||
StartCoroutine(DestroyStainCoroutine(stain, randomDestroyTime));
|
||||
}
|
||||
|
||||
private IEnumerator DestroyStainCoroutine(GameObject stain, float destroyTime)
|
||||
{
|
||||
var elapsedTime = 0f;
|
||||
while (elapsedTime < destroyTime)
|
||||
{
|
||||
elapsedTime += Time.deltaTime;
|
||||
|
||||
var remainingTime = destroyTime - elapsedTime;
|
||||
if (remainingTime < 0.5f)
|
||||
{
|
||||
stain.transform.localScale = Vector3.one * (remainingTime / 0.5f);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
Destroy(stain);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user