void OnDestroy() { if (iom != null) { Debug.Log("Iom Device Exiting"); iom.stopReadingData(); iom.close(); // free the resources iom = null; } }
// Called once when enabled, using this for hardware initialization void Start() { Debug.Log("Iom device Initializing"); iom = new IOM(); int deviceCount = iom.setup(); statusText.text = string.Format("Initialized ({0} found)", deviceCount); iom.setAvgNum(10); // set avergae peaks number iom.startReadingData(); }
public void saveInventory() { InventoryData inventory_data = new InventoryData(); inventory_data.weapon_data = inv_weapon; inventory_data.potion_data = inv_potion; inventory_data.other_data = inv_other; IOM.save <InventoryData>(inventory_data, "player_inventory"); Debug.Log("inventory was saved"); }
public void loadInventory() { if (IOM.fileExists("player_inventory")) { InventoryData id = IOM.load <InventoryData>("player_inventory"); inv_weapon = id.weapon_data; inv_potion = id.potion_data; inv_other = id.other_data; Debug.Log("inventory was loaded"); } else { Debug.Log("inventory was'n loaded, because there is no file"); } }