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


C# GameManager.ChangeState方法代码示例

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


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

示例1: Start

    void Start()
    {
        Camera.mainCamera.GetComponent<Skybox>().material = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<TextureManager>().Material_Skybox_Dungeon;
        _GameManager = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<GameManager>();
        _GameManager.ChangeState("Play");

        // Find information about the dungeon to spawn
        _CurDungeonParameters = _GameManager.CurDungeonParameters;
        _curDungeonLevel = _CurDungeonParameters.level;

        // Find information about the level to spawn
        _mapSizeX = DungeonLevelPool.DungeonLevelList[_curDungeonLevel].SizeX;
        _mapSizeZ = DungeonLevelPool.DungeonLevelList[_curDungeonLevel].SizeY;
        _nbrOfSquareSpawned = DungeonLevelPool.DungeonLevelList[_curDungeonLevel].NbrSquareForSpawn;
        _monsterToSpawn     = DungeonLevelPool.DungeonLevelList[_curDungeonLevel].MonsterList;

        // Initialize Dungeon
        IniDungeon(_mapSizeX, _mapSizeZ);

        // Spawn Dungeon
        _dungeonMap = DungeonGenerator.SpawnDungeon(_mapSizeX,_mapSizeZ,_nbrOfSquareSpawned,_CurDungeonParameters);

        // Initialize P_Pathfinding and Player
        IniPathfindGraph(_mapSizeX, _mapSizeZ);
        IniPlayer(_dungeonMap, _mapSizeX, _mapSizeZ);

        //Spawn all monster for the level
        SpawnAllMonster(_monsterToSpawn, _dungeonMap, _mapSizeX,_mapSizeZ);

        // Finalize the dungeon iniatiliation
        _GameManager.CurZone = DungeonLevelPool.DungeonLevelList[_curDungeonLevel].Name;
        _isDungeonStarted = true;
        GameObject.FindGameObjectWithTag("PlayerMaster").GetComponent<PlayerHUD>().InitializeMap(_dungeonMap, _mapSizeX, _mapSizeZ);
    }
开发者ID:Boerlam001,项目名称:DungeonGrind,代码行数:34,代码来源:DungeonManager.cs

示例2: Start

    //private bool _isGameStarted = false;
    // Use this for initialization
    void Start()
    {
        _GameManager   = GameObject.FindGameObjectWithTag ("GameMaster").GetComponent<GameManager>();
        _GameManager.ChangeState("Menu");

        _Menu_PanelString = "UI Root (2D)/Camera/Anchor/MenuPanel";
        _Menu_Panel = transform.FindChild(_Menu_PanelString).gameObject;
        if(_Menu_Panel == null){Debug.Log ("[MenuManager.Start()] - Can't find MenuPanel");}

        _Button_NewGame = _Menu_Panel.transform.FindChild("Button (New Game)").gameObject;
        if(_Button_NewGame == null){Debug.Log ("[MenuManager.Start()] - Can't find Button(New Game)");}

        _Button_LoadGame = _Menu_Panel.transform.FindChild("Button (Load Game)").gameObject;
        if(_Button_LoadGame == null){Debug.Log ("[MenuManager.Start()] - Can't find Button(Load Game)");}

        _Label_SaveInfo = _Menu_Panel.transform.FindChild("Label (SaveInfo)").gameObject;
        if(_Button_LoadGame == null){Debug.Log ("[MenuManager.Start()] - Can't find Label (SaveInfo)");}

        SaveLoadSystem.TestForSave();
        if(SaveLoadSystem.IsSaveExist) //If save exist
        {
            _Button_LoadGame.transform.FindChild ("Label").GetComponent<UILabel>().text = "Load Game"; // Display the Load Game text
        }
        else
        {
            _Button_LoadGame.transform.FindChild ("Label").GetComponent<UILabel>().text = "[AAAAAA]Save not found. Can't load.[-]"; // Display the No Game found text
        }

        //UIEventListener.Get(_Button_NewGame ).onClick += NewGameDelegate;  // Add the NewGame  Delegate to the New  Game Button
        //UIEventListener.Get(_Button_LoadGame).onClick += LoadGameDelegate; // Add the LoadGame Delegate to the Load Game button

        DisplaySaveInformation();
    }
开发者ID:Boerlam001,项目名称:DungeonGrind,代码行数:35,代码来源:MenuManager.cs


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