コード例 #1
0
    IEnumerator StartGame()
    {
        miniMap.SetActive(true);
        HUD.SetActive(true);

        float start = Time.time;

        while (true)
        {
            float percent = (Time.time - start) * 2;
            mainMenu.GetComponent <CanvasGroup>().alpha = 1 - percent;
            if (percent >= 1)
            {
                break;
            }
            yield return(new WaitForEndOfFrame());
        }
        mainMenu.SetActive(false);

        PlayerSheet.Initialize();
        distributorID = PlayerSheet.GetDistributor(difficulty);
        Debug.Log(PlayerSheet.GetName(distributorID) + " is the distributor.");
        PlayerSheet.SetParameter(distributorID, (int)ParameterType.Infected, true);
        player.transform.position = Vector2.zero;

        minutesLeft      = 16;
        days             = 0;
        spreadText.text  = "Spread: " + spread.ToString();
        minutesText.text = "Minutes Left: " + minutesLeft.ToString();
        daysText.text    = "Days: " + days.ToString();

        StartCoroutine(GameHandler());

        yield return(null);
    }