本文整理汇总了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);
}
示例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);
}
示例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);
}
}