public void Enter(Flow flow) { IDictionary <Vector3, object> newDictionary = new Dictionary <Vector3, object>(); foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { if (item.Key.y < index.GetValue <int>()) { newDictionary.Add(new Vector3(item.Key.x, item.Key.y, item.Key.z), item.Value); } else { if (item.Key.y >= index.GetValue <int>() + rows.GetValue <int>()) { newDictionary.Add(new Vector3(item.Key.x, item.Key.y - rows.GetValue <int>(), item.Key.z), item.Value); } } } newDatabase.cells = newDictionary; newDatabase.rows = databaseIn.GetValue <Database>().rows - rows.GetValue <int>(); newDatabase.columns = databaseIn.GetValue <Database>().columns; newDatabase.depth = databaseIn.GetValue <Database>().depth; Flow _flow = Flow.New(); _flow.Invoke(exit); _flow.Dispose(); }
private object GetCellValue() { IDictionary <Vector3, object> _cells = databaseIn.GetValue <Database>().cells; object _cell = _cells[new Vector3(databaseIn.GetValue <Database>().columns, databaseIn.GetValue <Database>().rows, databaseIn.GetValue <Database>().depth)]; return(_cell); }
public Database ReturnResizedDatabase() { IDictionary <Vector3, object> newDictionary = new Dictionary <Vector3, object>(); Database _databaseIn = databaseIn.GetValue <Database>(); for (int h = 1; h <= depth.GetValue <int>(); h++) { for (int i = 1; i <= column.GetValue <int>(); i++) { for (int j = 1; j <= row.GetValue <int>(); j++) { Vector3 vector = new Vector3(i, j, h); if (_databaseIn.cells.ContainsKey(vector)) { newDictionary.Add(vector, _databaseIn.cells[vector]); } else { newDictionary.Add(new Vector3(i, j, h), null); } } } } newDatabase.cells = newDictionary; newDatabase.rows = row.GetValue <int>(); newDatabase.columns = column.GetValue <int>(); newDatabase.depth = depth.GetValue <int>(); return(newDatabase); }
public IEnumerator Loop() { unscaledtime = Time.unscaledTime; unscaledstartTime = Time.unscaledTime; unscaledTimeElapsed = 0f; unscaledTimeRemaining = delay.GetValue <float>(); realTime = Time.time; realStartTime = Time.time; realTimeElapsed = 0f; realTimeRemaining = delay.GetValue <float>(); if (unscaled.GetValue <bool>()) { while (unscaledTimeElapsed < delay.GetValue <float>()) { unscaledtime = Time.time; unscaledTimeElapsed = unscaledtime - unscaledstartTime; unscaledTimeRemaining = delay.GetValue <float>() - unscaledTimeElapsed; if (!destroyed) { Flow _loop = Flow.New(); _loop.Invoke(loop); _loop.Dispose(); } yield return(null); } } else { while (realTimeElapsed < delay.GetValue <float>()) { realTime = Time.time; realTimeElapsed = realTime - realStartTime; realTimeRemaining = delay.GetValue <float>() - realTimeElapsed; if (!destroyed) { Flow _loop = Flow.New(); _loop.Invoke(loop); _loop.Dispose(); } yield return(null); } } isRunning = false; Flow _exit = Flow.New(); _exit.Invoke(exit); _exit.Dispose(); }
public void Enter(Flow flow) { IDictionary <Vector3, object> newDictionary = new Dictionary <Vector3, object>(); bool after = true; foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { if (item.Key.z < index.GetValue <int>()) { newDictionary.Add(item.Key, item.Value); } else { if (item.Key.z == databaseIn.GetValue <Database>().depth) { after = false; } break; } } for (int h = 1; h <= databaseIn.GetValue <Database>().columns; h++) { for (int i = index.GetValue <int>(); i <= index.GetValue <int>() + depth.GetValue <int>(); i++) { for (int j = 1; j <= databaseIn.GetValue <Database>().rows; j++) { newDictionary.Add(new Vector3(h, j, i), null); } } } if (after) { foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { if (item.Key.z >= index.GetValue <int>()) { newDictionary.Add(new Vector3(item.Key.x, item.Key.y, item.Key.z + depth.GetValue <int>()), item.Value); } } } newDatabase.cells = newDictionary; newDatabase.rows = databaseIn.GetValue <Database>().rows; newDatabase.columns = databaseIn.GetValue <Database>().columns; newDatabase.depth = databaseIn.GetValue <Database>().depth + depth.GetValue <int>(); Flow _flow = Flow.New(); _flow.Invoke(exit); _flow.Dispose(); }
public int ReturnColumnIndex() { int columnIndex = 0; foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { if (item.Value == value.GetValue <object>()) { columnIndex = item.Key.x.ConvertTo <int>(); break; } } return(columnIndex); }
public void Enter(Flow flow) { IDictionary <Vector3, object> ADictionary = new Dictionary <Vector3, object>(); IDictionary <Vector3, object> BDictionary = new Dictionary <Vector3, object>(); int _depth = 0; int _tempDepth = 0; foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { if (item.Key.z < index.GetValue <int>()) { ADictionary.Add(new Vector3(item.Key.x, item.Key.y, item.Key.z), item.Value); } else { if (item.Key.z >= index.GetValue <int>()) { if (_tempDepth != item.Key.z.ConvertTo <int>()) { _tempDepth = item.Key.z.ConvertTo <int>(); _depth++; } BDictionary.Add(new Vector3(item.Key.x, item.Key.y, _depth), item.Value); } } } int BCount = _depth; int ACount = databaseIn.GetValue <Database>().depth - _depth; A.cells = ADictionary; A.depth = ACount; A.columns = databaseIn.GetValue <Database>().columns; A.rows = databaseIn.GetValue <Database>().rows; B.cells = BDictionary; B.depth = BCount; B.columns = databaseIn.GetValue <Database>().columns; B.rows = databaseIn.GetValue <Database>().rows; Flow _flow = Flow.New(); _flow.Invoke(exit); _flow.Dispose(); }
public void Trigger(Flow flow) { Flow _flow = Flow.New(); if (!ascend.GetValue <bool>()) { if (count < controlOutputs.Count - 1) { count++; } else { count = 0; } } else { if (count > 0) { count--; } else { count = controlOutputs.Count - 1; } } _flow.Invoke(controlOutputs["control_" + count]); _flow.Dispose(); }
public void Trigger(Flow flow) { Flow _flow = Flow.New(); if (!ascend.GetValue <bool>()) { if (count < multiValueInputs.Count - 1) { count++; } else { count = 0; } } else { if (count > 0) { count--; } else { count = multiValueInputs.Count - 1; } } _flow.Invoke(exit); _flow.Dispose(); }
private object GetCell() { IDictionary <Vector3, object> _cells = databaseIn.GetValue <Database>().cells; object _cell = _cells[new Vector3(column.GetValue <int>(), row.GetValue <int>(), depth.GetValue <int>())]; return(_cell); }
public override bool Invoke() { var _a = a.GetValue(); var _b = b.GetValue(); return((_a || _b) && (_a != _b)); }
public override void Update() { base.Update(); if (OVRInput.GetUp(Button.GetValue <OVRInput.Button>(), Hand.GetValue <OVRInput.Controller>())) { Trigger(); } }
private void DoInjection(Flow flow) { Object prototype = Prototype.GetValue <Object>(); _output = Context.GetValue <Context>().Container.InstantiatePrefab(prototype, Position.GetValue <Vector3>(), Orientation.GetValue <Quaternion>(), null); flow.Invoke(ExitNode); }
private BinaryVariable GetBinaryVariable() { BinaryVariable _variable = new BinaryVariable(); _variable.name = name.GetValue <string>(); _variable.variable = value.GetValue(type); return(_variable); }
private List <T> GetValue(Recursion recursion) { float squaredRadius = Radius.GetValue <float>() * Radius.GetValue <float>(); Vector3 originPoint = Origin.GetValue <GameObject>().transform.position; T[] objects = Object.FindObjectsOfType <T>(); List <T> radius = new List <T>(objects.Length); for (int i = 0; i < objects.Length; i++) { if ((objects[i].transform.position - originPoint).sqrMagnitude < squaredRadius) { radius.Add(objects[i]); } } return(radius); }
public void Enter(Flow flow) { IDictionary <Vector3, object> newDictionary = new Dictionary <Vector3, object>(); foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { newDictionary.Add(item.Key, null); } newDatabase.cells = newDictionary; newDatabase.rows = databaseIn.GetValue <Database>().rows; newDatabase.columns = databaseIn.GetValue <Database>().columns; newDatabase.depth = databaseIn.GetValue <Database>().depth; Flow _flow = Flow.New(); _flow.Invoke(exit); _flow.Dispose(); }
public void Enter(Flow flow) { IDictionary <Vector3, object> newDictionary = new Dictionary <Vector3, object>(); int _rows = A.GetValue <Database>().rows; int _columns = A.GetValue <Database>().columns; int _depth = A.GetValue <Database>().depth; foreach (KeyValuePair <Vector3, object> item in A.GetValue <Database>().cells) { newDictionary.Add(item.Key, item.Value); } foreach (KeyValuePair <Vector3, object> item in B.GetValue <Database>().cells) { newDictionary.Add(new Vector3(item.Key.x + _columns, item.Key.y, item.Key.z), item.Value); } newDatabase.cells = newDictionary; // newDatabase.rows = A.GetValue<Database>().rows + B.GetValue<Database>().rows; // newDatabase.columns = A.GetValue<Database>().columns; // newDatabase.depth = databaseIn.GetValue<Database>().depth; }
private void Enter(Flow flow) { newDatabase = databaseIn.GetValue <Database>(); if (newDatabase.cells.Keys.Contains(new Vector3(column.GetValue <int>(), row.GetValue <int>(), depth.GetValue <int>()))) { newDatabase.cells[new Vector3(column.GetValue <int>(), row.GetValue <int>(), depth.GetValue <int>())] = value.GetValue <object>(); Flow _flow = Flow.New(); _flow.Invoke(exit); _flow.Dispose(); } else { if (row.GetValue <int>() <= 0 || column.GetValue <int>() <= 0 || depth.GetValue <int>() <= 0) { throw new NullReferenceException("You can't have a 0 row, 0 column, or 0 depth database."); } else { throw new NullReferenceException("Cell in column '" + column.ToString() + "', row '" + row.ToString() + "', depth '" + depth.ToString() + "' does not exist.You do not have enough rows or columns."); } } }
public IList <Vector3> ReturnCells() { IList <Vector3> vectors = new List <Vector3>(); foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { if (item.Value == value.GetValue <object>()) { vectors.Add(item.Key); } } return(vectors); }
public Database ReturnA() { IDictionary <Vector3, object> newDictionary = new Dictionary <Vector3, object>(); foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { newDictionary.Add(item); if (item.Key.x >= columnStartIndex.GetValue <int>() && item.Key.x <= (columnStartIndex.GetValue <int>() + (columns.GetValue <int>() - 1)) && item.Key.y >= rowStartIndex.GetValue <int>() && item.Key.y <= (rowStartIndex.GetValue <int>() + (rows.GetValue <int>() - 1)) && item.Key.z >= depthStartIndex.GetValue <int>() && item.Key.z <= (depthStartIndex.GetValue <int>() + (depth.GetValue <int>() - 1))) { newDictionary[item.Key] = null; } } databaseA.cells = newDictionary; databaseA.rows = databaseIn.GetValue <Database>().rows; databaseA.columns = databaseIn.GetValue <Database>().columns; databaseA.depth = databaseIn.GetValue <Database>().depth; return(databaseA); }
public bool DoesContain() { bool doesContain = false; foreach (KeyValuePair <Vector3, object> item in databaseIn.GetValue <Database>().cells) { if (item.Value == value.GetValue <object>()) { doesContain = true; break; } } return(doesContain); }
public void Update() { UnityEvent e = UnityEvent.GetValue <UnityEvent>(); if (e != _eventCache) { Debug.Log("changing event listener"); if (_eventCache != null) { _eventCache.RemoveListener(Trigger); } _eventCache = e; if (_eventCache != null) { _eventCache.AddListener(Trigger); } } }
public IEnumerator Loop() { while (condition.GetValue <bool>()) { if (!destroyed) { Flow _loop = Flow.New(); _loop.Invoke(loop); _loop.Dispose(); } yield return(null); } isRunning = false; Flow _exit = Flow.New(); _exit.Invoke(exit); _exit.Dispose(); }
private void Enter(Flow flow) { flow.Invoke(trigger); List <object> args = new List <object>(); args.Add(targetPort.GetValue <GameObject>()); args.Add(name.GetValue <string>()); if (!createdHash) { hashId = (new object()).GetHashCode(); createdHash = true; } args.Add(this); foreach (ValueInput input in argumentPorts) { args.Add(input.GetValue <object>()); } GameObjectEvent.Trigger <ReturnEvent>((GameObject)args[0], args.ToArray()); }
private void Enter(Flow flow) { returnUnit.GetValue <TriggerReturnEvent>().returnValue = returnValue.GetValue <object>(); returnUnit.GetValue <TriggerReturnEvent>().InvokeReturn(); }
private void DoInjection(Flow flow) { _output = Object.GetValue <object>(); Context.GetValue <Context>().Container.Inject(_output); flow.Invoke(ExitNode); }
private void StartTween(Flow flow) { GetTween().OnComplete(DoComplete).OnUpdate(DoUpdate).SetEase(Easing.GetValue <Ease>()); flow.Invoke(ImmediateExecute); }
protected override Tweener GetTween() { return(Transform.GetValue <Transform>().DOPunchScale(Value.GetValue <Vector3>(), Duration.GetValue <float>())); }
public override bool Invoke() { return(a.GetValue() || b.GetValue()); }
private Vector3 GetValue(Recursion arg1) { return(VRTK_DeviceFinder.GetControllerAngularVelocity(Controller.GetValue <VRTK_ControllerReference>())); }