private void Start() { cow = FindObjectOfType <Cow>(); pasteurizer = FindObjectOfType <Pasteurizer>(); pail = FindObjectOfType <Pail>(); churner = FindObjectOfType <Churner>(); }
private void OnTriggerEnter2D(Collider2D other) { Pasteurizer pasteurizer = other.GetComponent <Pasteurizer>(); if (pasteurizer != null) { SetFill(false); pasteurizer.MilkDragged(); return; AkSoundEngine.PostEvent("TapCow", gameObject); } Churner churner = other.GetComponent <Churner>(); if (churner != null) { SetFill(false); churner.MilkDragged(); return; } }