InvokeRepeating() public method

public InvokeRepeating ( string methodName, float time, float repeatRate ) : void
methodName string
time float
repeatRate float
return void
コード例 #1
0
        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
0
 public static int InvokeRepeating_wrap(long L)
 {
     try
     {
         long nThisPtr = FCLibHelper.fc_get_inport_obj_ptr(L);
         UnityEngine.MonoBehaviour obj = get_obj(nThisPtr);
         string arg0 = FCLibHelper.fc_get_string_a(L, 0);
         float  arg1 = FCLibHelper.fc_get_float(L, 1);
         float  arg2 = FCLibHelper.fc_get_float(L, 2);
         obj.InvokeRepeating(arg0, arg1, arg2);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
コード例 #3
0
 static public int InvokeRepeating(IntPtr l)
 {
     try {
         UnityEngine.MonoBehaviour self = (UnityEngine.MonoBehaviour)checkSelf(l);
         System.String             a1;
         checkType(l, 2, out a1);
         System.Single a2;
         checkType(l, 3, out a2);
         System.Single a3;
         checkType(l, 4, out a3);
         self.InvokeRepeating(a1, a2, a3);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static int InvokeRepeating(IntPtr L)
    {
        ToLua.CheckArgsCount(L, 4);
        UnityEngine.MonoBehaviour obj = (UnityEngine.MonoBehaviour)ToLua.CheckObject(L, 1, typeof(UnityEngine.MonoBehaviour));
        string arg0 = ToLua.CheckString(L, 2);
        float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
        float  arg2 = (float)LuaDLL.luaL_checknumber(L, 4);

        try
        {
            obj.InvokeRepeating(arg0, arg1, arg2);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }

        return(0);
    }
コード例 #5
0
    static int InvokeRepeating(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.MonoBehaviour.InvokeRepeating");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 4);
            UnityEngine.MonoBehaviour obj = (UnityEngine.MonoBehaviour)ToLua.CheckObject <UnityEngine.MonoBehaviour>(L, 1);
            string arg0 = ToLua.CheckString(L, 2);
            float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
            float  arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
            obj.InvokeRepeating(arg0, arg1, arg2);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #6
0
ファイル: MicIn.cs プロジェクト: miintz/SeeingSoundwaves
    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, f**k off.

        parent.GetComponent<AudioSource>().Play(); //play the audio source!
        parent.InvokeRepeating("PlayAudioSource", 1.0f, 1.0f);
    }
コード例 #7
0
 static public int InvokeRepeating(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.MonoBehaviour self = (UnityEngine.MonoBehaviour)checkSelf(l);
         System.String             a1;
         checkType(l, 2, out a1);
         System.Single a2;
         checkType(l, 3, out a2);
         System.Single a3;
         checkType(l, 4, out a3);
         self.InvokeRepeating(a1, a2, a3);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #8
0
 public static void InvokeRepeating(this MonoBehaviour mono, Task task, float time, float repeatRate)
 {
     mono.InvokeRepeating(task.Method.Name, time, repeatRate);
 }
コード例 #9
0
ファイル: InvokeMethod.cs プロジェクト: RosalieChang/hello
		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);
			}
		}