void initializeParameters() { enemyAI = GetComponentInParent <EnemyAI> (); initialLightRange = IsMovable.getLightRange(); sightDistance = initialSightDistance; onLight = false; }
void forceUpdateSightDistance() { sightDistance = ((IsMovable.getLightRange() - initialLightRange) * sightIncreaseRate) + initialSightDistance; if (sightDistance > finalSightDistance) { sightDistance = finalSightDistance; } }
void updateIndicatorSize() { Vector3 scale = transform.localScale; float yScale = finalImageScale * ((IsMovable.getLightRange() - minimumLightRange) / (maximumLightRange - minimumLightRange)); scale.y = yScale; transform.localScale = scale; }
void autoTurnOffVisualCue() { if (lightRange <= IsMovable.getLightRange() && visualCue.activeSelf) { visualCue.SetActive(false); } if (lightRange > IsMovable.getLightRange() && !visualCue.activeSelf) { visualCue.SetActive(true); } }
void updateSightDistance() { if (IsMovable.getLightRange() - initialLightRange > 0) { sightDistance = ((IsMovable.getLightRange() - initialLightRange) * sightIncreaseRate) + initialSightDistance; if (sightDistance > finalSightDistance) { sightDistance = finalSightDistance; } } if (onLight && sightDistance < lightRange) { sightDistance = lightRange; } }