本文整理汇总了C#中OnValueChangeEventArgs.GetOldValue方法的典型用法代码示例。如果您正苦于以下问题:C# OnValueChangeEventArgs.GetOldValue方法的具体用法?C# OnValueChangeEventArgs.GetOldValue怎么用?C# OnValueChangeEventArgs.GetOldValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OnValueChangeEventArgs
的用法示例。
在下文中一共展示了OnValueChangeEventArgs.GetOldValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnValueChanged
public static void OnValueChanged(object sender, OnValueChangeEventArgs args)
{
var oldOne = args.GetOldValue<KeyBind>().Active;
var newOne = args.GetNewValue<KeyBind>().Active;
if (oldOne == newOne) return;
if (newOne)
{
_effect?.Dispose();
_effect = Members.MyHero.AddParticleEffect("materials/ensage_ui/particles/line.vpcf");
var frontPoint = Members.MyHero.InFront(1200);
_effect.SetControlPoint(1, Members.MyHero.Position);
_effect.SetControlPoint(2, frontPoint);
_effect.SetControlPoint(3, new Vector3(255, 50, 0));
_effect.SetControlPoint(4, new Vector3(255, 255, 255));
}
else
try
{
_tks.Cancel();
_effect?.Dispose();
}
catch (Exception)
{
// ignored
}
}
示例2: OnValueChanged
public static void OnValueChanged(object sender, OnValueChangeEventArgs args)
{
var oldOne = args.GetOldValue<KeyBind>().Active;
var newOne = args.GetNewValue<KeyBind>().Active;
if (oldOne == newOne || newOne) return;
try
{
_tks.Cancel();
_globalTarget = null;
}
catch (Exception)
{
// ignored
}
}
示例3: Hotkey_ValueChanged
// ReSharper disable once InconsistentNaming
private static void Hotkey_ValueChanged(object sender, OnValueChangeEventArgs e)
{
var newVal = e.GetNewValue<KeyBind>().Active;
if (newVal != e.GetOldValue<KeyBind>().Active)
{
// Deactivate script
if (!newVal)
{
pullCreep = null;
}
else
{
// Activate script
var player = ObjectMgr.LocalPlayer;
if (player == null || player.Team == Team.Observer)
return;
switch (player.Team)
{
case Team.Radiant:
startTime = StartTimeRadiant;
attackTime = AttackTimeRadiant;
route = StackRouteRadiant;
break;
case Team.Dire:
startTime = StartTimeDire;
attackTime = AttackTimeDire;
route = StackRouteDire;
break;
default:
e.Process = false;
return;
}
var units = player.Selection.ToList();
pullCreep = (Unit)units.FirstOrDefault(unit => unit is Unit && ((Unit)unit).IsControllable && ((Unit)unit).IsRanged);
if (pullCreep != null)
{
pullCreep.Move(route.Last());
orderState = -1;
}
else e.Process = false;
}
}
}