Пример #1
0
    private void resizeNeighborSections(CircleSectionController section, float angle)
    {
        CircleSectionController previousSection = getPreviousSection(section);

        if (previousSection.isAtMinimum())
        {
            // If this is already at minimum, skip it
            previousSection = getPreviousSection(previousSection);
        }
        CircleSectionController nextSection = getNextSection(section);

        if (nextSection.isAtMinimum())
        {
            // If this is already at minimum, skip it
            nextSection = getNextSection(nextSection);
        }
        decreaseSection(previousSection, angle, false);
        decreaseSection(nextSection, angle, true);

        if (checkNonNeutralAtMinimum())
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
            Debug.Log("LOST!");
        }
        else if (checkAllNeutralAtMinimum())
        {
            Debug.Log("WON!");
            winText.SetActive(true);
        }
    }