Exemplo n.º 1
0
    protected bool IsParticleEmitterOneShot(ParticleEmitter pe)
    {
        NcParticleSystem ps       = pe.GetComponent <NcParticleSystem>();
        bool             bOneShot = (bool)NgSerialized.GetPropertyValue(new SerializedObject(pe as ParticleEmitter), "m_OneShot");

        return(bOneShot && (ps == null || ps.m_bBurst == false));
    }
    protected bool IsParticleEmitterOneShot()
    {
        ParticleEmitter pe = m_Sel.GetComponent <ParticleEmitter>();

        if (pe == null)
        {
            return(false);
        }
        bool bOneShot = (bool)NgSerialized.GetPropertyValue(new SerializedObject(pe as ParticleEmitter), "m_OneShot");

        return(bOneShot && m_Sel.m_bBurst == false);
    }
    protected void ConvertOneShotToFXMakerBurst()
    {
        ParticleEmitter  pe       = m_Sel.GetComponent <ParticleEmitter>();
        ParticleAnimator pa       = m_Sel.GetComponent <ParticleAnimator>();
        bool             bOneShot = (bool)NgSerialized.GetPropertyValue(new SerializedObject(pe as ParticleEmitter), "m_OneShot");

        if (bOneShot && m_Sel.m_bBurst == false)
        {
            m_Sel.m_bBurst              = true;
            m_Sel.m_fBurstRepeatTime    = pe.maxEnergy;
            m_Sel.m_nBurstRepeatCount   = 1;
            m_Sel.m_fBurstEmissionCount = (int)Random.Range(pe.minEmission, pe.maxEmission + 1);

            pe.emit = false;
            NgSerialized.SetPropertyValue(new SerializedObject(pe as ParticleEmitter), "m_OneShot", false, true);
            if (pa != null)
            {
                pa.autodestruct = false;
            }
        }
    }
Exemplo n.º 4
0
 Vector3 GetLocalEulerAnglesHint(Transform trans)
 {
     return((Vector3)NgSerialized.GetPropertyValue(new SerializedObject(trans), "m_LocalEulerAnglesHint"));
 }