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


C# EventInstance.set3DAttributes方法代码示例

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


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

示例1: Start

	// Use this for initialization
	void Start()
	{
		soundNameMap = new Dictionary<string, string>();
		FillMap("boil", boilSoundNamePrefix, 3);
		FillMap("fry", frySoundNamePrefix, 3);
		FillMap("chop", chopSoundNamePrefix, 3);
		FillMap("bin", binSoundNamePrefix, 3);
		FillMap("footstep", footstepSoundNamePrefix, 6);
		FillMap("pick", pickSoundNamePrefix, 3);

		FillMap("complete", completeSoundName);
		FillMap("dishDone", dishDoneSoundName);
		FillMap("drop", dropSoundName);
		FillMap("lose", loseSoundName);
		FillMap("bell", bellSoundName);

		FillMap("demonTalk", demonTalkSoundName);
		FillMap("ritualSuccess", ritualSuccessSoundName);
		FillMap("ritualFailure", ritualFailureSoundName);
		FillMap("fire", fireSoundName);
		FillMap("smokeAlarm", smokeAlarmSoundName);

		currentSounds = new List<EventInstance>();
		_musicEvent = FMODUnity.RuntimeManager.CreateInstance(musicEventName);
		_musicEvent.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(Camera.allCameras[0].transform.position));
	}
开发者ID:Kazetsukai,项目名称:DiabloCarbonara,代码行数:27,代码来源:MusicMaster.cs

示例2: Update

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.S))
        {
            if (instance != null)
            {
                //instance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
                instance.release();
            }

            instance = FMOD_StudioSystem.instance.GetEvent(path);
            if (instance != null)
            {
                var attributes = FMOD.Studio.UnityUtil.to3DAttributes(position);
                ERRCHECK(instance.set3DAttributes(attributes));
                ERRCHECK(instance.setVolume(volume));
                instance.start();
            }
        }
        if (Input.GetKeyDown(KeyCode.J))
        {
            instance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
            instance.release();
        }
        if (Input.GetKeyDown(KeyCode.L))
        {
            instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
            instance.release();
        }
    }
开发者ID:slb1988,项目名称:FmodDemo,代码行数:32,代码来源:Test.cs

示例3: OnMouseDown

    void OnMouseDown()
    {
        if (playFlag)
        {
            playFlag = false;
            instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
            instance.release();
            instance = null;
        }
        else
        {
            if (instance != null)
            {
                //instance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
                instance.release();
            }

            instance = FMOD_StudioSystem.instance.GetEvent(path);
            if (instance != null)
            {
                var attributes = FMOD.Studio.UnityUtil.to3DAttributes(position);
                ERRCHECK(instance.set3DAttributes(attributes));
                ERRCHECK(instance.setVolume(volume));
                instance.setParameterValue("Surface", SurfaceValue);
                instance.start();
            }

            playFlag = true;
        }
    }
开发者ID:slb1988,项目名称:FmodDemo,代码行数:31,代码来源:Test.cs

示例4: Start

 void Start()
 {
     currentActiveSwitches = 0;
     prevActiveSwitches = 0;
     openPosition = new Vector3(transform.position.x, transform.position.y + raiseHeight, transform.position.z);
     closedPosition = transform.position;
     doorSlideAudio = FMOD_StudioSystem.instance.GetEvent("event:/sfx/environment/puzzlePiece/slidingStoneDoor");
     var attributes = FMOD.Studio.UnityUtil.to3DAttributes(this.transform.position);
     doorSlideAudio.set3DAttributes(attributes);
 }
开发者ID:mightypants,项目名称:apackofalpacas,代码行数:10,代码来源:DoorLift.cs

示例5: Start

        void Start()
        {
            // Set up and start ambience audio
            ambientSoundEvent = FMOD_StudioSystem.instance.GetEvent("event:/ambience/wind");
            var attributes = FMOD.Studio.UnityUtil.to3DAttributes(transform.position);
            ambientSoundEvent.set3DAttributes(attributes);
            ambientSoundEvent.start();

            // Set up reverb zone for the cave area
            caveVerbZone = GameObject.Find("verbZone");
        }
开发者ID:mightypants,项目名称:survival_shooter,代码行数:11,代码来源:AudioManager.cs

示例6: Interaction_PowerBox

    public void Interaction_PowerBox()
    {
        // Check if character is in Interaction Distance
        if (Vector2.Distance(pos_powerBox.position, PlatformerCharacter2D.m_InteractionCheck.position) <= interactionDistance)
        {
            inRange = true;
        //    Debug.Log("Interactable");
        }
        else if (Vector2.Distance(pos_powerBox.position, PlatformerCharacter2D.m_InteractionCheck.position) > interactionDistance)
        {
            inRange = false;
        //    Debug.Log("Not Interactable");
        }
        if (inRange == true && interaction == true && interacted == false && Power.flicker == true)
        {
           // play repair sound
           FMODUnity.RuntimeManager.PlayOneShot("event:/repair", gameObject.transform.position);

           //Event
           interacted = true;
           box_anim.SetBool("powerOn", true);
           Debug.Log("Interacted");

           //Turning On Lanterns
           GameObject lantern1 = GameObject.Find("Night-Environment-Assets-Lantern");
           Power lanternOn1 = (Power)lantern1.GetComponent(typeof(Power));
           lanternOn1.PowerOn(true);
           //2
           GameObject lantern2 = GameObject.Find("Night-Environment-Assets-Lantern (3)");
            Power lanternOn2 = (Power)lantern2.GetComponent(typeof(Power));
           lanternOn2.PowerOn(true);
           //3
           GameObject lantern3 = GameObject.Find("Night-Environment-Assets-Lantern (4)");
            Power lanternOn3 = (Power)lantern3.GetComponent(typeof(Power));
           lanternOn3.PowerOn(true);
           //House
           GameObject house = GameObject.Find("Night-Environment-Assets-House");
           Power houseOn = (Power)house.GetComponent(typeof(Power));
           houseOn.PowerOn(true);
            House house1 = (House)house.GetComponent (typeof(House));
            house1.disableCollision();

            //Tower
            GameObject tower = GameObject.Find("Night-Environment-Assets-Tower");
            Tower towerOn = (Tower)tower.GetComponent (typeof(Tower));
            towerOn.PowerOn (true);

           // play lamp buzz sound
           lampBuzz = FMODUnity.RuntimeManager.CreateInstance("event:/lamp_buzz");
           lampBuzz.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject.transform));
           lampBuzz.start();
        }
    }
开发者ID:BlackhawkAceX,项目名称:GameOn-TheWayHome,代码行数:53,代码来源:PowerBox.cs

示例7: PlayFlute

    IEnumerator PlayFlute(EventInstance fluteAudio)
    {
        // set the position of the sound effect to be the player's position
        var attributes = FMOD.Studio.UnityUtil.to3DAttributes(transform.position);
        fluteAudio.set3DAttributes(attributes);
        fluteAudio.start();

        characterParticles.Play(true);

        float start = Time.time;
        float time = start;

        while (time <= start + 5f)
        {
            // update the position of the sound as the player moves
            attributes = FMOD.Studio.UnityUtil.to3DAttributes(transform.position);
            fluteAudio.set3DAttributes(attributes);

            time += Time.deltaTime;
            yield return null;
        }
    }
开发者ID:mightypants,项目名称:apackofalpacas,代码行数:22,代码来源:PlayerMovement.cs


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