本文整理汇总了C#中Animation.StopAnimation方法的典型用法代码示例。如果您正苦于以下问题:C# Animation.StopAnimation方法的具体用法?C# Animation.StopAnimation怎么用?C# Animation.StopAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation.StopAnimation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoEvent
public override void DoEvent(Animation animation)
{
/* Collision Test */
if (!World.InBound(light.GridLocation.X, light.GridLocation.Y))
{
animation.StopAnimation();
World.RemoveLight(light);
return;
}
HashSet<Entity> entities = World.GetEntities(light.GridLocation.X, light.GridLocation.Y);
foreach (Entity entity in entities)
{
if (entity.Hidden) { continue; }
if (entity is Person)
{
Person thisPerson = (Person)entity;
if ((light.Type == Light.LightType.Yellow) &&
(thisPerson.Profession == Person.ProfessionType.Worker) && !thisPerson.IsEducated)
{
thisPerson.Educate(1);
}
if (light.Type == Light.LightType.White)
{
animation.AddEventFrame(new Reflection(new Point(light.GridLocation.X, light.GridLocation.Y),
thisPerson.ReflectedLightColor, thisPerson.Direction, lastFrameTime), lastFrameTime);
}
else
{
animation.AddEventFrame(new Stop(light), lastFrameTime);
}
}
else if (entity is Building)
{
Building building = (Building)entity;
building.Illuminate(light.Type);
animation.StopAnimation();
World.RemoveLight(light);
}
else if (entity is Mirror)
{
Mirror mirror = (Mirror)entity;
Entity.DirectionType newDirection = mirror.Reflect(light.Direction);
if (newDirection == Entity.DirectionType.NONE)
{
animation.StopAnimation();
World.RemoveLight(light);
}
else
{
light.Direction = newDirection;
}
}
}
Play();
}