コード例 #1
0
        public void FinishPuzzle(bool solved)
        {
            int duration = (int)(Time.time - _startTime);

            if (duration < 3)
            {
                return;
            }

            _currentPuzzle = new PlayPuzzles
            {
                Time       = DateTime.Now,
                PlayerID   = Singleton.Instance.PlayerController.GetPlayerID ?? -1,
                Duration   = duration,
                HintCount1 = Hint1,
                HintCount2 = Hint2,
                HintCount3 = Hint3,
                PuzzleID   = Singleton.Instance.WordSpawner.PuzzleID,
                MoveCount  = 0,
                Success    = solved,
                Dirty      = true
            };

            if (_currentPuzzle.PuzzleID != -1)
            {
                LocalDBController.InsertOrReplace(_currentPuzzle);
            }
        }
コード例 #2
0
 public void StartPuzzle()
 {
     Hint1          = Hint2 = Hint3 = 0;
     _currentPuzzle = new PlayPuzzles();
     _startTime     = Time.time;
 }