예제 #1
0
 void initializeParameters()
 {
     enemyAI           = GetComponentInParent <EnemyAI> ();
     initialLightRange = IsMovable.getLightRange();
     sightDistance     = initialSightDistance;
     onLight           = false;
 }
예제 #2
0
    void forceUpdateSightDistance()
    {
        sightDistance = ((IsMovable.getLightRange() - initialLightRange) * sightIncreaseRate) + initialSightDistance;

        if (sightDistance > finalSightDistance)
        {
            sightDistance = finalSightDistance;
        }
    }
예제 #3
0
    void updateIndicatorSize()
    {
        Vector3 scale = transform.localScale;

        float yScale = finalImageScale * ((IsMovable.getLightRange() - minimumLightRange) / (maximumLightRange - minimumLightRange));

        scale.y = yScale;

        transform.localScale = scale;
    }
예제 #4
0
    void autoTurnOffVisualCue()
    {
        if (lightRange <= IsMovable.getLightRange() && visualCue.activeSelf)
        {
            visualCue.SetActive(false);
        }

        if (lightRange > IsMovable.getLightRange() && !visualCue.activeSelf)
        {
            visualCue.SetActive(true);
        }
    }
예제 #5
0
    void updateSightDistance()
    {
        if (IsMovable.getLightRange() - initialLightRange > 0)
        {
            sightDistance = ((IsMovable.getLightRange() - initialLightRange) * sightIncreaseRate) + initialSightDistance;

            if (sightDistance > finalSightDistance)
            {
                sightDistance = finalSightDistance;
            }
        }

        if (onLight && sightDistance < lightRange)
        {
            sightDistance = lightRange;
        }
    }