示例#1
0
 private void OnTick(uint id)
 {
     _handle = 0;
     --_repeat;
     _fn.Invoke();
     if (_repeat != 0 && _enabled)
     {
         _handle = _scheduler.Add(_interval, OnTick);
     }
     else
     {
         _enabled = false;
     }
     // UnityEngine.Debug.LogWarning($"Timer:{name}({_id}) interval:{_interval} OnTick, repeat: {_repeat} enabled: {_enabled}");
 }
示例#2
0
        public void Invoke()
        {
            if (Invokable == null)
            {
                Cache();
            }

            if (m_Dynamic)
            {
                InvokableEvent call = Invokable as InvokableEvent;
                call.Invoke();
            }
            else
            {
                Invokable.Invoke(Arguments);
            }
        }
示例#3
0
        public FObject Invoke(FunctionInvoker fi, FObject[] args)
        {
            var  gotTypes = args.Select(x => x.Type).ToArray();
            bool j        = CallObjectTypes.Contains(gotTypes[0]);

            for (int i = 1; j && i < ArgumentTypes.Count; i++)
            {
                var item = ArgumentTypes[i];
                if (item != FObjectType.Any && item != gotTypes[i])
                {
                    j = false;
                    break;
                }
            }

            if (!j)
            {
                throw new RuntimeException($"Call did not match function signature of function '{Name}'. " +
                                           $"Expected {ArgumentTypes.PrettyArray()}, got {gotTypes.PrettyArray()}.");
            }
            return(Invokable.Invoke(fi, args));
        }