private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "Player") { flashLight.RestoreLightAngle(75f); flashLight.RestoreLightIntensity(4f); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { myLightSystem = FindObjectOfType <FlashLightSystem>(); //myLightSystem = other.GetComponent<FlashLightSystem>(); myLightSystem.RestoreLightAngle(); myLightSystem.RestoreLightIntensity(intensityRestore); Destroy(gameObject); } }