예제 #1
0
    void Start()
    {
        FriendModel model = FitBit.getInstance().getUserModel();

        PlayerManager.mainPlayer = new PlayerStats(model);
        DatabaseController.updatePlayer(PlayerManager.mainPlayer);
    }
예제 #2
0
 public void getFriends()
 {
     foreach (string str in FitBit.getInstance().getFriendIDs())
     {
         Debug.Log(str);
     }
 }
예제 #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();
 }
예제 #4
0
 public void OnMouseDown()
 {
     Debug.Log("Clicked start");
     if (FitBit.getInstance().isAuthenticated() && PlayerManager.isReady)
     {
         //FindObjectOfType<DragonScript>().ShootTarget();
         Application.LoadLevel(gameScreen);
     }
 }
예제 #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();
    }
예제 #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;
     }
 }
예제 #7
0
 public void clearCache()
 {
     //TODO clear program memory for things here.
     FitBit.getInstance().clearCache();
     //FitBit.getInstance().updateAll();
 }
예제 #8
0
 //TODO remove these. Only here for show for the button
 public void getStepsSinceLastCall()
 {
     Debug.Log(FitBit.getInstance().getStepsSinceLastCall());
 }
예제 #9
0
 public void enterPin()
 {
     FitBit.getInstance().enterPin();
 }