generated from Persson-dev/Godot-Xmake
simple dynamic crosshair
This commit is contained in:
@@ -24,7 +24,10 @@ BoneCollisionShape::BoneCollisionShape() {}
|
||||
|
||||
BoneCollisionShape::~BoneCollisionShape() {}
|
||||
|
||||
void BoneCollisionShape::_ready() {}
|
||||
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);
|
||||
}
|
||||
|
||||
void BoneCollisionShape::set_head_damage(int a_D) {
|
||||
m_HeadDamage = a_D;
|
||||
@@ -44,11 +47,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));
|
||||
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));
|
||||
emit_signal("a_ZombieBodyShotHit", m_BodyDamage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user