當前位置: 首頁>>代碼示例>>C#>>正文


C# AudioManager.Init方法代碼示例

本文整理匯總了C#中AudioManager.Init方法的典型用法代碼示例。如果您正苦於以下問題:C# AudioManager.Init方法的具體用法?C# AudioManager.Init怎麽用?C# AudioManager.Init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AudioManager的用法示例。


在下文中一共展示了AudioManager.Init方法的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.Init方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。