/* * This function is used to handle Pedometer reading * @param * steps: steps taken from the start of session * distance: meters walked from start of sesssion */ private void OnStep(int steps, double distance) { totalDistance = distance + prevDistance; var data = new QuestInputData(INPUT_DISTANCE); data.PutValue(totalDistance); Notify(data); // Save total distance // PlayerPrefs.SetFloat(PREV_DISTANCE, (float) totalDistance); }
/* * This function is used to handle share reading */ public void OnShare(bool shareSucessful) { totalShare += shareSucessful? 1 : 0; // Save share progress PlayerPrefs.SetInt(PREV_SHARE, totalShare); var data = new QuestInputData(INPUT_SHARE); data.PutValue(totalShare); Notify(data); }