void SetupInvokable() { Invokable equipedInvokable = equipedItem.GetComponent <Invokable> () as Invokable; RegisterInvokableWithFiringController(equipedInvokable); equipedInvokable.RegisterCharacterComponentsWithInvokable(componentData); }
public DataProcessor(IInvokable invoke, INotifiable notify, ILobby lobby) { if(invoke != null) _invokable = new Invokable(invoke); if(notify != null) _notifiable = new Notifiable(notify); if (lobby != null) _lobby = new Lobby(lobby); }
public Timer(Scheduler scheduler, int interval, Invokable fn, int repeat) { _id = ++_idgen; _scheduler = scheduler; _interval = interval; _fn = fn; _repeat = repeat; _enabled = false; }
public void LoadLaunchParameters(CharacterComponentData charData, Vector3 worldLaunch, int facingDirection) { this.componentData = charData; firingInvokable = componentData.GetFiringController().GetEquipedInvokable(); characterTransform = charData.GetCharacterTransform(); worldLaunchVector = worldLaunch; direction = facingDirection; firingTeam = charData.GetCharacterCorpus().GetTeam(); }
private static Invokable GetInvokable(string line) { //Range.SplitToColumns->"A2:A4"p#"," Invokable inv = new Invokable(); inv.method = GetMethod(line); inv.type = GetMyType(line); inv.parameters = GetParams(line); return inv; }
public Timer CreateTimer(int interval, Invokable fn, int repeat) { if (_threadId != Thread.CurrentThread.ManagedThreadId) { throw new Exception("scheduler is only available in main thread"); } var timer = new Timer(this, interval, fn, repeat); timer.enabled = true; return(timer); }
public InvokableItem(Invokable func, float delaySeconds) { this.Func = func; // realtimeSinceStartup is never 0, and Time.time is affected by timescale (though it is 0 on startup). Use a combination // http://forum.unity3d.com/threads/205773-realtimeSinceStartup-is-not-0-in-first-Awake()-call if (Time.time == 0) { this.ExecuteAtTime = delaySeconds; } else { this.ExecuteAtTime = Time.realtimeSinceStartup + delaySeconds; } }
public void Invoke() { if (Invokable == null) { Cache(); } if (m_Dynamic) { InvokableEvent call = Invokable as InvokableEvent; call.Invoke(); } else { Invokable.Invoke(Arguments); } }
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)); }
void RegisterInvokableWithFiringController(Invokable equipedInvocable) { firingController.RegisterInvokable(equipedInvocable); }
/// <summary> /// Invokes the function with a time delay. This is NOT /// affected by timeScale like the Invoke function in Unity. /// </summary> /// <param name='func'> /// Function to invoke /// </param> /// <param name='delaySeconds'> /// Delay in seconds. /// </param> public static void InvokeDelayed(Invokable func, float delaySeconds) { Instance.invokeListPendingAddition.Add(new InvokableItem(func, delaySeconds)); }
public BodyDefinition(Invokable instructions) { //TODO implement Instructions = instructions; }
public void RegisterInvokable(Invokable invocable) { equipedInvokable = invocable; Invoke("CastEquipEffects", 0.05f); cooldownPeriod = invocable.cooldownPeriod; }