Add dev-only name to spawned Particle System
This commit is contained in:
@@ -39,6 +39,9 @@ void ParticleSystem::Init(ParticleEmitter* emitter, float duration, float fps)
|
|||||||
track.AsEmitter.Index = 0;
|
track.AsEmitter.Index = 0;
|
||||||
track.AsEmitter.StartFrame = 0;
|
track.AsEmitter.StartFrame = 0;
|
||||||
track.AsEmitter.DurationFrames = DurationFrames;
|
track.AsEmitter.DurationFrames = DurationFrames;
|
||||||
|
#if !BUILD_RELEASE
|
||||||
|
_debugName = StringUtils::GetFileNameWithoutExtension(emitter->GetPath());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +158,9 @@ ParticleEffect* ParticleSystem::Spawn(Actor* parent, const Transform& transform,
|
|||||||
auto effect = New<ParticleEffect>();
|
auto effect = New<ParticleEffect>();
|
||||||
effect->SetTransform(transform);
|
effect->SetTransform(transform);
|
||||||
effect->ParticleSystem = this;
|
effect->ParticleSystem = this;
|
||||||
|
#if !BUILD_RELEASE
|
||||||
|
effect->SetName(_debugName); // Give usable name in development builds
|
||||||
|
#endif
|
||||||
|
|
||||||
Level::SpawnActor(effect, parent);
|
Level::SpawnActor(effect, parent);
|
||||||
|
|
||||||
@@ -452,6 +458,9 @@ Asset::LoadResult ParticleSystem::load()
|
|||||||
return LoadResult::InvalidData;
|
return LoadResult::InvalidData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !BUILD_RELEASE
|
||||||
|
_debugName = StringUtils::GetFileNameWithoutExtension(GetPath());
|
||||||
|
#endif
|
||||||
return LoadResult::Ok;
|
return LoadResult::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,6 +472,9 @@ void ParticleSystem::unload(bool isReloading)
|
|||||||
Emitters.Resize(0);
|
Emitters.Resize(0);
|
||||||
EmittersParametersOverrides.SetCapacity(0);
|
EmittersParametersOverrides.SetCapacity(0);
|
||||||
Tracks.Resize(0);
|
Tracks.Resize(0);
|
||||||
|
#if !BUILD_RELEASE
|
||||||
|
_debugName.Clear();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetChunksFlag ParticleSystem::getChunksToPreload() const
|
AssetChunksFlag ParticleSystem::getChunksToPreload() const
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ public:
|
|||||||
|
|
||||||
typedef Pair<int32, Guid> EmitterParameterOverrideKey;
|
typedef Pair<int32, Guid> EmitterParameterOverrideKey;
|
||||||
|
|
||||||
|
private:
|
||||||
|
#if !BUILD_RELEASE
|
||||||
|
String _debugName;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The asset data version number. Used to sync the data with the instances state. Incremented each time asset gets loaded.
|
/// The asset data version number. Used to sync the data with the instances state. Incremented each time asset gets loaded.
|
||||||
|
|||||||
Reference in New Issue
Block a user