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


C# EntityWorld.CreateShip方法代码示例

本文整理汇总了C#中Artemis.EntityWorld.CreateShip方法的典型用法代码示例。如果您正苦于以下问题:C# EntityWorld.CreateShip方法的具体用法?C# EntityWorld.CreateShip怎么用?C# EntityWorld.CreateShip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Artemis.EntityWorld的用法示例。


在下文中一共展示了EntityWorld.CreateShip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Intro

        private IEnumerable Intro(Story story, EntityWorld world)
        {
            var bgGenerator = ServiceLocator.Instance.GetService<SpaceBackgroundGeneratorService>();
            bgGenerator.GenerateBackground(world, 12345);

            var entity = world.CreateStoryOverlay(Properties.Resources.String_ActOne_Intro01);

            yield return Coroutine.WaitFor(TimeSpan.FromSeconds(2));
            entity.FadeGuiElement(TimeSpan.FromSeconds(1.5), 0)
                .OnDone = () => entity.Delete();
            yield return Coroutine.WaitFor(TimeSpan.FromSeconds(2));

            var variant = new ShipVariant
            {
                HullId = "Jormugand",
                TrimDecalColor = Color.Cyan,
                BaseDecalColor = new Color(212, 113, 108),
            };
            _playerEntity = world.CreateShip(variant, new Vector2(500,0),0, physics:true);
            _playerEntity.Tag = "PlayerShip";
            _playerEntity.Refresh();
            var cameraControl = world.SystemManager.GetSystem<Systems.CameraControlSystem>();
            cameraControl.Mode = Systems.CameraMode.FollowEntity;
            cameraControl.FollowedEntity = _playerEntity;

            var test = world.CreateShip("mobius", new Vector2(0, 0), MathHelper.Pi * 1.5f, physics:true);
            test.GetComponent<ShipModelComponent>().BaseDecalColor = Color.Khaki;

            story.State.Fire(Story.Triggers.NextScene);
            yield return null;
        }
开发者ID:raycrasher,项目名称:Fell-Sky,代码行数:31,代码来源:ActOne.cs


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