public void Set(float t, GameObject obj) { psef = GetComponent <ParticleSystem>().externalForces; em = GetComponent <ParticleSystem>().emission; psef.RemoveAllInfluences(); psef.AddInfluence(obj.GetComponent <ParticleSystemForceField>()); evokeTime = t; em.rateOverTimeMultiplier = 15F; StartCoroutine(EffectCoroutine()); }
public override object WriteTo(object obj) { obj = base.WriteTo(obj); if (obj == null) { return(null); } ParticleSystem.ExternalForcesModule o = (ParticleSystem.ExternalForcesModule)obj; if (m_influences != null) { for (int i = 0; i < m_influences.Length; ++i) { ParticleSystemForceField forceField = FromID <ParticleSystemForceField>(m_influences[i]); if (forceField != null) { o.AddInfluence(forceField); } } } return(obj); }