当前位置: 首页>>代码示例>>C#>>正文


C# Animation.StopAnimation方法代码示例

本文整理汇总了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();
            }
开发者ID:johnfn,项目名称:Illumination,代码行数:62,代码来源:LightAnimation.cs


注:本文中的Animation.StopAnimation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。