Пример #1
0
    public void Dig()
    {
        thisWeeksResult   = 0;
        thisDiggingResult = 0;

        for (int i = 0; i <= rankLevel; i++)
        {
            if (toolLevel == 2)
            {
                thisDiggingResult = ToolLevel2Dig();
            }
            else if (toolLevel == 1)
            {
                thisDiggingResult = ToolLevel1Dig();
            }
            else
            {
                thisDiggingResult = ToolLevel0Dig();
            }

            if (thisDiggingResult > thisWeeksResult)
            {
                thisWeeksResult = thisDiggingResult;
            }

            if (GameSystem.instance.firstDigGuarantee)
            {
                thisWeeksResult = 2;
                GameSystem.instance.firstDigGuarantee = false;
            }
        }

        isCurrentlyDigging = false;
        resourceManager.AddDiamonds(thisWeeksResult);
        if (thisWeeksResult == 0)
        {
            DigEvent();
        }
        CreateDigResultPopUp(thisWeeksResult);
    }