Пример #1
0
    void Start()
    {
        gameManager = GameObject.FindWithTag("GameManager").GetComponent <GameManager>();
        gameManager.Register_Clipboard(this);
        localizedTextManager = gameManager.GetComponent <LocalizedTextManager>();

        buttonTextComponent = GetComponentInChildren <Text>();

        offscreenPosition = new Vector3(transform.position.x, transform.position.y - offscreenOffset, transform.position.z);
        offscreenScale    = transform.localScale * offscreenScalar;
        originalPosition  = transform.position;
        originalScale     = transform.localScale;

        createAndDestroyLevelRef = GameObject.FindGameObjectWithTag("persistentObject").GetComponent <CreateAndDestroyAppointment>();

        selectorRef = GameObject.Find("LevelSelector").GetComponent <LevelSelector>();
        createAndDestroyLevelRef.levelsAvailable = selectorRef.dayToGenerate.numAppointments;

        CreateAllAppointments();

        // place badges
        badgeCheckOriginalPos         = badgeCheck.transform.localPosition;
        badgeStarOriginalPos          = badgeStar.transform.localPosition;
        badgeCheck.transform.position = new Vector3(badgeCheck.transform.position.x, badgeCheck.transform.position.y + distanceToPushBadges, badgeCheck.transform.position.z);
        badgeStar.transform.position  = new Vector3(badgeStar.transform.position.x, badgeStar.transform.position.y + distanceToPushBadges, badgeStar.transform.position.z);

        // place showMe banner
        Vector3 showMeScreenEdge = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width * showMeBannerScreenPos_X, Screen.height * showMeBannerScreenPos_Y));

        showMeOutPosition = new Vector3(
            showMeScreenEdge.x,
            showMeScreenEdge.y,
            showMeBanner.transform.position.z);
        showMeInPosition = new Vector3(showMeOutPosition.x - distanceToPushShowMeBanner, showMeOutPosition.y, showMeOutPosition.z);
        showMeBanner.transform.position = showMeInPosition;

        // show notifications at start of clipboard
        if (selectorRef.dayToGenerate.dayIndex_internal == 0)
        {
            GameObject.Find("NotificationManager").GetComponent <NotificationManager>().DisplayNotification(1, false);
        }
        else if (selectorRef.dayToGenerate.dayIndex_internal == 4)
        {
            GameObject.Find("NotificationManager").GetComponent <NotificationManager>().DisplayNotification(9, false);
        }

        textDay.text = localizedTextManager.GetLocalizedString("Day") + " " + (selectorRef.dayToGenerate.dayIndex_internal + 1);

        restartFromResultsScreenButton = GameObject.Find("RestartFromResultsScreenButton");
        ShowRestartButton(false);

        isFirstCreation = false;
    }
Пример #2
0
    void Start()
    {
        gameManager = GameObject.FindWithTag("GameManager").GetComponent<GameManager>();
        gameManager.Register_Clipboard(this);
        localizedTextManager = gameManager.GetComponent<LocalizedTextManager>();

        buttonTextComponent = GetComponentInChildren<Text>();

        offscreenPosition = new Vector3(transform.position.x, transform.position.y - offscreenOffset, transform.position.z);
        offscreenScale = transform.localScale * offscreenScalar;
        originalPosition = transform.position;
        originalScale = transform.localScale;

        createAndDestroyLevelRef = GameObject.FindGameObjectWithTag("persistentObject").GetComponent<CreateAndDestroyAppointment>();

        selectorRef = GameObject.Find("LevelSelector").GetComponent<LevelSelector>();
        createAndDestroyLevelRef.levelsAvailable = selectorRef.dayToGenerate.numAppointments;

        CreateAllAppointments();

        // place badges
        badgeCheckOriginalPos = badgeCheck.transform.localPosition;
        badgeStarOriginalPos = badgeStar.transform.localPosition;
        badgeCheck.transform.position = new Vector3(badgeCheck.transform.position.x, badgeCheck.transform.position.y + distanceToPushBadges, badgeCheck.transform.position.z);
        badgeStar.transform.position = new Vector3(badgeStar.transform.position.x, badgeStar.transform.position.y + distanceToPushBadges, badgeStar.transform.position.z);

        // place showMe banner
        Vector3 showMeScreenEdge = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width * showMeBannerScreenPos_X, Screen.height * showMeBannerScreenPos_Y));
        showMeOutPosition = new Vector3(
            showMeScreenEdge.x,
            showMeScreenEdge.y,
            showMeBanner.transform.position.z);
        showMeInPosition = new Vector3(showMeOutPosition.x - distanceToPushShowMeBanner, showMeOutPosition.y, showMeOutPosition.z);
        showMeBanner.transform.position = showMeInPosition;

        // show notifications at start of clipboard
        if (selectorRef.dayToGenerate.dayIndex_internal == 0)
        {
            GameObject.Find("NotificationManager").GetComponent<NotificationManager>().DisplayNotification(1, false);
        }
        else if (selectorRef.dayToGenerate.dayIndex_internal == 4)
        {
            GameObject.Find("NotificationManager").GetComponent<NotificationManager>().DisplayNotification(9, false);
        }

        textDay.text = localizedTextManager.GetLocalizedString("Day") + " " + (selectorRef.dayToGenerate.dayIndex_internal + 1);

        restartFromResultsScreenButton = GameObject.Find("RestartFromResultsScreenButton");
        ShowRestartButton(false);

        isFirstCreation = false;
    }