private void Awake()//Assign PlayAnimation and TMPro components
    {
        ResetPlayer   = GameObject.Find("GameController").GetComponent <ResetPlayerRotation>();
        PlayAnimation = GameObject.Find("UI").GetComponent <AnimationController>();
        GameElements  = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAndTrampolines>();
        Colors        = GameObject.FindGameObjectWithTag("Background").GetComponent <GameColorsController>();

        scoreTxt               = GameObject.FindGameObjectWithTag("ScoreTxt").GetComponent <TextMeshProUGUI>();
        tmpScoreTxt            = GameObject.FindGameObjectWithTag("TmpScoreTxt").GetComponent <TextMeshProUGUI>();
        updateTmpScoreTxt      = GameObject.FindGameObjectWithTag("UpdateTmpScoreTxt").GetComponent <TextMeshProUGUI>();
        perfectLandTxt         = GameObject.FindGameObjectWithTag("PerfectLandTxt").GetComponent <TextMeshProUGUI>();
        currLevelTxt           = GameObject.FindGameObjectWithTag("CurrentLevelNo").GetComponent <TextMeshProUGUI>();
        nxtLevelTxt            = GameObject.FindGameObjectWithTag("NextLevelNo").GetComponent <TextMeshProUGUI>();
        scorePlus1             = GameObject.FindGameObjectWithTag("ScoreUpdateTxt").GetComponent <TextMeshProUGUI>();
        tmpScorePlus1          = GameObject.FindGameObjectWithTag("TmpScoreUpdateTxt").GetComponent <TextMeshProUGUI>();
        currentLevelWorldSpace = GameObject.FindGameObjectWithTag("InWorldStats").GetComponentInChildren <TextMeshPro>();
        highScoreTxt           = GameObject.FindGameObjectWithTag("HighScoreTxt").GetComponent <TextMeshProUGUI>();
        //highScoreTxtGO = GameObject.FindGameObjectWithTag("HighScoreTxtGO").GetComponent<TextMeshProUGUI>();
        //lastScoreTxt = GameObject.FindGameObjectWithTag("LastScoreTxt").GetComponent<TextMeshProUGUI>();
        //lastScoreTxtGO = GameObject.FindGameObjectWithTag("LastScoreTxtGO").GetComponent<TextMeshProUGUI>();
    }
 private void Start()
 {
     ui = GameObject.Find("GameController").GetComponent <UiController>();
     gameOverAnimator = GameObject.Find("Canvas-GameOver").GetComponent <Animator>();
     player           = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAndTrampolines>();
 }
Exemplo n.º 3
0
 private void Awake()
 {
     thisBckgr   = GetComponentInChildren <SpriteRenderer>();
     ChangeColor = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAndTrampolines>();
     //print(colorInRow);
 }