Ejemplo n.º 1
0
    void Start()
    {
        FriendModel model = FitBit.getInstance().getUserModel();

        PlayerManager.mainPlayer = new PlayerStats(model);
        DatabaseController.updatePlayer(PlayerManager.mainPlayer);
    }
Ejemplo n.º 2
0
 public void getFriends()
 {
     foreach (string str in FitBit.getInstance().getFriendIDs())
     {
         Debug.Log(str);
     }
 }
Ejemplo n.º 3
0
 void Update()
 {
     //This code is only for testing. This will eventually be pulled from the FitBit.
     totalSteps_int = (int)totalSteps;
     //totalSteps += stepRate * Time.deltaTime;
     totalSteps          += FitBit.getInstance().getStepsSinceLastCall();
     totalSteps_text.text = "Total Steps: " + totalSteps_int.ToString();
 }
Ejemplo n.º 4
0
 public void OnMouseDown()
 {
     Debug.Log("Clicked start");
     if (FitBit.getInstance().isAuthenticated() && PlayerManager.isReady)
     {
         //FindObjectOfType<DragonScript>().ShootTarget();
         Application.LoadLevel(gameScreen);
     }
 }
Ejemplo n.º 5
0
    public static void updatePlayers()
    {
        Thread oThread = new Thread(new ThreadStart(() =>
        {
            Thread.Sleep(4000);
            FriendModel model = FitBit.getInstance().getUserModel();
            DatabaseController.updateFriendsList(FitBit.getInstance().getFriendIDs());
            DatabaseController.getMainPlayer(model.encodedId);

            Thread startGameThread = new Thread(new ThreadStart(() =>
            {
                Thread.Sleep(2500);
                //start game
                isReady = true;
            }));
            startGameThread.Start();
        }));

        oThread.Start();
    }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     Screen.sleepTimeout = SleepTimeout.NeverSleep;
     Debug.Log("Start in Load Game");
     // set up fitBit singleton
     fitBitManager = FitBit.getInstance();
     if (fitBitManager.isAuthenticated())
     {
         foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("pinUI"))
         {
             Destroy(gameObject);
         }
     }
     else
     {
         PlayerPrefs.SetInt(PLAYED_BEFORE, 0);
     }
     if (PlayerPrefs.GetInt(PLAYED_BEFORE, 0) == 0)
     {
         gameScreen            = "InitializationScene";
         PlayerManager.isReady = true;
     }
 }
Ejemplo n.º 7
0
 public void clearCache()
 {
     //TODO clear program memory for things here.
     FitBit.getInstance().clearCache();
     //FitBit.getInstance().updateAll();
 }
Ejemplo n.º 8
0
 //TODO remove these. Only here for show for the button
 public void getStepsSinceLastCall()
 {
     Debug.Log(FitBit.getInstance().getStepsSinceLastCall());
 }
Ejemplo n.º 9
0
 public void enterPin()
 {
     FitBit.getInstance().enterPin();
 }