Compare commits
6 Commits
ffd2ca8c73
...
a7b89ff861
| Author | SHA1 | Date | |
|---|---|---|---|
| a7b89ff861 | |||
| aa00ee520e | |||
| baf4da0f77 | |||
| ec694c3a80 | |||
| f4a0c250fb | |||
| 14338f752f |
File diff suppressed because it is too large
Load Diff
@@ -1927,6 +1927,9 @@ GameObject:
|
||||
- component: {fileID: -5454809204868423215}
|
||||
- component: {fileID: -4476104823835307179}
|
||||
- component: {fileID: 5774766047967133809}
|
||||
- component: {fileID: 8818883032728065057}
|
||||
- component: {fileID: -2857689419101920665}
|
||||
- component: {fileID: 7544406269366897481}
|
||||
m_Layer: 0
|
||||
m_Name: TestBoss
|
||||
m_TagString: Untagged
|
||||
@@ -2113,9 +2116,56 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Enemy.EnemyAnimationController
|
||||
ShowTopMostFoldoutHeaderGroup: 1
|
||||
speedParam: Speed
|
||||
attackTriggerParam: Attack
|
||||
skillTriggerParam: Skill
|
||||
speedSmoothTime: 0.1
|
||||
stopThreshold: 0.05
|
||||
--- !u!114 &8818883032728065057
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5581648761285601425}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 59b4feaa06ce4c74f97ed5b57ddd74d1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.SkillController
|
||||
animator: {fileID: 4019041888965840580}
|
||||
baseController: {fileID: 9100000, guid: 4bd980f1a222c5b468136f7e717925d5, type: 2}
|
||||
baseSkillClip: {fileID: -7717634560727564301, guid: 0f6fd9302e489b94d96774e2713b1317, type: 3}
|
||||
debugMode: 1
|
||||
showAreaDebug: 1
|
||||
debugDrawDuration: 1
|
||||
--- !u!114 &-2857689419101920665
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5581648761285601425}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d1f7d13276f272b428bddd4d9aa5b3d8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Team
|
||||
teamType: 2
|
||||
--- !u!114 &7544406269366897481
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5581648761285601425}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7a766b6ab825c1445a3385079bb32cc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Abnormalities.AbnormalityManager
|
||||
ShowTopMostFoldoutHeaderGroup: 1
|
||||
characterStats: {fileID: 0}
|
||||
networkController: {fileID: 0}
|
||||
--- !u!1 &5887309268024433402
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -21,6 +21,8 @@ GameObject:
|
||||
- component: {fileID: 6912018896034183004}
|
||||
- component: {fileID: 6585367215453362640}
|
||||
- component: {fileID: 1242716222252539497}
|
||||
- component: {fileID: 3552488436187204500}
|
||||
- component: {fileID: -5132198055668300151}
|
||||
m_Layer: 0
|
||||
m_Name: Player
|
||||
m_TagString: Player
|
||||
@@ -104,7 +106,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
|
||||
GlobalObjectIdHash: 652883547
|
||||
GlobalObjectIdHash: 291279334
|
||||
InScenePlacedSourceGlobalObjectIdHash: 0
|
||||
DeferredDespawnTick: 0
|
||||
Ownership: 1
|
||||
@@ -134,8 +136,8 @@ MonoBehaviour:
|
||||
rotationSpeed: 10
|
||||
gravity: -9.81
|
||||
jumpForce: 5
|
||||
skillController: {fileID: 0}
|
||||
animator: {fileID: 0}
|
||||
skillController: {fileID: 6912018896034183004}
|
||||
animator: {fileID: 3426985706796420257}
|
||||
--- !u!114 &194806265065691022
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -195,7 +197,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Player.PlayerNetworkController
|
||||
ShowTopMostFoldoutHeaderGroup: 1
|
||||
characterStats: {fileID: 0}
|
||||
characterStats: {fileID: -5132198055668300151}
|
||||
--- !u!114 &8606252901290138286
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -328,8 +330,45 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Abnormalities.AbnormalityManager
|
||||
ShowTopMostFoldoutHeaderGroup: 1
|
||||
characterStats: {fileID: 0}
|
||||
networkController: {fileID: 0}
|
||||
characterStats: {fileID: -5132198055668300151}
|
||||
networkController: {fileID: 1664515335065415329}
|
||||
--- !u!114 &3552488436187204500
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6473031571298860035}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d1f7d13276f272b428bddd4d9aa5b3d8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Team
|
||||
teamType: 1
|
||||
--- !u!114 &-5132198055668300151
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6473031571298860035}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fae0149926eea244dad932b67ee76f7b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Stats.CharacterStats
|
||||
strength:
|
||||
baseValue: 10
|
||||
dexterity:
|
||||
baseValue: 10
|
||||
intelligence:
|
||||
baseValue: 10
|
||||
vitality:
|
||||
baseValue: 5
|
||||
wisdom:
|
||||
baseValue: 100
|
||||
spirit:
|
||||
baseValue: 100
|
||||
--- !u!1001 &7705728874586931617
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -451,6 +451,18 @@ PrefabInstance:
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 170188453522781500, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 170188453522781500, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 170188453522781500, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 222507439395443271, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
@@ -527,6 +539,18 @@ PrefabInstance:
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2668790415109567114, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2668790415109567114, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2668790415109567114, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3299919758736932218, guid: 54087b4bd46db9e4fb7da13cf7a6cc69, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
|
||||
69
Assets/Scripts/AI/BehaviorActions/Actions/UseSkillAction.cs
Normal file
69
Assets/Scripts/AI/BehaviorActions/Actions/UseSkillAction.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Colosseum.Skills;
|
||||
using Unity.Behavior;
|
||||
using UnityEngine;
|
||||
using Action = Unity.Behavior.Action;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 스킬을 사용하는 Behavior Tree Action.
|
||||
/// 스킬 실행이 완료될 때까지 Running 상태를 유지합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(name: "Use Skill", story: "[스킬] 사용", category: "Action", id: "799f1e8cfafa78b2d52ef61a6bbb29b9")]
|
||||
public partial class UseSkillAction : Action
|
||||
{
|
||||
[SerializeReference] public BlackboardVariable<SkillData> 스킬;
|
||||
|
||||
private SkillController skillController;
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
// 스킬 데이터 확인
|
||||
if (스킬?.Value == null)
|
||||
{
|
||||
Debug.LogWarning("[UseSkillAction] 스킬이 null입니다.");
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
// SkillController 컴포넌트 가져오기
|
||||
skillController = GameObject.GetComponent<SkillController>();
|
||||
if (skillController == null)
|
||||
{
|
||||
Debug.LogWarning($"[UseSkillAction] SkillController를 찾을 수 없습니다: {GameObject.name}");
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
// 스킬 실행 시도
|
||||
bool success = skillController.ExecuteSkill(스킬.Value);
|
||||
if (!success)
|
||||
{
|
||||
// 이미 다른 스킬 사용 중이거나 쿨타임
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
protected override Status OnUpdate()
|
||||
{
|
||||
// SkillController가 해제된 경우
|
||||
if (skillController == null)
|
||||
{
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
// 스킬 애니메이션이 종료되면 성공
|
||||
if (!skillController.IsPlayingAnimation)
|
||||
{
|
||||
return Status.Success;
|
||||
}
|
||||
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
protected override void OnEnd()
|
||||
{
|
||||
skillController = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf140a11f5104674fb8367f4eb5702cb
|
||||
@@ -1,13 +1,15 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Unity.Netcode;
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Combat;
|
||||
|
||||
namespace Colosseum.Player
|
||||
{
|
||||
/// <summary>
|
||||
/// 플레이어 네트워크 상태 관리 (HP, MP 등)
|
||||
/// </summary>
|
||||
public class PlayerNetworkController : NetworkBehaviour
|
||||
public class PlayerNetworkController : NetworkBehaviour, IDamageable
|
||||
{
|
||||
[Header("References")]
|
||||
[Tooltip("CharacterStats 컴포넌트 (없으면 자동 검색)")]
|
||||
@@ -23,6 +25,14 @@ namespace Colosseum.Player
|
||||
public float MaxMana => characterStats != null ? characterStats.MaxMana : 50f;
|
||||
public CharacterStats Stats => characterStats;
|
||||
|
||||
// 체력/마나 변경 이벤트
|
||||
public event Action<float, float> OnHealthChanged; // (oldValue, newValue)
|
||||
public event Action<float, float> OnManaChanged; // (oldValue, newValue)
|
||||
|
||||
// IDamageable 구현
|
||||
public float CurrentHealth => currentHealth.Value;
|
||||
public bool IsDead => currentHealth.Value <= 0f;
|
||||
|
||||
public override void OnNetworkSpawn()
|
||||
{
|
||||
// CharacterStats 참조 확인
|
||||
@@ -31,6 +41,10 @@ namespace Colosseum.Player
|
||||
characterStats = GetComponent<CharacterStats>();
|
||||
}
|
||||
|
||||
// 네트워크 변수 변경 콜백 등록
|
||||
currentHealth.OnValueChanged += HandleHealthChanged;
|
||||
currentMana.OnValueChanged += HandleManaChanged;
|
||||
|
||||
// 초기화
|
||||
if (IsServer)
|
||||
{
|
||||
@@ -39,6 +53,23 @@ namespace Colosseum.Player
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnNetworkDespawn()
|
||||
{
|
||||
// 콜백 해제
|
||||
currentHealth.OnValueChanged -= HandleHealthChanged;
|
||||
currentMana.OnValueChanged -= HandleManaChanged;
|
||||
}
|
||||
|
||||
private void HandleHealthChanged(float oldValue, float newValue)
|
||||
{
|
||||
OnHealthChanged?.Invoke(oldValue, newValue);
|
||||
}
|
||||
|
||||
private void HandleManaChanged(float oldValue, float newValue)
|
||||
{
|
||||
OnManaChanged?.Invoke(oldValue, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 대미지 적용 (서버에서만 실행)
|
||||
/// </summary>
|
||||
@@ -85,5 +116,38 @@ namespace Colosseum.Player
|
||||
// TODO: 사망 처리 로직
|
||||
Debug.Log($"Player {OwnerClientId} died!");
|
||||
}
|
||||
|
||||
#region IDamageable
|
||||
/// <summary>
|
||||
/// 대미지 적용 (서버에서만 호출)
|
||||
/// </summary>
|
||||
public float TakeDamage(float damage, object source = null)
|
||||
{
|
||||
if (!IsServer) return 0f;
|
||||
|
||||
float actualDamage = Mathf.Min(damage, currentHealth.Value);
|
||||
currentHealth.Value = Mathf.Max(0f, currentHealth.Value - damage);
|
||||
|
||||
if (currentHealth.Value <= 0f)
|
||||
{
|
||||
HandleDeath();
|
||||
}
|
||||
|
||||
return actualDamage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 체력 회복 (서버에서만 호출)
|
||||
/// </summary>
|
||||
public float Heal(float amount)
|
||||
{
|
||||
if (!IsServer) return 0f;
|
||||
|
||||
float actualHeal = Mathf.Min(amount, MaxHealth - currentHealth.Value);
|
||||
currentHealth.Value = Mathf.Min(MaxHealth, currentHealth.Value + amount);
|
||||
|
||||
return actualHeal;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Player;
|
||||
using Colosseum.Combat;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -34,11 +35,11 @@ namespace Colosseum.Skills.Effects
|
||||
// 대미지 계산
|
||||
float totalDamage = CalculateDamage(caster);
|
||||
|
||||
// 타겟에 대미지 적용
|
||||
var networkController = target.GetComponent<PlayerNetworkController>();
|
||||
if (networkController != null)
|
||||
// 타겟에 대미지 적용 (IDamageable 인터페이스 사용)
|
||||
var damageable = target.GetComponent<IDamageable>();
|
||||
if (damageable != null)
|
||||
{
|
||||
networkController.TakeDamageRpc(totalDamage);
|
||||
damageable.TakeDamage(totalDamage, caster);
|
||||
}
|
||||
|
||||
Debug.Log($"[Damage] {caster.name} -> {target.name}: {totalDamage:F1} ({damageType})");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Player;
|
||||
using Colosseum.Combat;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -22,11 +23,11 @@ namespace Colosseum.Skills.Effects
|
||||
// 회복량 계산
|
||||
float totalHeal = CalculateHeal(caster);
|
||||
|
||||
// 타겟에 회복 적용
|
||||
var networkController = target.GetComponent<PlayerNetworkController>();
|
||||
if (networkController != null)
|
||||
// 타겟에 회복 적용 (IDamageable 인터페이스 사용)
|
||||
var damageable = target.GetComponent<IDamageable>();
|
||||
if (damageable != null)
|
||||
{
|
||||
networkController.RestoreHealthRpc(totalHeal);
|
||||
damageable.Heal(totalHeal);
|
||||
}
|
||||
|
||||
Debug.Log($"[Heal] {caster.name} -> {target.name}: {totalHeal:F1}");
|
||||
|
||||
@@ -2,15 +2,26 @@ using UnityEngine;
|
||||
|
||||
namespace Colosseum
|
||||
{
|
||||
/// <summary>
|
||||
/// 팀 타입 열거형
|
||||
/// </summary>
|
||||
public enum TeamType
|
||||
{
|
||||
None = 0,
|
||||
Player = 1,
|
||||
Enemy = 2,
|
||||
Neutral = 3,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 팀 정보를 관리하는 컴포넌트.
|
||||
/// 캐릭터나 엔티티에 추가하여 팀 구분에 사용합니다.
|
||||
/// </summary>
|
||||
public class Team : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private int teamId = 0;
|
||||
[SerializeField] private TeamType teamType = TeamType.None;
|
||||
|
||||
public int TeamId => teamId;
|
||||
public TeamType TeamType => teamType;
|
||||
|
||||
/// <summary>
|
||||
/// 같은 팀인지 확인
|
||||
@@ -27,7 +38,7 @@ namespace Colosseum
|
||||
// 한쪽만 팀이 없으면 다른 팀
|
||||
if (teamA == null || teamB == null) return false;
|
||||
|
||||
return teamA.TeamId == teamB.TeamId;
|
||||
return teamA.TeamType == teamB.TeamType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Colosseum.Player;
|
||||
|
||||
@@ -28,22 +29,26 @@ namespace Colosseum.UI
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// 플레이어가 아직 없으면 계속 찾기
|
||||
if (targetPlayer == null && autoFindPlayer)
|
||||
{
|
||||
FindLocalPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
if (targetPlayer != null)
|
||||
{
|
||||
UpdateStatBars();
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
// 이벤트 구독 해제
|
||||
UnsubscribeFromEvents();
|
||||
}
|
||||
|
||||
private void FindLocalPlayer()
|
||||
{
|
||||
var players = FindObjectsByType<PlayerNetworkController>(FindObjectsSortMode.None);
|
||||
Debug.Log($"[PlayerHUD] Finding player... found {players.Length} players");
|
||||
foreach (var player in players)
|
||||
{
|
||||
Debug.Log($"[PlayerHUD] Player {player.OwnerClientId}: IsOwner={player.IsOwner}, IsSpawned={player.IsSpawned}");
|
||||
if (player.IsOwner)
|
||||
{
|
||||
SetTarget(player);
|
||||
@@ -57,20 +62,81 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
public void SetTarget(PlayerNetworkController player)
|
||||
{
|
||||
Debug.Log($"[PlayerHUD] SetTarget called: {(player != null ? $"Player {player.OwnerClientId}" : "null")}");
|
||||
|
||||
// 이전 타겟 구독 해제
|
||||
UnsubscribeFromEvents();
|
||||
|
||||
targetPlayer = player;
|
||||
|
||||
// 새 타겟 구독
|
||||
SubscribeToEvents();
|
||||
|
||||
// 초기 값 설정
|
||||
UpdateStatBars();
|
||||
|
||||
Debug.Log($"[PlayerHUD] Initial HP: {targetPlayer?.Health}/{targetPlayer?.MaxHealth}, MP: {targetPlayer?.Mana}/{targetPlayer?.MaxMana}");
|
||||
}
|
||||
|
||||
private void SubscribeToEvents()
|
||||
{
|
||||
if (targetPlayer == null) return;
|
||||
|
||||
targetPlayer.OnHealthChanged += HandleHealthChanged;
|
||||
targetPlayer.OnManaChanged += HandleManaChanged;
|
||||
}
|
||||
|
||||
private void UnsubscribeFromEvents()
|
||||
{
|
||||
if (targetPlayer == null) return;
|
||||
|
||||
targetPlayer.OnHealthChanged -= HandleHealthChanged;
|
||||
targetPlayer.OnManaChanged -= HandleManaChanged;
|
||||
}
|
||||
|
||||
private void HandleHealthChanged(float oldValue, float newValue)
|
||||
{
|
||||
if (healthBar != null && targetPlayer != null)
|
||||
{
|
||||
healthBar.SetValue(newValue, targetPlayer.MaxHealth);
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleManaChanged(float oldValue, float newValue)
|
||||
{
|
||||
if (manaBar != null && targetPlayer != null)
|
||||
{
|
||||
manaBar.SetValue(newValue, targetPlayer.MaxMana);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateStatBars()
|
||||
{
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
Debug.Log("[PlayerHUD] UpdateStatBars: targetPlayer is null");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[PlayerHUD] UpdateStatBars: HP={targetPlayer.Health}/{targetPlayer.MaxHealth}, MP={targetPlayer.Mana}/{targetPlayer.MaxMana}");
|
||||
|
||||
if (healthBar != null)
|
||||
{
|
||||
healthBar.SetValue(targetPlayer.Health, targetPlayer.MaxHealth);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[PlayerHUD] healthBar is null!");
|
||||
}
|
||||
|
||||
if (manaBar != null)
|
||||
{
|
||||
manaBar.SetValue(targetPlayer.Mana, targetPlayer.MaxMana);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[PlayerHUD] manaBar is null!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,10 @@ namespace Colosseum.UI
|
||||
if (!smoothTransition)
|
||||
{
|
||||
displayValue = currentValue;
|
||||
UpdateVisuals();
|
||||
}
|
||||
|
||||
// 항상 즉시 시각적 업데이트 수행
|
||||
UpdateVisuals();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -63,7 +65,11 @@ namespace Colosseum.UI
|
||||
|
||||
private void UpdateVisuals()
|
||||
{
|
||||
if (maxValue <= 0f) return;
|
||||
if (maxValue <= 0f)
|
||||
{
|
||||
Debug.LogWarning($"[StatBar:{gameObject.name}] UpdateVisuals: maxValue is {maxValue}, skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
float ratio = Mathf.Clamp01(displayValue / maxValue);
|
||||
|
||||
|
||||
28
Assets/Skills/Effects/Melee_Slash_Boss_0.asset
Normal file
28
Assets/Skills/Effects/Melee_Slash_Boss_0.asset
Normal file
@@ -0,0 +1,28 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 58efb3c775496fa40b801b21127a011e, type: 3}
|
||||
m_Name: Melee_Slash_Boss_0
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.Effects.DamageEffect
|
||||
targetType: 1
|
||||
targetTeam: 0
|
||||
areaCenter: 0
|
||||
areaShape: 1
|
||||
targetLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
areaRadius: 3
|
||||
fanOriginDistance: 0
|
||||
fanRadius: 3
|
||||
fanHalfAngle: 45
|
||||
baseDamage: 10
|
||||
damageType: 0
|
||||
statScaling: 1
|
||||
8
Assets/Skills/Effects/Melee_Slash_Boss_0.asset.meta
Normal file
8
Assets/Skills/Effects/Melee_Slash_Boss_0.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86bf7e282c1639c4889910475aaccdef
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
25
Assets/Skills/Melee_Slash_Boss.asset
Normal file
25
Assets/Skills/Melee_Slash_Boss.asset
Normal file
@@ -0,0 +1,25 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 94f0a76cebcac2f4fb5daf1b675fd79f, type: 3}
|
||||
m_Name: Melee_Slash_Boss
|
||||
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.SkillData
|
||||
skillName: "\uBCA0\uAE30"
|
||||
description:
|
||||
icon: {fileID: 0}
|
||||
skillClip: {fileID: -7717634560727564301, guid: 0f6fd9302e489b94d96774e2713b1317, type: 3}
|
||||
endClip: {fileID: -8265974341663887746, guid: fbcbf9c09792c924296ac6036e76f6dc, type: 3}
|
||||
useRootMotion: 1
|
||||
ignoreRootMotionY: 1
|
||||
cooldown: 1
|
||||
manaCost: 5
|
||||
effects:
|
||||
- {fileID: 11400000, guid: 86bf7e282c1639c4889910475aaccdef, type: 2}
|
||||
8
Assets/Skills/Melee_Slash_Boss.asset.meta
Normal file
8
Assets/Skills/Melee_Slash_Boss.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f40629d4d334434285e8fdec3714536
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user