示例#1
0
    private void Start()
    {
        chicken     = GameObject.FindWithTag("Player").GetComponent <Chicken>();
        gameManager = FindObjectOfType <GameManager>();

        seedHolder  = FindObjectOfType <SeedHolder>();
        scoreHolder = FindObjectOfType <ScoreHolder>();
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        seedHolder  = FindObjectOfType <SeedHolder>().GetComponent <SeedHolder>();
        scoreHolder = FindObjectOfType <ScoreHolder>().GetComponent <ScoreHolder>();
        eggHolder   = FindObjectOfType <EggHolder>().GetComponent <EggHolder>();

        scoreText.text   = (scoreHolder.score).ToString();
        seedAmtText.text = (seedHolder.seedsPerSession).ToString();
        eggAmtText.text  = (eggHolder.eggsPerSession).ToString();

        ChickenStat = PlayerPrefs.GetInt("CharacterStat");

        audioSource = FindObjectOfType <AudioSource>();
        chicken     = GameObject.FindGameObjectWithTag("Player");

        Time.timeScale = 1;
        pauseObjects   = GameObject.FindGameObjectsWithTag("PauseControl");
        HidePaused();
    }
示例#3
0
    // Start is called before the first frame update
    void Start()
    {
        eggInfo.text   = "Out Of Eggs!";
        highScore.text = "New Highscore!!!";
        rigidbody2D    = GetComponent <Rigidbody2D>();
        gameManager    = FindObjectOfType <GameManager>();
        spriteRenderer = GetComponent <SpriteRenderer>();

        //StartCoroutine(IncreaseScore());
        InvokeRepeating("IncreaseScore", .5f, .1f); //invoke method at .5secs, every .1sec.

        /*seed.isPulled = false;
         * egg.isPulled = false;*/
        if (seed.isPulled == true)
        {
            seed.isPulled = false;
        }
        if (egg.isPulled == true)
        {
            egg.isPulled = false;
        }

        characterHandler.CharacterController();

        characterStat = PlayerPrefs.GetInt("CharacterStat");
        yPosition     = transform.position.y;
        isInvisible   = false;
        scoreHolder   = FindObjectOfType <ScoreHolder>().GetComponent <ScoreHolder>();
        seedHolder    = FindObjectOfType <SeedHolder>().GetComponent <SeedHolder>();
        eggHolder     = FindObjectOfType <EggHolder>().GetComponent <EggHolder>();

        powerUp        = FindObjectOfType <PowerUp>();
        Time.timeScale = 1;

        //gameOverObjects = GameObject.FindWithTag("GameOver");
    }