/// <summary> /// 创建自机子弹的击中特效 /// </summary> /// <param name="effectParas">击中特效配置参数</param> protected virtual void CreateHitEffect(PlayerBulletHitEffectParas effectParas) { STGSpriteEffect effect = EffectsManager.GetInstance().CreateEffectByType(EffectType.SpriteEffect) as STGSpriteEffect; effect.SetSprite(effectParas.atlasName, effectParas.spriteName, effectParas.blendMode, effectParas.layerId, true); List <float[]> parasList = effectParas.effectParasList; int listCount = parasList.Count; for (int i = 0; i < listCount; i++) { SetSpriteEffectParas(effect, parasList[i]); } }
public void parse(XmlElement xmlElement) { id = xmlElement.GetAttribute("id"); packName = xmlElement.GetAttribute("packName"); textureName = xmlElement.GetAttribute("texName"); isRotatedByVAngle = int.Parse(xmlElement.GetAttribute("isRotatedByVAngle")) == 1 ? true : false; selfRotationAngle = float.Parse(xmlElement.GetAttribute("selfRotationAngle")); collisionRadius = float.Parse(xmlElement.GetAttribute("collisionRadius")); string str = xmlElement.GetAttribute("eliminateSprite"); if (str != null && str != "") { string[] eliminateStrs = xmlElement.GetAttribute("eliminateSprite").Split(','); eliminateEffectAtlas = eliminateStrs[0]; elminaateEffectSprite = eliminateStrs[1]; string[] colorStrs = (xmlElement.GetAttribute("eliminateColor")).Split(','); eliminateColor = new Color(float.Parse(colorStrs[0]), float.Parse(colorStrs[1]), float.Parse(colorStrs[2])); } eliminatedEffectType = int.Parse(xmlElement.GetAttribute("eliminatedEffectType")); hitEffectParas = new PlayerBulletHitEffectParas(); hitEffectParas.Init(xmlElement.GetAttribute("hitEffectParas")); }