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


C# SoundManager.PlaySound方法代码示例

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


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

示例1: Start

 // Use this for initialization
 void Start()
 {
     soundManager = GameObject.FindGameObjectWithTag("SoundManager").GetComponent<SoundManager>();
     AudioSource audioSources = GetComponent<AudioSource>();
     soundManager.PlaySound(audioSources);
     timer = Time.time + secondsToLive;
 }
开发者ID:DeeCeptor,项目名称:HandThatFeeds,代码行数:8,代码来源:PistolSoundDie.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     soundManager = GameObject.FindGameObjectWithTag("SoundManager").GetComponent<SoundManager>();
     AudioSource[] audioSources = GetComponents<AudioSource>();
     int randomSound = Random.Range(0, 2);
     soundManager.PlaySound(audioSources[randomSound]);
     timer = Time.time + secondsToLive;
 }
开发者ID:DeeCeptor,项目名称:HandThatFeeds,代码行数:9,代码来源:SoundDieOverTime.cs

示例3: Start

    //
    void Start()
    {
        //Initizalize
        LoadData();
        //Should i destroy the blocks? (Dependes on the int destroyBlock)
        if (destroyBlock >= 5)
        {
            Destroy(block1.gameObject);
        }

        if (destroyBlock >= 10)
        {
            Destroy(block2.gameObject);
        }

        if (destroyBlock >= 15)
        {
            Destroy(block3.gameObject);
            Destroy(survivorBlock.gameObject);
        }

        if (destroyBlock >= 20)
        {
            Destroy(block4.gameObject);
        }

        if (destroyBlock >= 25)
        {
            Destroy(block5.gameObject);
        }

        if (destroyBlock >= 30)
        {
            Destroy(block6.gameObject);
        }

        if (destroyBlock >= 35)
        {
            Destroy(block7.gameObject);
        }

        if (destroyBlock >= 40)
        {
            Destroy(block8.gameObject);
        }
        scoreScreen.SetActiveRecursively(false);
        soundScript = Camera.mainCamera.GetComponent<SoundManager>();
        menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
        soundScript.PlaySound(21, true, 1f);
    }
开发者ID:rainbow23,项目名称:CrasherBalloonGit,代码行数:51,代码来源:ScoreManipulator.cs

示例4: Start

 //
 void Start()
 {
     //Setting Variables
     inStorm = false;
     level = 0;
     soundScript = this.gameObject.GetComponent<SoundManager>();
     soundScript.PlaySound(0, true, 0.1f);
     soundScript.PlaySound(1, true, 0.1f);
     ballonManagerScript = ballonManager.GetComponent<BallonManager>();
     clouds = (GameObject)GameObject.Instantiate(menuDeco);
     clouds.transform.position = cloudsPos.position;
     provisorio = "";
     scoreScript = score.GetComponent<ScoreManipulator>();
 }
开发者ID:rainbow23,项目名称:CrasherBalloonGit,代码行数:15,代码来源:MenuManipulator.cs


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