Exemplo n.º 1
0
 void OnDestroy()
 {
     if (iom != null)
     {
         Debug.Log("Iom Device Exiting");
         iom.stopReadingData();
         iom.close();              // free the resources
         iom = null;
     }
 }
Exemplo n.º 2
0
    // 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();
    }
Exemplo n.º 3
0
    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");
    }
Exemplo n.º 4
0
 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");
     }
 }