void BounceThemBack() { if (fox != null) { fox.GetComponent <PickupableObject>().BounceItemBack(); } if (hen != null) { hen.GetComponent <PickupableObject>().BounceItemBack(); } if (grain != null) { grain.GetComponent <PickupableObject>().BounceItemBack(); } }
void Start() { _fxFoxBackground = _fxFoxBackground.GetComponent <FoxController> (); _fxFoxForeground = _fxFoxForeground.GetComponent <FoxController> (); dragDistances = Screen.height * 20 / 100; // dragDistance is 20% heigh of the screen Canvas.SetActive(false); GameOver.SetActive(false); AudioSource source_fxFoxBackground = GetComponent <AudioSource>(); AudioSource source_fxFoxForeground = GetComponent <AudioSource>(); }