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
30
modules/wave_survival/interactable.h
Normal file
30
modules/wave_survival/interactable.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef INTERACTABLE_H
|
||||
#define INTERACTABLE_H
|
||||
|
||||
#include "player_interactor.h"
|
||||
#include "scene/main/node.h"
|
||||
|
||||
class Interactable : public Node {
|
||||
GDCLASS(Interactable, Node);
|
||||
static void _bind_methods();
|
||||
|
||||
protected:
|
||||
virtual void activated(PlayerInteractor *interactor) {}
|
||||
GDVIRTUAL1_REQUIRED(_activated, PlayerInteractor *);
|
||||
virtual void highlight_changed(PlayerInteractor *interactor, bool new_value) {}
|
||||
GDVIRTUAL2(_highlight_changed, PlayerInteractor *, bool);
|
||||
|
||||
public:
|
||||
void activate(PlayerInteractor *interactor);
|
||||
|
||||
void set_highlighted(PlayerInteractor *interactor, bool value);
|
||||
bool get_highlighted() const;
|
||||
void set_highlight_tooltip(String value);
|
||||
String get_highlight_tooltip() const;
|
||||
|
||||
private:
|
||||
bool highlighted{ false };
|
||||
String highlight_tooltip{ "Activate" };
|
||||
};
|
||||
|
||||
#endif // !INTERACTABLE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue