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


C# MonoBehaviour.InvokeRepeating方法代码示例

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


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

示例1: DoInvokeMethod

        void DoInvokeMethod(GameObject go)
        {
            if (go == null) return;

            component = go.GetComponent(behaviour.Value) as MonoBehaviour;

            if (component == null)
            {
                LogWarning("InvokeMethod: " + go.name + " missing behaviour: " + behaviour.Value);
                return;
            }

            if (repeating.Value)
                component.InvokeRepeating(methodName.Value, delay.Value, repeatDelay.Value);
            else
                component.Invoke(methodName.Value, delay.Value);
        }
开发者ID:CodeStrumpet,项目名称:Elemental,代码行数:17,代码来源:InvokeMethod.cs

示例2: MicIn

    public MicIn(MonoBehaviour _parent, float _sensitivity)
    {
        sensitivity = _sensitivity;
        parent = _parent;
        loudness = 0;

        parent.GetComponent<AudioSource>().clip = Microphone.Start(null, true, 1, 48000);

        parent.GetComponent<AudioSource>().loop = false; // Set the AudioClip to loop
        parent.GetComponent<AudioSource>().mute = false; // Mute the sound, we don't want the player to hear it

        parent.GetComponent<AudioSource>().bypassEffects = true;
        parent.GetComponent<AudioSource>().bypassReverbZones = true; //also important, remmoves reverb so no feedback loops
        parent.GetComponent<AudioSource>().spatialBlend = 0.0f;
        parent.GetComponent<AudioSource>().reverbZoneMix = 0.0f;

        while (!(Microphone.GetPosition(null) > 0)) { } //this seems to fix the latency issue. i know its bad code, fuck off.

        parent.GetComponent<AudioSource>().Play(); //play the audio source!
        parent.InvokeRepeating("PlayAudioSource", 1.0f, 1.0f);
    }
开发者ID:miintz,项目名称:SeeingSoundwaves,代码行数:21,代码来源:MicIn.cs

示例3: DoInvokeMethod

		void DoInvokeMethod(GameObject go)
		{
			if (go == null)
			{
				return;
			}

			component = go.GetComponent(ReflectionUtils.GetGlobalType(behaviour.Value)) as MonoBehaviour;

			if (component == null)
			{
				LogWarning("InvokeMethod: " + go.name + " missing behaviour: " + behaviour.Value);
				return;
			}

			if (repeating.Value)
			{
				component.InvokeRepeating(methodName.Value, delay.Value, repeatDelay.Value);
			}
			else
			{
				component.Invoke(methodName.Value, delay.Value);
			}
		}
开发者ID:RosalieChang,项目名称:hello,代码行数:24,代码来源:InvokeMethod.cs


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