예제 #1
0
    private void updateDataErase(bool holding)
    {
        if (_erasedData)
        {
            return;
        }

        if (holding)
        {
            if (_eraseDataHoldTime > this.EraseDataHoldTime)
            {
                _erasedData = true;
                ProgressData.WipeData();
                ProgressData.SaveToDisk();
                PersistentData.EraseLocalData();
                this.DataEraseText.text = _dataEraseBaseText + " (Erased!)";
            }
            else
            {
                _eraseDataHoldTime     += Time.deltaTime;
                this.DataEraseText.text = _dataEraseBaseText + " (Hold " + Mathf.RoundToInt(Mathf.Clamp(this.EraseDataHoldTime - _eraseDataHoldTime, 0.0f, this.EraseDataHoldTime)) + ")";
            }
        }
        else if (_eraseDataHoldTime > 0.0f)
        {
            _eraseDataHoldTime      = 0.0f;
            this.DataEraseText.text = _dataEraseBaseText;
        }
    }