private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { myLightSystem = FindObjectOfType <FlashLightSystem>(); //myLightSystem = other.GetComponent<FlashLightSystem>(); myLightSystem.RestoreLightAngle(); myLightSystem.RestoreLightIntensity(intensityRestore); Destroy(gameObject); } }
// Start is called before the first frame update void Start() { flashLight = FindObjectOfType <FlashLightSystem>(); }