// Update is called once per frame
    void Update()
    {
        if (!_scoresFilledIn)
        {
            if (Globals.Network != null)
            {
                // Wait until we have server data
                if (Globals.Network.CourseCompleteInfo == null)
                {
                    // TODO: Add wait animation here
                    return;
                }
                else
                {
                    FillInScores(Globals.Network.CourseCompleteInfo.ObstacleScore, Globals.Network.CourseCompleteInfo.TimeScore);
                }
            }
        }
        else
        {
            // Make sure everything is setup before we start
            if (_flightCourse != null && _doneButton != null)
            {
                if (_animWaitTime > 0)
                    _animWaitTime -= Time.deltaTime;

                if (_animWaitTime <= 0)
                {
                    switch (_animPhase)
                    {
                        case AnimPhase.ParTime:
                            DoParTime();
                            break;
                        case AnimPhase.YourTimeReveal:
                            DoYourTimeReveal();
                            break;
                        case AnimPhase.YourTimeDisplay:
                            DoYourTimeDisplay();
                            break;
                        case AnimPhase.Obstacles:
                            DoObstacles();
                            break;
                        case AnimPhase.ObstaclesScore:
                            DoObstaclesScore();
                            break;
                        case AnimPhase.TimeBonus:
                            DoTimeBonus();
                            break;
                        case AnimPhase.TimeBonusScore:
                            DoTimeBonusScore();
                            break;
                        case AnimPhase.Total:
                            DoTotal();
                            break;
                        case AnimPhase.TotalScore:
                            DoTotalScore();
                            break;
                        case AnimPhase.Loot:
                            DoLoot();
                            break;
                        case AnimPhase.Done:
                            _doneButton.enabled = true;
                            break;
                        case AnimPhase.Skip:
                            DoParTime();
                            DoYourTimeReveal();
                            DoYourTimeDisplay();
                            DoObstacles();
                            DoObstaclesScore();
                            DoTimeBonus();
                            DoTimeBonusScore();
                            DoTotal();
                            DoTotalScore();
                            DoLoot();
                            _animPhase = AnimPhase.Done;
                            break;
                    }
                }
            }
        }
    }
 void AnimWait(AnimPhase nextPhase)
 {
     _animPhase = nextPhase;
     _animWaitTime = _animStepTime;
 }
    // Use this for initialization
    void Start()
    {
        Transform panel = transform.FindChild("Panel");

        _currency = panel.FindChild("Currency").GetComponent<Text>();
        _currencyDesc = panel.FindChild("CurrencyDesc").GetComponent<Text>();
        _lootDisplay = panel.FindChild("Loot").GetComponent<Text>();
        _timeDisplay = panel.FindChild("YourTime").GetComponent<Text>();
        _parTimeDisplay = panel.FindChild("ParTime").GetComponent<Text>();

        _doneButton = panel.FindChild("DoneButton").GetComponent<Button>();
        _doneButton.onClick.AddListener(OnDoneButton);
        _doneButton.enabled = false;

        _currency.text = "";
        _currencyDesc.text = "";
        _lootDisplay.text = "";
        _timeDisplay.text = "";
        _parTimeDisplay.text = "";

        _animPhase = AnimPhase.ParTime;
        _animWaitTime = _animStepTime;
    }