diff --git a/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs b/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs
index bc1f49443..6513ac9e0 100644
--- a/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs
+++ b/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs
@@ -288,16 +288,15 @@ namespace FlaxEditor.Windows.Assets
///
public SearchAssetTypes AssetType => SearchAssetTypes.ParticleEmitter;
-
+
///
public override void Update(float deltaTime)
{
base.Update(deltaTime);
- if(_asset == null)
+ if (_asset == null)
return;
-
- _showSourceCodeButton.Enabled = _asset.HasShaderCode();
+ _showSourceCodeButton.Enabled = _asset.HasShaderCode;
}
}
}
diff --git a/Source/Engine/Particles/ParticleEmitter.cpp b/Source/Engine/Particles/ParticleEmitter.cpp
index 4490406bc..6264ce412 100644
--- a/Source/Engine/Particles/ParticleEmitter.cpp
+++ b/Source/Engine/Particles/ParticleEmitter.cpp
@@ -440,20 +440,17 @@ bool ParticleEmitter::Save(const StringView& path)
return SaveSurface(data);
}
-bool ParticleEmitter::HasShaderCode()
+bool ParticleEmitter::HasShaderCode() const
{
- if(SimulationMode != ParticlesSimulationMode::GPU)
- {
+ if (SimulationMode != ParticlesSimulationMode::GPU)
return false;
- }
- #if COMPILE_WITH_PARTICLE_GPU_GRAPH && COMPILE_WITH_SHADER_COMPILER
- if(_shaderHeader.ParticleEmitter.GraphVersion == PARTICLE_GPU_GRAPH_VERSION
+#if COMPILE_WITH_PARTICLE_GPU_GRAPH && COMPILE_WITH_SHADER_COMPILER
+ if (_shaderHeader.ParticleEmitter.GraphVersion == PARTICLE_GPU_GRAPH_VERSION
&& HasChunk(SHADER_FILE_CHUNK_SOURCE)
&& !HasDependenciesModified())
return true;
- #endif
-
+#endif
return false;
}
diff --git a/Source/Engine/Particles/ParticleEmitter.h b/Source/Engine/Particles/ParticleEmitter.h
index 4b27036f7..772f5569e 100644
--- a/Source/Engine/Particles/ParticleEmitter.h
+++ b/Source/Engine/Particles/ParticleEmitter.h
@@ -175,10 +175,9 @@ public:
bool Save(const StringView& path = StringView::Empty) override;
///
- /// Determine if the particle emitter has valid shader code present.
+ /// Checks if the particle emitter has valid shader code present.
///
- /// True if particle emitter has shader code, otherwise false.
- API_FUNCTION() bool HasShaderCode();
+ API_PROPERTY() bool HasShaderCode() const;
#endif
protected: