Exemple #1
0
    void Awake()
    {
        Application.targetFrameRate = frameRate;
        QualitySettings.vSyncCount  = 0;

        bannerAd.SetActive(false);

        gliderController = FindObjectOfType <GliderController>();
        currencyM        = GetComponent <CurrencyManager>();
        pauseMenu.SetActive(false);
        deathMenu.SetActive(false);


        score          = Constants.startingScore;
        highScore.text = "HighScore: " + PlayerPrefs.GetInt("HighScore").ToString();



        if (instance == null)
        {
            instance = this;
        }


        else if (instance != this)
        {
            Destroy(gameObject);
        }

        scoreText.text = "Score: " + score.ToString();
        StartCoroutine(StartGame());
    }
Exemple #2
0
 // Start is called before the first frame update
 void Start()
 {
     plantRenderer    = GetComponent <SkinnedMeshRenderer>();
     gliderController = GetComponent <GliderController>();
     thisGO           = this.gameObject;
     flyingStates     = GetComponent <FlyingStates>();
 }
Exemple #3
0
 // Start is called before the first frame update
 void Start()
 {
     stateMachineAnimation = GetComponent <StateMachineAnimation>();
     rotationController    = GetComponent <RotationController>();
     flyingStates          = GetComponent <FlyingStates>();
     gliderController      = GetComponent <GliderController>();
 }
Exemple #4
0
    //Start
    private void Start()
    {
        gliderController = GetComponent <GliderController>();
        fallingAnim      = GetComponentInChildren <Animator>();
        isStablized      = true;
        burstEm          = false;
        fadeInEm         = false;
        canTurnUp        = true;
        //wings out
        WingsOut();

        boostFuel = 0;
        rb        = GetComponent <Rigidbody>();
        rot       = transform.eulerAngles;
    }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        FindObjectOfType <MenuController>();
        canRollLeft        = true;
        canRollRight       = true;
        animationScript    = GetComponent <AnimationScript>();
        rotationController = GetComponent <RotationController>();
        flyingStates       = GetComponent <FlyingStates>();
        gliderController   = GetComponent <GliderController>();
        audioManager       = GetComponent <AudioManager>();

        if (FindObjectOfType <MenuController>().controlsInverted == true)
        {
            playerControlsInverted = true;
        }
        else if (FindObjectOfType <MenuController>().controlsInverted == false)
        {
            playerControlsInverted = false;
        }
    }
Exemple #6
0
    void Awake()
    {
        spawnRate            = Constants.spawnPipesRateEasy;
        gcontroller          = FindObjectOfType <GliderController>();
        gManager             = FindObjectOfType <GameManager>();
        timeSinceLastSpawned = 0f;



        //Initialize the columns collection.
        pipes    = new GameObject[pipesPoolSize];
        allcoins = new GameObject[pipesPoolSize];
        //Loop through the collection to create the initial pipes that will be stored in the object pool.
        for (int i = 0; i < pipesPoolSize; i++)
        {
            pipes[i]    = (GameObject)Instantiate(pipesPrefab, objectPoolPosition, Quaternion.identity);
            allcoins[i] = (GameObject)Instantiate(coin, objectPoolPosition, Quaternion.identity);
        }



        StartCoroutine(UpdatePool());
    }
 // Start is called before the first frame update
 void Start()
 {
     gliderController = GetComponent <GliderController>();
     //lookAtTransform.transform.position = new Vector3(lookAtOffsetX, lookAtOffsetY, lookAtOffsetZ);
     flyingStates = GetComponent <FlyingStates>();
 }
Exemple #8
0
 private void Start()
 {
     gliderController = GetComponent <GliderController>();
     FindObjectOfType <AudioManager>();
 }