void Start() { var player = GameObject.FindGameObjectWithTag(GameTags.Player); _trackedObject = player.transform; _bac = player.GetComponent <BloodAlcohol>(); }
// Use this for initialization void Start() { _image = GetComponent <Image>(); _bac = bacObject.GetComponent <BloodAlcohol>(); _bac.OnDrink.AddListener(() => _image.fillAmount = _bac.Current); }
void Start() { _health = GetComponent <Health>(); _bac = GetComponent <BloodAlcohol>(); _combat = GetComponent <PlayerCombat>(); _charController = GetComponent <CharacterController>(); _animator = GetComponentInChildren <Animator>(); _sfx = GameObject.FindGameObjectWithTag(GameTags.Music).GetComponent <SfxManager>(); _health.OnDeath.AddListener(Die); }