當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。