private void SetColor_REFLECTION(ParticleSystem ps, string propertyName, object color) { if (this.startColorType == null) { var field = ps.GetType().GetProperty("InitialModule", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.GetProperty); if (field == null) return; var module = field.GetValue(null, null); var startColor = module.GetType().GetField("startColor").GetValue(null); this.startColorType = startColor.GetType(); } this.startColorType.GetField(propertyName).SetValue(null, color); }