Beispiel #1
0
    void Start()
    {
        GetInitialEntities();
        GenerateBounds();
        GenerateBuildings();

        scoreCounter.UpdateLabel(score);
        grid.CreateGrid();
        audioManager = GameObject.Find("Audio Manager").GetComponent <AudioManager>();

        StartCoroutine(StartGame());
    }
Beispiel #2
0
    void Start()
    {
        Cursor.visible = false;
        rigidbody      = GetComponent <Rigidbody2D>();
        feetAnimator   = feet.GetComponent <Animator>();
        audioSource    = GetComponent <AudioSource>();
        entity         = GetComponent <Entity>();

        soulCounter.UpdateLabel(souls);
        ammoCounter.UpdateLabel(weapon.ammo);
        healthCounter.UpdateLabel(entity.health);

        ammoBar.transform.localScale = new Vector3(Mathf.Clamp(weapon.ammo * 4, 0, 64), 1, 1);

        gameManager  = GameObject.Find("Game Manager").GetComponent <GameManager>();
        audioManager = GameObject.Find("Audio Manager").GetComponent <AudioManager>();
        bgController = GameObject.Find("Background").GetComponent <BackgroundController>();

        entity.deathEvent  += OnDeath;
        entity.damageEvent += OnDamage;

        StartCoroutine(BleedUpdate());
    }