// Start is called before the first frame update
    void Start()
    {
        FindObjectOfType <AudioManager>().Play("People");

        _bgFar   = GameObject.Find("BackgroundFar").GetComponent <BG_Controller>();
        _bgMid   = GameObject.Find("BackgroundMid").GetComponent <BG_Controller2>();
        _bgClose = GameObject.Find("BackgroundClose").GetComponent <BG_Controller3>();
        StartCoroutine(moveGround());
    }
    // Start is called before the first frame update
    void Start()
    {
        _bgFar   = GameObject.Find("BackgroundFar").GetComponent <BG_Controller>();
        _bgMid   = GameObject.Find("BackgroundMid").GetComponent <BG_Controller2>();
        _bgClose = GameObject.Find("BackgroundClose").GetComponent <BG_Controller3>();

        _ground         = GameObject.Find("Ground");
        _groundAnimated = GameObject.Find("GroundAnimated");
        _groundAnimated.SetActive(false);

        _score = GameObject.Find("Timer").GetComponent <Score>();

        //This should not be here
        //_hero = GameObject.Find("Hero").GetComponent<HeroMovement>();
        _heroPrefab = GameObject.Find("Hero");
        _heroPrefab.SetActive(false);

        _car                 = GameObject.Find("Car");
        _hunter              = GameObject.Find("Hunter");
        _hunterSprite        = _hunter.GetComponent <SpriteRenderer>();
        _hand                = GameObject.Find("HunterArm");
        _carAnimator         = GameObject.Find("Car").GetComponent <Animator>();
        _hunterAnimator      = GameObject.Find("Hunter").GetComponent <Animator>();
        _obstaclesController = GameObject.Find("Obstacles").GetComponent <ObstaclesController>();

        //Activate hunter
        _hand.SetActive(false);
        //_hunter.SetActive(false);
        _hunterSprite.enabled = false;
        _car.SetActive(false);

        StartCoroutine(StartGameAfterIntro());
        _deadMenu = GameObject.Find("Canvas").GetComponent <DeadMenu>();

        skipIntroButton = GameObject.Find("SkipIntro");
    }
示例#3
0
 private void Awake()
 {
     instance = this;
 }