[DEV] add particule end detectuin and game element destroy call
This commit is contained in:
parent
9017472639
commit
c5b072f457
@ -287,6 +287,10 @@ namespace ege
|
|||||||
* @param[in] step : step of time in s
|
* @param[in] step : step of time in s
|
||||||
*/
|
*/
|
||||||
virtual void IAAction(float _step) { };
|
virtual void IAAction(float _step) { };
|
||||||
|
/**
|
||||||
|
* @brief, call when the element is removed (call only one time
|
||||||
|
*/
|
||||||
|
virtual void OnDestroy(void) {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -209,6 +209,7 @@ void ege::Environement::RmElementGame(ege::ElementGame* _removeElement)
|
|||||||
// ream remove on the element :
|
// ream remove on the element :
|
||||||
for (int32_t iii=0; iii<m_listElementGame.Size() ; iii++) {
|
for (int32_t iii=0; iii<m_listElementGame.Size() ; iii++) {
|
||||||
if (_removeElement == m_listElementGame[iii]) {
|
if (_removeElement == m_listElementGame[iii]) {
|
||||||
|
m_listElementGame[iii]->OnDestroy();
|
||||||
m_listElementGame[iii]->DynamicDisable();
|
m_listElementGame[iii]->DynamicDisable();
|
||||||
m_listElementGame[iii]->UnInit();
|
m_listElementGame[iii]->UnInit();
|
||||||
delete(m_listElementGame[iii]);
|
delete(m_listElementGame[iii]);
|
||||||
|
@ -26,7 +26,7 @@ namespace ege {
|
|||||||
*/
|
*/
|
||||||
class Particule
|
class Particule
|
||||||
{
|
{
|
||||||
private:
|
protected:
|
||||||
ege::ParticuleEngine& m_particuleEngine;
|
ege::ParticuleEngine& m_particuleEngine;
|
||||||
const char* m_particuleType;
|
const char* m_particuleType;
|
||||||
public:
|
public:
|
||||||
@ -68,6 +68,10 @@ namespace ege {
|
|||||||
* @return Type of the current particule
|
* @return Type of the current particule
|
||||||
*/
|
*/
|
||||||
const char* GetParticuleType(void) { return m_particuleType; };
|
const char* GetParticuleType(void) { return m_particuleType; };
|
||||||
|
/**
|
||||||
|
* @brief When the particule arrive to his end of life, this function is called.
|
||||||
|
*/
|
||||||
|
virtual void OnEnd(void) {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ void ege::ParticuleEngine::Update(float _deltaTime)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (m_particuleList[iii]->NeedRemove()) {
|
if (m_particuleList[iii]->NeedRemove()) {
|
||||||
|
m_particuleList[iii]->OnEnd();
|
||||||
if (m_particuleList[iii]->GetParticuleType()==NULL) {
|
if (m_particuleList[iii]->GetParticuleType()==NULL) {
|
||||||
// Real remove particule ...
|
// Real remove particule ...
|
||||||
delete (m_particuleList[iii]);
|
delete (m_particuleList[iii]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user