Example #1
0
 void Update()
 {
     //If the player didn't run into an encounter, update the step text
     if (!encounterActive)
     {
         pedometer.LoadStepToday();
         int newSteps = pedometer.GetStepToday();
         if (steps < newSteps)
         {
             steps += (newSteps - steps);
         }
         stepDisplay.text     = "" + steps;
         currencyDisplay.text = GameObject.Find("Inventory").GetComponent <Inventory>().gold.ToString();
     }
 }
Example #2
0
    public void LoadSteps()
    {
        // test only remove this after testing because usually on 1st run there's no save step
        // from yesteday this value is for testing previos total steps
        // you just need to call this once on 1st run after that remove it or comment it
        // to avoid messing around the step save
        //pedometerPlugin.SetStepYesterday( 1500 );

        pedometerPlugin.LoadPrevTotalStep();
        pedometerPlugin.LoadTotalStep();
        pedometerPlugin.LoadStepToday();

        UpdateYesterdayStepCount(pedometerPlugin.GetStepYesterday());
        // get step on this date
        // for testing my current date now is april 8,2017 i want to get step yesterday so minus 1 day
        // so i put 3 , 7, 2017 - change this to your current date for testing
        // remember month start's with 0 so jan  = 0, that's why april is 3
        GetStepByDate(3, 7, 2017);
    }
Example #3
0
 // for loading steps
 public void LoadSteps()
 {
     pedometerPlugin.LoadPrevTotalStep();
     pedometerPlugin.LoadTotalStep();
     pedometerPlugin.LoadStepToday();
 }