Ejemplo n.º 1
0
        private void ShowForceCreateScreen(string beeTag, float createWithinTime)
        {
            //Warning: Bad coding ahead
            switch (beeTag)
            {
            case "WorkerBee":
                if (noWorker || noQueen)
                {
                    return;
                }
                else
                {
                    noWorker = true;
                }
                break;

            case "QueenBee":
                if (noQueen || noWorker)
                {
                    return;
                }
                else
                {
                    noQueen = true;
                }
                break;
            }
            forceToCreateScreen.SetActive(true);
            switch (beeTag)
            {
            case "WorkerBee":
                forceToCreateScreen.SendMessage("SetMessage", "Create a worker bee within " + createWithinTime + " seconds or the colony won't survive!");
                break;

            case "QueenBee":
                forceToCreateScreen.SendMessage("SetMessage", "Create a queen bee within " + createWithinTime + " seconds or the colony won't survive!");
                break;
            }
            forceToCreateScreen.SendMessage("SetCreateWithinTime", createWithinTime);

            counterPanel.SetActive(true);
            CounterController cc = counterPanel.GetComponent <CounterController>();

            cc.StartTime    = createWithinTime;
            cc.TimeExpired += OnTimeExpired;
            cc.StartCountdown();
        }