@@ -288,16 +288,15 @@ namespace FlaxEditor.Windows.Assets
|
||||
|
||||
/// <inheritdoc />
|
||||
public SearchAssetTypes AssetType => SearchAssetTypes.ParticleEmitter;
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
base.Update(deltaTime);
|
||||
|
||||
if(_asset == null)
|
||||
if (_asset == null)
|
||||
return;
|
||||
|
||||
_showSourceCodeButton.Enabled = _asset.HasShaderCode();
|
||||
_showSourceCodeButton.Enabled = _asset.HasShaderCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,10 +175,9 @@ public:
|
||||
bool Save(const StringView& path = StringView::Empty) override;
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the particle emitter has valid shader code present.
|
||||
/// Checks if the particle emitter has valid shader code present.
|
||||
/// </summary>
|
||||
/// <returns>True if particle emitter has shader code, otherwise false.</returns>
|
||||
API_FUNCTION() bool HasShaderCode();
|
||||
API_PROPERTY() bool HasShaderCode() const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user