Ejemplo n.º 1
0
        private static void GenerateDefaultSnapshot()
        {
            var snapshotEntities = new Dictionary <EntityId, Entity>();
            var currentEntityId  = 1;

            snapshotEntities.Add(new EntityId(currentEntityId++), EntityTemplateFactory.CreatePlayerCreatorTemplate());

            string helpNotice = "Arrow Keys: Movement\nSpace: Jump\nHold Shift: Swing Sword";

            snapshotEntities.Add(
                new EntityId(currentEntityId++),
                EntityTemplateFactory.CreateNoticeTemplate(helpNotice, new Improbable.Coordinates(0, 1f, 0)));

            SaveSnapshot(snapshotEntities);
        }
        private void Create(CreateNoticeData args)
        {
            var noticeTemplate = EntityTemplateFactory.CreateNoticeTemplate(args.text, args.initialPosition);

            SpatialOS.Commands.CreateEntity(PositionWriter, noticeTemplate);
        }