コード例 #1
0
    private void Start()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();
        if (spriteRenderer.sprite == null)
        {
            spriteRenderer.sprite = inactiveSprite;
        }

        changeSprite = false;

        textConvertedToInt = int.Parse(minReqText.text);

        levelPassReqsScript = FindObjectOfType <LevelPassReqs>();
    }
コード例 #2
0
    void Start()
    {
        pauseGameScript             = FindObjectOfType <PauseGameStatus>();
        pauseGameScript.pauseAuto   = false;
        pauseGameScript.pauseManual = false;

        timeOfInstantiation = Time.time;

        GetComponent <ObjectColliderActiveStatus>().DeactivateColliders();

        levelPassReqsScript = FindObjectOfType <LevelPassReqs>();

        setStarStatusScript    = FindObjectOfType <SetStarStatus>();
        counterScript          = FindObjectOfType <Counter>();
        userInputScript        = FindObjectOfType <UserInput>();
        gameSaverScript        = FindObjectOfType <GameSaver>();
        setInitialValuesScript = FindObjectOfType <SetInitialLevelValues>();

        startAddingScore   = true;
        startAddingCoins   = false;
        startAddingMatches = false;

        pointsStar = GameObject.Find("PointsStar");
        coinsStar  = GameObject.Find("CoinsStar");

        scene          = SceneManager.GetActiveScene();
        thisSceneIndex = scene.buildIndex;
        nextSceneIndex = thisSceneIndex + 1;

        sceneName = scene.name;

        PlayerPrefs.SetString("keyCurrentLevel", gameSaverScript.sceneNames[thisSceneIndex - 1]);
        PlayerPrefs.SetString("keyNextLevel", gameSaverScript.sceneNames[nextSceneIndex - 1]);

        cityName.text = sceneName.ToString();


        pointsReq.text  = levelPassReqsScript.passPoints.ToString();
        coinsReq.text   = levelPassReqsScript.passCoins.ToString();
        matchesReq.text = levelPassReqsScript.passMatches.ToString();

        counterScript.scoreCurrentAmount    = counterScript.scoreTotalAmount;
        counterScript.scoreBalanceText.text = counterScript.scoreCurrentAmount.ToString();

        newShapeMenu = setInitialValuesScript.newShapeMenu;


        SaveLevelInfo();
    }
コード例 #3
0
    private void Start()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();
        if (spriteRenderer.sprite == null)
        {
            spriteRenderer.sprite = inactiveSprite;
        }

        changeSprite = false;

        textConvertedToInt = int.Parse(minReqText.text);

        levelPassReqsScript = FindObjectOfType <LevelPassReqs>();
        gameSaverScript     = FindObjectOfType <GameSaver>();

        sceneName = SceneManager.GetActiveScene().name;
    }