generated from Persson-dev/Godot-Xmake
Add Hitmarkers
This commit is contained in:
@@ -35,6 +35,9 @@ void BoneCollisionShape::_ready() {
|
||||
m_Crosshair = Object::cast_to<Crosshair>(
|
||||
get_parent()->get_parent()->get_parent()->get_parent()->get_parent()->get_parent()->get_parent()->find_child("Crosshair"));
|
||||
DEV_ASSERT(m_Crosshair);
|
||||
m_HitMarkers = Object::cast_to<HitMarkers>(
|
||||
get_parent()->get_parent()->get_parent()->get_parent()->get_parent()->get_parent()->get_parent()->find_child("HitMarkers"));
|
||||
DEV_ASSERT(m_HitMarkers);
|
||||
}
|
||||
|
||||
void BoneCollisionShape::set_head_damage(int a_D) {
|
||||
@@ -56,12 +59,13 @@ int BoneCollisionShape::get_body_damage() const {
|
||||
void BoneCollisionShape::headshot_hit() {
|
||||
ERR_PRINT("zombie headshot hit");
|
||||
m_Crosshair->set_dot_color(Color(1, 0, 0, 1));
|
||||
m_HitMarkers->hsvisible(true);
|
||||
emit_signal("a_ZombieHeadShotHit", m_HeadDamage);
|
||||
}
|
||||
|
||||
void BoneCollisionShape::bodyshot_hit() {
|
||||
ERR_PRINT("zombie body hit");
|
||||
m_Crosshair->set_dot_color(Color(0, 0, 1, 1));
|
||||
m_HitMarkers->visible(true);
|
||||
emit_signal("a_ZombieBodyShotHit", m_BodyDamage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user