1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-01 16:38:31 +00:00

Add particles icon to CPUParticles

(cherry picked from commit 345fcb96a2)
This commit is contained in:
Cameron Reikes
2019-08-07 23:18:09 -07:00
committed by Rémi Verschelde
parent 9bf2e54ca5
commit dd83296155
4 changed files with 126 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
#include "scene/3d/baked_lightmap.h"
#include "scene/3d/collision_polygon.h"
#include "scene/3d/collision_shape.h"
#include "scene/3d/cpu_particles.h"
#include "scene/3d/gi_probe.h"
#include "scene/3d/light.h"
#include "scene/3d/listener.h"
@@ -2375,6 +2376,33 @@ void VisibilityNotifierGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
////
CPUParticlesGizmoPlugin::CPUParticlesGizmoPlugin() {
create_icon_material("particles_icon", SpatialEditor::get_singleton()->get_icon("GizmoCPUParticles", "EditorIcons"));
}
bool CPUParticlesGizmoPlugin::has_gizmo(Spatial *p_spatial) {
return Object::cast_to<CPUParticles>(p_spatial) != NULL;
}
String CPUParticlesGizmoPlugin::get_name() const {
return "CPUParticles";
}
int CPUParticlesGizmoPlugin::get_priority() const {
return -1;
}
bool CPUParticlesGizmoPlugin::is_selectable_when_hidden() const {
return true;
}
void CPUParticlesGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
Ref<Material> icon = get_material("particles_icon", p_gizmo);
p_gizmo->add_unscaled_billboard(icon, 0.05);
}
////
ParticlesGizmoPlugin::ParticlesGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4));
create_material("particles_material", gizmo_color);