本文整理汇总了C#中Level.game_object方法的典型用法代码示例。如果您正苦于以下问题:C# Level.game_object方法的具体用法?C# Level.game_object怎么用?C# Level.game_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level
的用法示例。
在下文中一共展示了Level.game_object方法的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();
}
示例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;
}
示例3: test_xml
void test_xml() {
Level l = new Level();
l.load("indra");
GameObject l_root = l.game_object();
l_root.transform.SetParent(transform);
}