예제 #1
0
 /** Keeps the PoleBox around in the Dictionary until it has finished its
     fade out animation (as it can still be lowered while fading out) **/
 private IEnumerator RemovePoleBoxWhenDestroyedCoroutine
     (PoleBoxController poleBox, float timing)
 {
     while (poleBox != null)
     {
         yield return new WaitForEndOfFrame();
     }
     poleBoxes.Remove(timing);
 }
예제 #2
0
    private bool GetNextPoleBox(int offset, bool trigger, out PoleBoxController poleBox)
    {
        poleBox = null;
        int index;
        if (trigger)
        {
            index = timingsManager.NextTriggerTimingIndex + offset;
        }
        else
        {
            index = timingsManager.NextPlayerTimingIndex + offset;
        }

        float timing = 0;
        if (index >= 0 && index < timingsManager.Timings.Count)
        {
            timing = timingsManager.Timings[index].time;
        }
        else
        {
            return false;
        }
        
        if (poleBoxes.ContainsKey(timing))
        {
            poleBox = poleBoxes[timing];
            return true;
        }
        return false;
    }
예제 #3
0
 private void SetPlatformType(PoleBoxController poleBox, List<int> triggers)
 {
     // Platform
     if (triggers.Contains(NightWalkTriggers.GAP))
     {
         poleBox.SetPlatform(PoleBoxController.PlatformType.PLATFORM_NONE);
     }
     else if (triggers.Contains(NightWalkTriggers.START_ROLL))
     {
         poleBox.SetPlatform(PoleBoxController.PlatformType.PLATFORM_SHORT);
     }
     else if (triggers.Contains(NightWalkTriggers.END_ROLL))
     {
         poleBox.SetPlatform(PoleBoxController.PlatformType.PLATFORM_LONG);
     }
     else
     {
         poleBox.SetPlatform(PoleBoxController.PlatformType.PLATFORM_MEDIUM);
     }
 }
예제 #4
0
    private void PopPoleBoxAndPlayAudio(PoleBoxController poleBox, 
        PoleBoxController.PopType popupType)
    {
        switch (popupType)
        {
            case PoleBoxController.PopType.POP_GOOD:
            case PoleBoxController.PopType.POP_FIREWORKS:
                PlayAttemptSound(TimingsManager.TimingResult.GOOD);
                break;
            case PoleBoxController.PopType.POP_BAD:
                PlayAttemptSound(TimingsManager.TimingResult.BAD);
                break;
            case PoleBoxController.PopType.POP_MISS:
                PlayAttemptSound(TimingsManager.TimingResult.MISS);
                break;
        }

        if (poleBox != null)
        {
            poleBox.Pop(popupType);
        }
    }