130 lines
3.5 KiB
C#
130 lines
3.5 KiB
C#
|
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.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
|
|||
|
|
|||
|
// [field: Title("SandMole 컴포넌트")]
|
|||
|
// [field: SerializeField, Required]
|
|||
|
// public SandMoleStatus SandMoleStatus { get; private set; }
|
|||
|
//
|
|||
|
// private List<SummonMiniSandMole> _summonMiniSandMoles;
|
|||
|
|
|||
|
public GhostBarrelData GhostBarrelData { get; private set; }
|
|||
|
public GhostBarrelMapController GhostBarrelMapController { 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>();
|
|||
|
GhostBarrelData = BossData as GhostBarrelData;
|
|||
|
GhostBarrelMapController = MapManager.Instance.GhostBarrelMapController;
|
|||
|
}
|
|||
|
|
|||
|
public override void Initialize()
|
|||
|
{
|
|||
|
StartCoroutine(InitializeCoroutine());
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
// Methods
|
|||
|
#region Methods
|
|||
|
|
|||
|
private IEnumerator InitializeCoroutine()
|
|||
|
{
|
|||
|
HitBoxCollider.enabled = false;
|
|||
|
BossHealthPoint.Initialize(true, GhostBarrelData.MaxHealthPoint,
|
|||
|
GhostBarrelData.DisplayName, GhostBarrelMapController.ParticleInstanceLocation);
|
|||
|
//BossHealthPoint.OnHealthChanged += SummonMiniSandMole;
|
|||
|
BossSkillController.Initialize(BossData.SkillDataList);
|
|||
|
SetMoveSpeed(GhostBarrelData.MoveSpeed);
|
|||
|
StopMove();
|
|||
|
|
|||
|
yield return null;
|
|||
|
|
|||
|
BehaviorTree.EnableBehavior();
|
|||
|
HitBoxCollider.enabled = true;
|
|||
|
}
|
|||
|
|
|||
|
protected override async void Die()
|
|||
|
{
|
|||
|
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);
|
|||
|
//GhostBarrelMapController.ClearMap(gameObject);
|
|||
|
|
|||
|
//await SpineController.WaitForAnimationCompletion(dieTrack);
|
|||
|
ItemManager.Instance.ItemDropRandomPosition(BossData.CharacterIdx, transform.position);
|
|||
|
Destroy(gameObject);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|