Example #1
0
 public void StopService()
 {
     StepCounterPlugin.StopStepCounterService();
     state.text = "걸음수를 세기를 멈췄어요";
 }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        var currentStepCount = StepCounterPlugin.GetStepCount();

        // 오늘 첫 접속시 지금까지 걸음수를 어제꺼로 저장하고, 오늘은 다시 0으로 보이게 만들기 위해
        if (first == 1)
        {
            // 지금까지의 step을 전날에다가 저장하는 코드
            SaveStep3_date_1();

            // totalStep 을 db에 저장해서 하루에 한 번만 total을 저장하게 해야함 db 코드 만들자
            totalStep = currentStepCount;
            UpdateTotal();

            s = 1;

            if (s == 1)
            {
                UpdateWalkingInit(); // 다시 걸음수 3000 넘으면 에너지 받을 수 있게
                s = 0;               // 밤되면 또 업데이트하게
            }

            // first = 0;
        }


        if (dbStep > currentStepCount)  // 핸드폰 껐다 켰을 때
        {
            step      = dbStep + currentStepCount;
            totalStep = 0;
        }
        else    // 평상시
        {
            step = currentStepCount - dbTotalStep;
        }

        stepCountText.text = "걸음수 : " + step.ToString();



        if (ok == 0)
        {
            okPanel.SetActive(false);
        }
        else if (ok == 1 && n == 0)
        {
            okPanel.SetActive(true);
        }

        if (n == 0 && step >= 3000) // 3000 걸음 넘으면 에너지 +200
        {
            ok = 1;
        }

        testTxt.text = "current : " + currentStepCount.ToString();

        /*
         * if (DateTime.Now.ToString("HH:mm:ss") == "23:59:00") // 밤 11시 59분이 되면 각 디비에 걸음수 저장
         * {
         *  if (s == 0)
         *  {
         *      SaveStep3(); // 오늘 날짜에 오늘의 걸음수를 step 에 업데이트
         *
         *      totalStep = currentStepCount; // 기기 걸음수를 total에 저장
         *
         *      s = 1; // 12시되면 밑 코드 실행할 수 있게
         *  }
         * }
         * if (DateTime.Now.ToString("HH:mm:ss") == "00:00:05") // 밤 12시에 초기화
         * {
         *  if (s == 1)
         *  {
         *      SaveStep2(); // 오늘 날짜에 step 을 0으로 삽입
         *      UpdateWalkingInit(); // 다시 걸음수 3000 넘으면 에너지 받을 수 있게
         *      s = 0; // 밤되면 또 업데이트하게
         *  }
         *
         * }
         *
         *
         */
    }
Example #3
0
 public void StartService()
 {
     StepCounterPlugin.StartStepCounterService();
     state.text = "걸음수를 세고 있어요";
 }