feat: defined map region
This commit is contained in:
parent
569ac1f712
commit
bd5320f7a1
7
modules/wave_survival/map_region.cpp
Normal file
7
modules/wave_survival/map_region.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include "map_region.h"
|
||||||
|
|
||||||
|
String const MapRegion::sig_phase_changed{ "phase_changed" };
|
||||||
|
|
||||||
|
void MapRegion::_bind_methods() {
|
||||||
|
ADD_SIGNAL(MethodInfo(sig_phase_changed, PropertyInfo(Variant::BOOL, "hunt_phase")));
|
||||||
|
}
|
18
modules/wave_survival/map_region.h
Normal file
18
modules/wave_survival/map_region.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef MAP_REGION_H
|
||||||
|
#define MAP_REGION_H
|
||||||
|
|
||||||
|
#include "scene/3d/physics/area_3d.h"
|
||||||
|
|
||||||
|
class MapRegion : public Area3D {
|
||||||
|
GDCLASS(MapRegion, Area3D);
|
||||||
|
static void _bind_methods();
|
||||||
|
|
||||||
|
private:
|
||||||
|
float awareness{ 0.f };
|
||||||
|
bool hunt_phase{ false };
|
||||||
|
|
||||||
|
public:
|
||||||
|
static String const sig_phase_changed;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !MAP_REGION_H
|
|
@ -22,6 +22,7 @@
|
||||||
#include "wave_survival/state.h"
|
#include "wave_survival/state.h"
|
||||||
#include "wave_survival/state_machine.h"
|
#include "wave_survival/state_machine.h"
|
||||||
#include "wave_survival/weapon_base.h"
|
#include "wave_survival/weapon_base.h"
|
||||||
|
#include "wave_survival/map_region.h"
|
||||||
#include "wave_survival/weapon_inventory.h"
|
#include "wave_survival/weapon_inventory.h"
|
||||||
#include "wave_survival/weapons/revolver.h"
|
#include "wave_survival/weapons/revolver.h"
|
||||||
#include "wave_survival/weapons/rifle.h"
|
#include "wave_survival/weapons/rifle.h"
|
||||||
|
@ -57,6 +58,7 @@ void initialize_wave_survival_module(ModuleInitializationLevel p_level) {
|
||||||
GDREGISTER_CLASS(SoundEventNode);
|
GDREGISTER_CLASS(SoundEventNode);
|
||||||
GDREGISTER_CLASS(MuzzleEffect);
|
GDREGISTER_CLASS(MuzzleEffect);
|
||||||
GDREGISTER_RUNTIME_CLASS(HeadsUpDisplay);
|
GDREGISTER_RUNTIME_CLASS(HeadsUpDisplay);
|
||||||
|
GDREGISTER_RUNTIME_CLASS(MapRegion);
|
||||||
|
|
||||||
memnew(SoundEventPatchboard);
|
memnew(SoundEventPatchboard);
|
||||||
Engine::get_singleton()->add_singleton(Engine::Singleton(SoundEventPatchboard::get_class_static(), SoundEventPatchboard::get_singleton()));
|
Engine::get_singleton()->add_singleton(Engine::Singleton(SoundEventPatchboard::get_class_static(), SoundEventPatchboard::get_singleton()));
|
||||||
|
|
Loading…
Reference in a new issue