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


C# Level.load方法代码示例

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


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

示例1: Update

    /// <summary>
    /// Update is called once per frame
    /// </summary>
    void Update()
    {
        if (!IsActive)
        {
            return;
        }

        Debug.Log("Level: " + Application.loadedLevelName + "\n MyCharacterx: " + MyCharacter);
        if (MyCharacter == null || Application.loadedLevelName == MainMenuScene)
        {
            return;
        }

        if (SceneInformation == null)
        {
            LoadSceneInfo();
            GameLevel = new Level();
            GameLevel.load(GameLevelFile);
            GameObject level_object = GameLevel.game_object();
            level_object.transform.parent = SceneInformation.transform;
        }



        if (CharactersToInstantiate.Count > 0)
        {
            foreach (var character in CharactersToInstantiate)
            {
                InstantiateSceneCharacter(character);
            }

            CharactersToInstantiate.Clear();
        }

        if (MyPlayer == null && SceneCharacters != null && SceneCharacters.ContainsKey(MyCharacter.Id))
        {
            MyPlayer = SceneCharacters[MyCharacter.Id];
            MyPlayer.Client = this;
            MyPlayer.BaseCharacter = MyCharacter;
            MyPlayer.tag = "Player";
            //MyPlayer.BaseCharacter.Color = MyColor;
            //MyPlayer.recolor();
        }

        if (CurrentGameState != GameStates.LevelLoaded ||
            MyPlayer == null)
        {
            return;
        }

        InterpolateCharacters();
        UpdateControls();
        MovePlayer();
        UpdateCamera();
        UpdateCombatControls();
        ValidateMyPosition();
    }
开发者ID:assertivist,项目名称:vastan-unity,代码行数:60,代码来源:GameClient.cs

示例2: CreateObjects

    /// <summary>
    /// Creates the objects.
    /// </summary>
    private void CreateObjects()
    {
        LoadSceneInfo();

        if (SceneInformation == null)
        {
            // Scene is not loaded yet, wait for next round
            return;
        }

        Debug.Log("Time to create world objects");

        //TODO: REmove? Position the camera
        GameObject mainCamera = GameObject.FindGameObjectWithTag( "MainCamera" );
		Vector3 pos = new Vector3(20, 20, 20);
		pos.y += 25;
		mainCamera.transform.position = pos;
        mainCamera.transform.LookAt(Vector3.zero);

        GameLevel = new Level();
        GameLevel.load(GameLevelName);
        GameObject level_object = GameLevel.game_object();
        level_object.transform.parent = SceneInformation.transform;

        Debug.Log("Me: " + GetComponent<NetworkView>().owner.guid);

        // 4: Create a character for each player
        foreach (Player player in Players.Values)
        {
            Debug.Log("Creating character " + player.BaseCharacter.CharName + " for player: " + player.Id);
            InstantiatePlayer(player);
        }

        Debug.Log("Level: " + Application.loadedLevelName);

        // 5: Create an AI to attack the players
        InstantiateAI();

        // 6A: Set the state to loaded so we know we can start updating the game normally
        CurrentGameState = Game.GameStates.LevelLoaded;
    }
开发者ID:assertivist,项目名称:vastan-unity,代码行数:44,代码来源:GameServer.cs

示例3: test_xml

 void test_xml() {
     Level l = new Level();
     l.load("indra");
     GameObject l_root = l.game_object();
     l_root.transform.SetParent(transform);
 }
开发者ID:assertivist,项目名称:vastan-unity,代码行数:6,代码来源:GeomTest.cs


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