本文整理汇总了C#中ParticleEffect.SetControlPointEntity方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleEffect.SetControlPointEntity方法的具体用法?C# ParticleEffect.SetControlPointEntity怎么用?C# ParticleEffect.SetControlPointEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEffect
的用法示例。
在下文中一共展示了ParticleEffect.SetControlPointEntity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawForAllyHero
private static void DrawForAllyHero()
{
foreach (var v in Ensage.Common.Objects.Heroes.GetByTeam(MeHero.Team))
{
var pos = GetTopPanelPosition(v) +
new Vector2(Menu.Item("BarPosX").GetValue<Slider>().Value,
Menu.Item("BarPosY").GetValue<Slider>().Value);
var size = GetTopPalenSize(v) + new Vector2(0, Menu.Item("BarSizeY").GetValue<Slider>().Value);
const int height = 7;
if (Menu.Item("EnemyStatus.Vision.Enable").GetValue<bool>() && v.IsVisibleToEnemies)
{
Drawing.DrawRect(pos + new Vector2(0, size.Y + height * 2), new Vector2(size.X, height * 2),
new Color(0, 0, 0, 100));
Drawing.DrawRect(pos + new Vector2(0, size.Y + height * 2), new Vector2(size.X, height * 2),
new Color(0, 0, 0, 255), true);
Drawing.DrawText("under vision", pos + new Vector2(5, size.Y + height * 2), Color.White,
FontFlags.AntiAlias | FontFlags.DropShadow);
}
if (Menu.Item("showMeMore.Enable").GetValue<bool>())
{
var mod = v.Modifiers.Any(x => x.Name == "modifier_spirit_breaker_charge_of_darkness_vision");
if (mod)
{
var textPos = pos + new Vector2(0, size.Y + height*4);
Drawing.DrawText("Spirit Breaker", textPos, new Vector2(15, 150), Color.White,
FontFlags.AntiAlias | FontFlags.DropShadow);
if (Equals(MeHero, v))
{
const string name = "modifier_spirit_breaker_charge_of_darkness_vision";
Drawing.DrawRect(new Vector2(0, 0), new Vector2(Drawing.Width, Drawing.Height),
new Color(Menu.Item(name + ".Red").GetValue<Slider>().Value,
Menu.Item(name + ".Green").GetValue<Slider>().Value,
Menu.Item(name + ".Blue").GetValue<Slider>().Value,
Menu.Item(name + ".Alpha").GetValue<Slider>().Value));
}
ParticleEffect eff;
if (!BaraIndicator.TryGetValue(v, out eff))
{
eff = new ParticleEffect("", v);
eff.SetControlPointEntity(1, v);
BaraIndicator.Add(v, eff);
GenerateSideMessage(v.Name.Replace("npc_dota_hero_", ""),
"spirit_breaker_charge_of_darkness");
}
}
else
{
ParticleEffect eff;
if (BaraIndicator.TryGetValue(v, out eff))
{
eff.Dispose();
BaraIndicator.Remove(v);
}
}
}
}
}
示例2: Drawing_OnDraw
//.........这里部分代码省略.........
}
catch (Exception)
{
}
}
#endregion
}
#endregion
#region ShowMeMore
if (_showMeMore)
{
var mod = v.Hero.Modifiers.Any(x => x.Name == "modifier_spirit_breaker_charge_of_darkness_vision");
if (mod /* && Bara!=null*/)
{
var textPos = (pos + new Vector2(0, sizeY + height*3));
Drawing.DrawText("Spirit Breaker", textPos, new Vector2(15, 150), Color.White,
FontFlags.AntiAlias | FontFlags.DropShadow);
if (Equals(_me, v.Hero))
{
Drawing.DrawRect(new Vector2(0, 0), new Vector2(Drawing.Width, Drawing.Height),
new Color(255, 0, 0, 2));
}
ParticleEffect eff;
if (!BaraIndicator.TryGetValue(v.Hero, out eff))
{
//"particles/hw_fx/cursed_rapier.vpcf"
eff = new ParticleEffect("", v.Hero);
eff.SetControlPointEntity(1, v.Hero);
BaraIndicator.Add(v.Hero, eff);
GenerateSideMessage(v.Hero.Name.Replace("npc_dota_hero_", ""), "spirit_breaker_charge_of_darkness");
}
}
else
{
ParticleEffect eff;
if (BaraIndicator.TryGetValue(v.Hero, out eff))
{
eff.Dispose();
BaraIndicator.Remove(v.Hero);
}
}
}
if (_showMeMore && v.Hero.Team != _me.Team)
{
switch (v.Hero.ClassID)
{
case ClassID.CDOTA_Unit_Hero_Mirana:
if (_arrowUnit == null)
{
/*foreach (var effect in ArrowParticalEffects)
{
effect.Dispose();
}
ArrowParticalEffects[1] = null;*/
_arrowUnit =
ObjectMgr.GetEntities<Unit>()
.FirstOrDefault(x => x.ClassID == ClassID.CDOTA_BaseNPC && x.DayVision == 650
示例3: DrawShowMeMoreBara
private static void DrawShowMeMoreBara(Hero v, Vector2 pos, Vector2 size, int height = 7)
{
if (!Menu.Item("showMeMore.Enable").GetValue<bool>()) return;
var mod = v.HasModifier("modifier_spirit_breaker_charge_of_darkness_vision");
if (mod)
{
var textPos = pos + new Vector2(0, size.Y + height*4);
Drawing.DrawText("Spirit Breaker", textPos, new Vector2(15, 150), Color.White,
FontFlags.AntiAlias | FontFlags.DropShadow);
if (Equals(MeHero, v))
{
const string name = "modifier_spirit_breaker_charge_of_darkness_vision";
Drawing.DrawRect(new Vector2(0, 0), new Vector2(Drawing.Width, Drawing.Height),
new Color(Menu.Item(name + ".Red").GetValue<Slider>().Value,
Menu.Item(name + ".Green").GetValue<Slider>().Value,
Menu.Item(name + ".Blue").GetValue<Slider>().Value,
Menu.Item(name + ".Alpha").GetValue<Slider>().Value));
}
ParticleEffect eff;
if (BaraIndicator.TryGetValue(v, out eff)) return;
eff = new ParticleEffect("", v);
eff.SetControlPointEntity(1, v);
BaraIndicator.Add(v, eff);
GenerateSideMessage(v.Name.Replace("npc_dota_hero_", ""),
"spirit_breaker_charge_of_darkness");
}
else
{
ParticleEffect eff;
if (!BaraIndicator.TryGetValue(v, out eff)) return;
eff.Dispose();
BaraIndicator.Remove(v);
}
}
示例4: Drawing_OnDraw
private static void Drawing_OnDraw(EventArgs args)
{
if (!Game.IsInGame || _me == null || !_loaded || Game.IsPaused) return;
/*if (_players == null || _players.Count() < 10)
{
_players = ObjectMgr.GetEntities<Player>().Where(x => x != null && x.Hero != null && x.Hero.IsAlive);
}
var enumerable = _players as Player[] ?? _players.ToArray();*/
//foreach (var s in enumerable)
for (uint i = 0; i < 10; i++)
{
Hero v;
try{v = ObjectMgr.GetPlayerById(i).Hero;}catch{continue;}
if (v==null) continue;
var pos = HUDInfo.GetTopPanelPosition(v);
var sizeX = (float)HUDInfo.GetTopPanelSizeX(v);
var sizeY = (float)HUDInfo.GetTopPanelSizeY(v);
var healthDelta = new Vector2(v.Health * sizeX / v.MaximumHealth, 0);
var manaDelta = new Vector2(v.Mana * sizeX / v.MaximumMana, 0);
const int height = 7;
//Drawing.DrawRect(pos,pos+new Vector2(sizeX,sizeY),new Color(0,0,100,100));
Drawing.DrawRect(pos + new Vector2(0, sizeY+1), new Vector2(sizeX, height), new Color(255, 0, 0, 255));
Drawing.DrawRect(pos + new Vector2(0, sizeY+1), new Vector2(healthDelta.X, height), new Color(0, 255, 0, 255));
Drawing.DrawRect(pos + new Vector2(0, sizeY+1), new Vector2(sizeX, height), Color.Black, true);
/*var text= string.Format("{0} / {1}", (int)v.Health, (int)v.MaximumHealth);
var textSize = Drawing.MeasureText(text, "Arial", new Vector2(sizeY, sizeX), FontFlags.AntiAlias);
var textPos = pos + new Vector2(0, sizeY + 1) + new Vector2(sizeX/2 - textSize.X/2, -textSize.Y + 2);
Drawing.DrawText(
text,
textPos,
new Vector2(sizeY, sizeX),
Color.White,
FontFlags.AntiAlias | FontFlags.DropShadow);*/
Drawing.DrawRect(pos + new Vector2(0, sizeY + height), new Vector2(sizeX, height), Color.Gray);
Drawing.DrawRect(pos + new Vector2(0, sizeY + height), new Vector2(manaDelta.X, height), new Color(0, 0, 255, 255));
Drawing.DrawRect(pos + new Vector2(0, sizeY + height), new Vector2(sizeX, height), Color.Black, true);
if (v.Team == _me.Team)
{
var mod = v.Modifiers.Any(x => x.Name == "modifier_spirit_breaker_charge_of_darkness_vision");
if (mod /* && Bara!=null*/)
{
/*Vector2 vPos;
if (Drawing.WorldToScreen(v.Position, out vPos))
{
Vector2 targetPos;
if (Drawing.WorldToScreen(Bara.Position, out targetPos))
{
Drawing.DrawLine(vPos,targetPos,Color.AliceBlue);
}
}
var dist = Bara.Distance2D(v);
var startDist = v.Distance2D(BaraStartPos);
var spellDelta =
new Vector2(
dist * sizeX / startDist, 0);
Drawing.DrawRect(pos + new Vector2(0, sizeY + height * 2), new Vector2(sizeX, height), Color.Gray);
Drawing.DrawRect(pos + new Vector2(0, sizeY + height * 2), new Vector2(spellDelta.X, height), Color.Yellow);
Drawing.DrawRect(pos + new Vector2(0, sizeY + height * 2), new Vector2(sizeX, height), Color.Black, true);*/
var textPos = (pos + new Vector2(0, sizeY + height*2));
Drawing.DrawText("Spirit Breaker", textPos, new Vector2(15, 150), Color.White,
FontFlags.AntiAlias | FontFlags.DropShadow);
if (Equals(_me, v))
{
Drawing.DrawRect(new Vector2(0, 0), new Vector2(Drawing.Width, Drawing.Height),
new Color(255, 0, 0, 2));
}
ParticleEffect eff;
if (!BaraIndicator.TryGetValue(v, out eff))
{
eff = new ParticleEffect("particles/items2_fx/ward_true_sight.vpcf", v);
eff.SetControlPointEntity(1,v);
BaraIndicator.Add(v,eff);
}
}
else
{
ParticleEffect eff;
if (BaraIndicator.TryGetValue(v, out eff))
{
eff.Dispose();
BaraIndicator.Remove(v);
}
}
}
#region ShowMeMore
if (ShowMeMore && v.Team != _me.Team)
{
switch (v.ClassID)
{
case ClassID.CDOTA_Unit_Hero_Mirana:
/*var arrow =
ObjectMgr.GetEntities<Unit>()
.FirstOrDefault(x => x.ClassID == ClassID.CDOTA_BaseNPC && x.DayVision == 650
/* && x.Team!=_me.Team);
if (arrow != null)
//.........这里部分代码省略.........