// Checks found object for "Shootable" tag // void -> void public void CheckForShootable() { GameObject newObject, oldObject; if (raycastManager.GetCurrentFoundObject()) { newObject = raycastManager.GetCurrentFoundObject(); if (_currentFoundObject != newObject) { _currentFoundObject = newObject; if (_currentFoundObject.tag == "Shootable") { ChangeShapeColor(_currentFoundObject); } } } if (raycastManager.GetPreviousFoundObject()) { oldObject = raycastManager.GetPreviousFoundObject(); if (oldObject.tag == "Shootable") { _previousFoundObject = oldObject; RevertShapeColor(_previousFoundObject); } } }
/* * Checks if current object seen by reticle is an enemy * void -> void */ public void CheckFoundForEnemy() { GameObject currentObject = _raycastManager.GetCurrentFoundObject(); if (currentObject.tag == "Enemy" || currentObject.tag == "Turret" || currentObject.tag == "Glow") { _isEnemy = true; } else { _isEnemy = false; } }
public void TerminateEnemy() { _shotObject = _raycastManager.GetCurrentFoundObject(); StopEnemyActions(); StartCoroutine(FadeEffect()); }