コード例 #1
0
ファイル: TouhouSortSorter.cs プロジェクト: Gman8r/NitoriWare
    public void CheckSort()
    {
        // Check the current state of the sort
        // End the game if everything is sorted
        bool allSorted = true;

        foreach (TouhouSortSortable sortable in touhous)
        {
            bool thisSorted = false;

            // Get the touhou's current zone, if any
            TouhouSortDropZone currentZone = sortable.GetCurrentZone();

            if (currentZone)
            {
                thisSorted = currentZone.Belongs(sortable);
            }

            if (thisSorted != true)
            {
                allSorted = false;
                break;
            }
        }

        if (allSorted)
        {
            confettiParticles.gameObject.SetActive(true);
            confettiParticles.Play();
            MicrogameController.instance.playSFX(victoryClip, 0f, 1f, .75f);

            MicrogameController.instance.setVictory(true, true);
        }
    }
コード例 #2
0
 public void ExitZone(TouhouSortDropZone zone)
 {
     if (currentZone == zone)
     {
         currentZone = null;
     }
 }
コード例 #3
0
    public void CheckSort()
    {
        // Check the current state of the sort
        // End the game if everything is sorted
        bool allSorted = true;

        foreach (TouhouSortSortable sortable in touhous)
        {
            bool thisSorted = false;

            // Get the touhou's current zone, if any
            TouhouSortDropZone currentZone = sortable.GetCurrentZone();

            if (currentZone)
            {
                thisSorted = currentZone.Belongs(sortable);
            }

            if (thisSorted != true)
            {
                allSorted = false;
                break;
            }
        }

        if (allSorted)
        {
            // Sorted
            //Debug.Log("Sorted");
            sorted = true;

            victoryDisplay.SetActive(true);

            MicrogameController.instance.setVictory(true, true);
        }
        else if (sorted)
        {
            // Unsorted (wont ever happen)
            Debug.Log("Unsorted");
            sorted = false;

            victoryDisplay.SetActive(false);

            MicrogameController.instance.setVictory(false, true);
        }
    }
コード例 #4
0
    public void SetZoneAttributes(int index, Sprite sprite, string style, bool invert)
    {
        TouhouSortDropZone zone = zones[index];

        zone.SetCategory(style, invert, sprite);
    }
コード例 #5
0
 public void EnterZone(TouhouSortDropZone zone)
 {
     currentZone = zone;
 }