Example #1
0
    public float Visibility(Enemy enemy, float visFactor = 1f)
    {
        // TODO: Fill in
        float clothesFactor = 1;

        if (HasClothes())
        {
            clothesFactor *= clothes.GetVisibilityModifier();
        }

        RaycastHit hit;
        int        valLOS = 0;

        if (Physics.Raycast(enemy.transform.position, (transform.position - enemy.transform.position), out hit))
        {
            if (hit.transform == this.transform)
            {
                valLOS = 1;
            }
        }

        return(valLOS * visFactor * clothesFactor * Mathf.Pow(numBees, .5f));
    }