feat: added interactions, demo packs and destructables
This commit is contained in:
parent
d66c999039
commit
5a4ac26c72
12 changed files with 369 additions and 23 deletions
|
|
@ -9,6 +9,7 @@ String PlayerInput::sig_switch_weapon{ "switch_weapon" };
|
|||
String PlayerInput::sig_run{ "run" };
|
||||
String PlayerInput::sig_jump{ "jump" };
|
||||
String PlayerInput::sig_crouch{ "crouch" };
|
||||
String PlayerInput::sig_activate{ "activate" };
|
||||
|
||||
void PlayerInput::_bind_methods() {
|
||||
ADD_SIGNAL(MethodInfo(sig_movement_input, PropertyInfo(Variant::VECTOR2, "axes")));
|
||||
|
|
@ -19,6 +20,7 @@ void PlayerInput::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo(sig_run, PropertyInfo(Variant::BOOL, "is_running")));
|
||||
ADD_SIGNAL(MethodInfo(sig_jump));
|
||||
ADD_SIGNAL(MethodInfo(sig_crouch, PropertyInfo(Variant::BOOL, "is_crouching")));
|
||||
ADD_SIGNAL(MethodInfo(sig_activate));
|
||||
}
|
||||
|
||||
void PlayerInput::normalize_input() {
|
||||
|
|
@ -83,4 +85,7 @@ void PlayerInput::unhandled_input(Ref<InputEvent> const &event) {
|
|||
if (event->is_action("switch_weapon") && event->is_pressed()) {
|
||||
emit_signal(sig_switch_weapon);
|
||||
}
|
||||
if (event->is_action("activate") && event->is_pressed()) {
|
||||
emit_signal(sig_activate);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue