public override void OnEnter() { result.Reset(); //convert FsmString[] to string[] string[] strArr = new string[searchBy.Length]; for (int i = 0; i < searchBy.Length; i++) { strArr[i] = searchBy[i].Value; } List <string> matchingValues = GDEHelpers.FindAllMatching(dataType, searchType, strArr, "", false); if (matchingValues.Count == 0) { Fsm.Event(noneFoundEvent); } else { result.SetArrayContents(matchingValues); } Finish(); }
public override void OnEnter() { if (reset.Value) { reset.Value = false; nextItemIndex = 0; } gdeData = GDEHelpers.GDEGetAllDataBy(GDEDataType.Item, schema.Value); if (nextItemIndex == 0) { if (gdeData.Count == 0) { Fsm.Event(failureEvent); Finish(); } if (startIndex.Value > 0) { nextItemIndex = startIndex.Value; } } DoGetNextItem(); Finish(); }
public override void OnEnter() { if (!everyFrame) { Finish(); } previousValue = GDEHelpers.GetFieldValue(itemName.Value, fieldName.Value); }
public override void OnEnter() { GDEHelpers.GDEOperator(ItemName.Value, FieldName.Value, GDEFieldType.Vector2, operation, value.Value); if (save.Value) { GDEHelpers.Save(); } Finish(); }
public override void OnEnter() { storeBoolResult.Value = GDEHelpers.BoolFlip(itemName.Value, fieldName.Value); if (save.Value) { GDEHelpers.Save(); } Finish(); }
public override void OnEnter() { if (GDEHelpers.RemoveItem(itemName.Value, save.Value, false)) { Fsm.Event(success); } else { Fsm.Event(failure); } Finish(); }
public override void OnEnter() { List <object> fieldValueList = new List <object>(); result.Value = GDEHelpers.GetItemWithMatchingValues(schema.Value, fieldNames.ToList(), fieldValues.ToList(), ignoreValues.ToList()); if (string.IsNullOrEmpty(result.Value)) { Fsm.Event(noneFoundEvent); } Finish(); }
public override void OnEnter() { GDEHelpers.GDEOperator(ItemName.Value, FieldName.Value, GDEFieldType.Int, operation, value.Value); if (!storeResult.IsNone) { storeResult.Value = (int)GDEHelpers.GetFieldValue(ItemName.Value, FieldName.Value); } if (save.Value) { GDEHelpers.Save(); } Finish(); }
public override void OnEnter() { result.Reset(); foreach (var fieldName in fieldNames) { result.Add(GDEHelpers.GetFieldValue(itemName.Value, fieldName.Value)); } if (result.Length == 0) { Fsm.Event(noneFoundEvent); } Finish(); }
public override void OnEnter() { result.Reset(); List <string> tmpValues = GDEHelpers.ListAllBy(GDEDataType.Item, searchInSchema.Value); List <string> matchingValues = new List <string>(); foreach (var tmp in tmpValues) { if (string.IsNullOrEmpty(itemNameContains.Value) && !itemNameContains.IsNone && !tmp.Contains(itemNameContains.Value)) { continue; } List <string> fieldNames = string.IsNullOrEmpty(searchInField.Value) || searchInField.IsNone ? null : new List <string> { searchInField.Value }; List <object> fieldValues = GDEHelpers.GetFieldValues(tmp, fieldNames); foreach (var fieldValue in fieldValues) { value.UpdateValue(); if (fieldValue.GetType() != value.GetType()) { UnityEngine.Debug.LogError("Given value type doesn't match result type!"); } if (fieldValue != value.GetValue()) { continue; } matchingValues.Add(tmp); break; } } if (matchingValues.Count == 0) { Fsm.Event(noneFoundEvent); } else { result.SetArrayContents(matchingValues); } Finish(); }
void DoCompare() { float result = (float)GDEHelpers.GetFieldValue(ItemName.Value, FieldName.Value); if (Mathf.Abs(result - compareTo.Value) <= tolerance.Value) { Fsm.Event(equal); } else if (result < compareTo.Value) { Fsm.Event(lessThan); } else if (result > compareTo.Value) { Fsm.Event(greaterThan); } }
void DoCompare() { int result = Convert.ToInt32(GDEHelpers.GetFieldValue(ItemName.Value, FieldName.Value)); if (Mathf.Abs(result - compareTo.Value) <= tolerance.Value) { Fsm.Event(equal); } else if (result < compareTo.Value) { Fsm.Event(lessThan); } else if (result > compareTo.Value) { Fsm.Event(greaterThan); } }
public override void OnEnter() { List <string> tmpFieldNames = new List <string>(); List <object> tmpFieldValues = new List <object>(); //List<GDEFieldType> tmpFieldTypes = new List<GDEFieldType>(); for (int i = 0; i < fieldNames.Length; i++) { tmpFieldNames.Add(fieldNames[i].Value); tmpFieldValues.Add(values[i].GetValue()); //tmpFieldTypes.Add(GDEHelpers.GetFieldType(itemName.Value, fieldNames[i].Value)); } GDEHelpers.CreateItem(schema.Value, itemName.Value, tmpFieldNames.ToArray(), tmpFieldValues.ToArray(), null, save.Value); Finish(); }
void DoCompareToPrevValue() { object currentValue = GDEHelpers.GetFieldValue(itemName.Value, fieldName.Value); if (previousValue != currentValue) { if (debugValues.Value) { Log("Previous Value: " + previousValue.ToString()); Log("Current Value: " + currentValue.ToString()); } Fsm.Event(hasChanged); previousValue = currentValue; } else { Fsm.Event(hasNotChanged); } }
public override void OnEnter() { result.Reset(); List <string> tmpValues = GDEHelpers.ListAllBy(GDEDataType.Item, searchInSchema.Value); List <string> matchingValues = new List <string>(); foreach (var tmp in tmpValues) { if (string.IsNullOrEmpty(itemNameContains.Value) && !itemNameContains.IsNone && !tmp.Contains(itemNameContains.Value)) { continue; } List <string> fieldNames = string.IsNullOrEmpty(searchInField.Value) || searchInField.IsNone ? null : new List <string> { searchInField.Value }; List <object> fieldValues = GDEHelpers.GetFieldValues(tmp, fieldNames); foreach (var fieldValue in fieldValues) { if (fieldValue.ToString() == _value.Value) { matchingValues.Add(tmp); break; } } } if (matchingValues.Count == 0) { Fsm.Event(noneFoundEvent); } else { result.SetArrayContents(matchingValues); } Finish(); }
public override void OnEnter() { List <string> allSchemas = GDEHelpers.GDEGetAllDataBy(GDEDataType.Schema).ToStringList(); if (Fsm.GetOwnerDefaultTarget(gameObject).GetComponent <PlayMakerArrayListProxy>() != null) { PlayMakerArrayListProxy _proxy = GetArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject), reference.Value, false); _proxy.AddRange(allSchemas, string.Empty); } if (viaProxyReference != null) { viaProxyReference.AddRange(allSchemas, string.Empty); } if (storeAsString != null) { foreach (string schema in allSchemas) { if (schema == (string)allSchemas.ToArray().GetValue(allSchemas.ToArray().Length - 1)) { storeAsString.Value = string.Concat(storeAsString.Value + schema); } else { storeAsString.Value = string.Concat(storeAsString.Value + schema + ", "); } } storeAsString.Value.Remove(storeAsString.Value.Length - 2); } if (storeAsStringArray != null) { storeAsStringArray.Values = allSchemas.ToArray(); } }
void CheckGDEBool() { storeBoolResult.Value = (bool)GDEHelpers.GetFieldValue(ItemName.Value, FieldName.Value); Fsm.Event(storeBoolResult.Value ? isTrueEvent : isFalseEvent); }
public override void OnEnter() { GDEHelpers.DebugDictionary(dataType); Finish(); }
public override void OnEnter() { result.Value = GDEHelpers.CountOccurrences(dataType, contains.Value, schema.Value); Finish(); }
public override void OnEnter() { GDEHelpers.SwapFieldValues(firstItemName.Value, firstFieldName.Value, secondItemName.Value, secondFieldName.Value, save.Value); Finish(); }
public override void OnEnter() { GDEHelpers.RemoveString(ItemName.Value, FieldName.Value, stringToRemove.Value, removeFromEnd.Value, save.Value); Finish(); }
public override void OnEnter() { GDEHelpers.AddString(ItemName.Value, FieldName.Value, stringToAdd.Value, addToEnd.Value, save.Value); Finish(); }
public override void OnEnter() { storeSchema.Value = GDEHelpers.GetSchemaByItem(itemName.Value); }
public override void OnEnter() { GDEHelpers.SwapItems(schema.Value, itemName.Value, swapWith.Value, save.Value); Finish(); }