void EnemyRaycastCheck() {
streakScriptReference.HandleStreakBar();
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Input.GetMouseButtonDown(0)) {
if (Physics.Raycast(ray, out RaycastHit hit, Mathf.Infinity, enemyLayerMask2D)) {
adrenaline++;
adrenalineScriptReference.SetAdrenaline(adrenaline);
adrenalineScriptReference.ImproveAdrenalineBar();
hitEnemy2D = hit.transform.GetComponent<Enemy2D>();
hitEnemy2D.ReduceHealth();
if (hitEnemy2D.GetHealth() == 0) {
Destroy(hitEnemy2D.gameObject);
}
streakScriptReference.ScorePlus();
} else if (Physics.Raycast(ray, out hit, Mathf.Infinity, enemyLayerMask3D)) {
adrenalineScriptReference.DeclineAdrenalineBar();
streakScriptReference.ResetStreak();
}
}
if (Input.GetMouseButtonDown(1)) {
if (Physics.Raycast(ray, out RaycastHit hit, Mathf.Infinity, enemyLayerMask3D)) {
adrenaline++;
adrenalineScriptReference.SetAdrenaline(adrenaline);
adrenalineScriptReference.ImproveAdrenalineBar();
hitEnemy3D = hit.transform.GetComponent<Enemy3D>();
hitEnemy3D.ReduceHealth();
if (hitEnemy3D.GetHealth() == 0) {
Destroy(hitEnemy3D.gameObject);
}
streakScriptReference.ScorePlus();
} else if (Physics.Raycast(ray, out hit, Mathf.Infinity, enemyLayerMask2D)) {
adrenalineScriptReference.DeclineAdrenalineBar();
}
}
}