public static RfidBinding checkBindings(JSONNode JSONatt, touchType smartTouchType) { //Debug.LogError ("Checking rfid bindings that contains attributes..."); RfidBinding rfidObject = null; for (int i = 0; i < bindedObjects.Count; i++) { RfidBinding temp = bindedObjects [i]; for (int k = 0; k < JSONatt.Count; k++) { string tempAttribute = JSONatt [k].Value; if (temp.attribute.Contains(tempAttribute)) { i = bindedObjects.Count; k = JSONatt.Count; //Debug.LogError ("Attributes found!...'" + tempAttribute + "', checking if binding is enabled and functions exists!"); if (temp.enableBinding && ((smartTouchType == touchType.smartTouchStart && temp.smartTouchStart != null) || (smartTouchType == touchType.smartTouchEnd && temp.smartTouchEnd != null))) { rfidObject = temp; } } else { //Debug.LogError ("No bindings exists with attributes, " + tempAttribute); rfidObject = null; //object exits, but not enabled or does not contain executable function } } } return(rfidObject); }
public static bool compareJSON(string ID, touchType ST, Vector3 location, out RfidBinding rfidObject) { ////Debug.LogError ("Comparing socket input with JSON file and RfidBindings"); JSONNode attributes = findTagInJSON(ID, location); rfidObject = BindManager.checkBindings(attributes, ST); if (attributes != null && rfidObject != null) { return(true); } else { return(false); } }
public static bool compareJSON(string ID, touchType ST, Vector3 location, out RfidBinding rfidObject) { ////Debug.LogError ("Comparing socket input with JSON file and RfidBindings"); JSONNode attributes = findTagInJSON (ID, location); rfidObject = BindManager.checkBindings (attributes, ST); if (attributes != null && rfidObject != null){ return true; } else return false; }
void Start() { newObject = new RfidBinding (true, "Zombie"); newObject.smartTouchStart += STS; newObject.smartTouchEnd += STE; }