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


C# AudioManager.SetMusicName方法代码示例

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


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

示例1: Start


//.........这里部分代码省略.........
            leapCanvas = Instantiate(leapCanvasPrefab);

            //Génération de terrain
            float longueurTerrain = vitesseHeros * tempsMusique;

            /*ter = Instantiate( terrain, new Vector3(0,0,0), Quaternion.identity) as GameObject;
            ter.transform.Rotate (0, -90, 0);
            ter.transform.localScale = new Vector3 (longueurTerrain, 1, 1);
            */
            ter = Instantiate (terrain, new Vector3 (-100, -2, 0), Quaternion.identity) as Terrain;
            //ter.terrainData.size = new Vector3 (1.0f, 1.0f, 1.0f);
            //ter.terrainData.size = new Vector3 (200, 200, 1);

            //génération des ennemis
            npcList = new List<GameObject> ();
            //Debug.Log (npcList);

            //List<Thing> ennemies = parser.getEnnemies ();
            List<Item> items = level.ItemList;
            //Debug.Log ("FINAL ITEM LIST COUNT : " + items.Count);

            foreach (Item item in items) {
            GameObject go = null;

            if (item.Type == "basicLancer")
                go = basicLancer;
            else if (item.Type == "fireLancer")
                go = fireLancer;
            else if (item.Type == "iceLancer")
                go = iceLancer;
            else if (item.Type == "basicDragonet")
                go = basicDragonet;
            else if (item.Type == "fireDragonet")
                go = fireDragonet;
            else if (item.Type == "iceDragonet")
                go = iceDragonet;
            else if (item.Type == "wall")
                go = wall;
            else if (item.Type == "cannon")
                go = canon;
            else if (item.Type == "assassin")
                go = assassin;
            else if (item.Type == "life")
                go = lifePotion;
            else if (item.Type == "power")
                go = powerPotion;
            else if (item.Type == "invincibility")
                go = invincibilityPotion;

            if (go != null){
                GameObject instance = Instantiate(go, new Vector3(item.PositionInX, go.transform.localScale.y/2, vitesseHeros*item.PositionInSeconds), Quaternion.identity) as GameObject;
                NPC npc = instance.GetComponent<NPC>();

                if (npc != null)
                    GameModel.NPCsInGame.Add(npc);
                //GameModel.NPCsInGame[GameModel.NPCsInGame.Count-1].transform.Rotate(0, 180, 0);
            }
            }

            //Génération du HUD
            hudMaster = Instantiate (hud).GetComponent<HudMaster>();
            //Debug.Log ("hudMaster : " + hudMaster);
            state = GameState.PLAY;

            Camera.main.transform.parent = heroGameObject.transform;
            Camera.main.transform.position = new Vector3 (0, 2.18f, 0);
            //Camera.main.transform.Translate(new Vector3(0, 2.18f, 0));

            pausedMenu = GameObject.Find("Canvas");
            pausedMenu.SetActive(false);
            paused = false;

            Time.timeScale = 1.0f;

            musicCanvas = Instantiate (musicCanvasPrefab);
            audioManager = musicCanvas.GetComponent<AudioManager> ();

            audioManager.SetMusicName (level.MusicPath);
            audioManager.Init ();

            //If leap is not connected, Pause game and show warning message
            if ( !leapControl.IsConnected())
            {
            //pause()
            audioManager.Pause();
            Time.timeScale = 0.0f;

            GameObject detectedCanvas = GameObject.Find("DetectedLeapCanvas");
            detectedCanvas.GetComponent<Canvas>().enabled = true;
            }

            //Debug.Log ("END Start GameController");

            //ADD TUTORIAL MANAGER

            if (level.Tutorial) {
            GameObject tutoGO = Resources.Load("prefabs/controllers/TutorialManager") as GameObject;
             	Instantiate (tutoGO);
            }
        }
开发者ID:ifgx,项目名称:scripts-spr3,代码行数:101,代码来源:GameController.cs


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