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


C# World.LoadMap方法代码示例

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


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

示例1: CreatePortal

        public static void CreatePortal(Portal portal, World source, bool Custom)
        {
            try
            {
                if (Custom)
                {
                    if (!source.IsLoaded)
                    {
                        source.LoadMap();
                    }
                }
                if (source.Map.Portals == null)
                {
                    source.Map.Portals = new ArrayList();
                }

                lock (source.Map.Portals.SyncRoot)
                {
                    source.Map.Portals.Add(portal);
                }
                if (Custom)
                {
                    if (source.IsLoaded)
                    {
                        source.UnloadMap(true);
                    }
                }
            }
            catch (Exception e)
            {
                Logger.Log(LogType.Error, "PortalCreation: " + e);
            }
        }
开发者ID:venofox,项目名称:AtomicCraft,代码行数:33,代码来源:PortalHandler.cs

示例2: Start

    // Use this for initialization
    void Start()
    {
        FutileParams futileParams = new FutileParams(true, false, false, false);
        futileParams.AddResolutionLevel(640.0f / 4f, 1.0f, 1.0f, "");

        futileParams.origin = new Vector2(0.5f, 0.5f);
        futileParams.backgroundColor = new Color(0 / 255.0f, 94 / 255.0f, 38 / 255.0f);
        futileParams.shouldLerpToNearestResolutionLevel = true;

        Futile.instance.Init(futileParams);

        //        UnityEngine.Screen.SetResolution(640, 480, false);

        Futile.atlasManager.LoadAtlas("Atlases/inGameAtlas");
        Futile.atlasManager.LoadFont(C.smallFontName, "smallFont_0", "Atlases/smallFont", 0, 0);
        Futile.atlasManager.LoadFont(C.largeFontName, "largeFont_0", "Atlases/largeFont", 0, 0);

        FSoundManager.PlayMusic("OGreatBG");
        C.getCameraInstance().SetPosition(Futile.screen.halfWidth, -Futile.screen.halfHeight);

        FSprite bevelOverlay = new FSprite(Futile.whiteElement);
        bevelOverlay.width = Futile.screen.width;
        bevelOverlay.height = Futile.screen.height;
        bevelOverlay.shader = FShader.Basic_PixelSnap;
        bevelOverlay.sortZ = 100;
        w = new World();
        Futile.stage.AddChild(w);
        twitter = new FLabel(C.smallFontName, "@MaggardJosh");
        twitter.x = Futile.screen.halfWidth - twitter.textRect.width / 2f;
        twitter.y = -Futile.screen.halfHeight + twitter.textRect.height / 2f;
        C.getCameraInstance().AddChild(twitter);

        madeForLD = new FLabel(C.smallFontName, "Made in 48 hours\nfor Ludum Dare 33");
        madeForLD.alignment = FLabelAlignment.Left;
        madeForLD.x = -Futile.screen.halfWidth;
        madeForLD.y = -Futile.screen.halfHeight + madeForLD.textRect.height / 2f;
        C.getCameraInstance().AddChild(madeForLD);

        w.LoadMap("titleMap");
        w.currentState = World.State.IN_GAME;

        w.UpdateWorldBounds();

        Futile.stage.AddChild(C.getCameraInstance());
        C.getCameraInstance().SetPosition(w.p.GetPosition());
        C.getCameraInstance().AddChild(bevelOverlay);

        w.p.CurrentState = Player.State.DYING;
        tempFollowNode = new FNode();
        tempFollowNode.SetPosition(w.p.GetPosition());
        C.getCameraInstance().follow(tempFollowNode);
        StartRandomMapMovement();
        w.ui.isVisible = false;
        w.p.SetPosition(-1000, 1000);
        pressStart = new FLabel(C.smallFontName, "CLICK TO START");
        C.getCameraInstance().AddChild(pressStart);
        pressStart.y = -Futile.screen.halfHeight * .3f;
        pressStart.alpha = 0;
        o = new FLabel(C.largeFontName, "O");
        o.alignment = FLabelAlignment.Left;
        g = new FLabel(C.largeFontName, "G");
        r = new FLabel(C.largeFontName, "R");
        e = new FLabel(C.largeFontName, "E");
        g.alignment = FLabelAlignment.Left;
        r.alignment = FLabelAlignment.Left;
        e.alignment = FLabelAlignment.Left;
        a = new FLabel(C.largeFontName, "A");
        a.alignment = FLabelAlignment.Left;
        t = new FLabel(C.largeFontName, "T");
        t.alignment = FLabelAlignment.Left;
        ogreatContainer = new FContainer();
        ogreatContainer.AddChild(o);
        ogreatContainer.AddChild(g);
        ogreatContainer.AddChild(r);
        ogreatContainer.AddChild(e);
        ogreatContainer.AddChild(a);
        ogreatContainer.AddChild(a);
        ogreatContainer.AddChild(t);
        C.getCameraInstance().AddChild(ogreatContainer);

        e.x = -e.textRect.width / 2f;
        r.x = e.x - r.textRect.width;
        g.x = r.x - g.textRect.width;
        o.x = g.x - o.textRect.width - 10;
        a.x = e.x + e.textRect.width;
        t.x = a.x + a.textRect.width;

        ogreatContainer.y = Futile.screen.height * .3f;
        ogreatContainer.x = 10;
        float duration = 2.0f;
        float initDuration = .8f;
        Color greenColor = new Color(0, .3f, 0);

        o.y = g.y = r.y = e.y = a.y = t.y = Futile.screen.halfHeight;

        Go.to(o, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.5f).setEaseType(EaseType.BackOut));
        Go.to(g, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.6f).setEaseType(EaseType.BackOut));
        Go.to(r, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.7f).setEaseType(EaseType.BackOut));
        Go.to(e, initDuration, new TweenConfig().floatProp("y", 0).setDelay(.8f).setEaseType(EaseType.BackOut));
//.........这里部分代码省略.........
开发者ID:maggardJosh,项目名称:OGREAT,代码行数:101,代码来源:GameScript.cs

示例3: Update

    public void Update()
    {
        if(isTransIn)
        count += Time.deltaTime;
        if (C.getKeyDown(C.JUMP_KEY))
        {
            World world = new World();

            world.ShowLoading(() =>
            {
                C.getCameraInstance().AddChild(world.ui);
                world.loadingBG.MoveToFront();
                Futile.stage.AddChild(world);

                C.getCameraInstance().MoveToFront();
                world.LoadMap(C.Save.lastMap);
                world.SpawnPlayer(C.Save.lastDoor);

                this.RemoveFromContainer();
            }, ()=> {
                world.ui.dialogue.ShowMessage(new List<string> { "WASD - Move", "L - Interact", "... Seems simple enough" });
            });
            Futile.instance.SignalUpdate -= Update;
        }
        this.play.isVisible = (count * 1500 % 2000 < 1500 );
    }
开发者ID:maggardJosh,项目名称:SpiritGuard,代码行数:26,代码来源:Title.cs


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