public void Collect() { ForceFieldBehaviour fieldBehaviour = GameObject.FindObjectOfType <ForceFieldBehaviour>(); if (fieldBehaviour != null) { fieldBehaviour.AddCharges(extraCharges); } Destruct(); }
// Use this for initialization void Start() { forceField = GetComponent <ForceFieldBehaviour> (); }