// // SubEmitterModule.h // cocos2d_libs // // Created by 徐俊杰 on 2021/7/5. // #ifndef SubEmitterModule_h #define SubEmitterModule_h //#include "cocos2d.h" #include "rparticle/Macros/RParticleMacros.h" #include "rparticle/Modules/ParticleSystemModule.h" NS_RRP_BEGIN class RParticleSystem; struct ParticleSystemParticles; class SubEmitterModule : public ParticleSystemModule { public: enum InheritedProperties { kInheritColor = (1 << 0), kInheritSize = (1 << 1), kInheritRotation = (1 << 2), kInheritLifetime = (1 << 3), kInheritDuration = (1 << 4) }; DECLARE_MODULE (SubEmitterModule) SubEmitterModule(); void CheckConsistency() {}; template void Transfer (TransferFunction& transfer); int GetSubEmitterType() const { return m_SubEmitterType; } void SetSubEmitterType(int value) { m_SubEmitterType = value; } int GetProperties() const { return m_Properties; } //void SetProperties(int value) { m_Properties = value; } bool GetInheritColor() const { return m_Properties & kInheritColor; } void SetInheritColor(bool value) { value ? m_Properties |= kInheritColor : m_Properties &= ~kInheritColor; } bool GetInheritSize() const { return m_Properties & kInheritSize; } void SetInheritSize(bool value) { value ? m_Properties |= kInheritSize : m_Properties &= ~kInheritSize; } bool GetInheritRotation() const { return m_Properties & kInheritRotation; } void SetInheritRotation(bool value) { value ? m_Properties |= kInheritRotation : m_Properties &= ~kInheritRotation; } bool GetInheritLifetime() const { return m_Properties & kInheritLifetime; } void SetInheritLifetime(bool value) { value ? m_Properties |= kInheritLifetime : m_Properties &= ~kInheritLifetime; } bool GetInheritDuration() const { return m_Properties & kInheritDuration; } void SetInheritDuration(bool value) { value ? m_Properties |= kInheritDuration : m_Properties &= ~kInheritDuration; } private: int m_SubEmitterType; //ParticleSystemSubType int m_Properties; }; NS_RRP_END #endif /* SubEmitterModule_h */