Exemplo n.º 1
0
    //Generate force field
    public void push(Fish f)
    {
        Vector3 force    = f.position - position;
        float   distance = force.sqrMagnitude;

        if (distance < aoe)
        {
            f.AddForce(force.normalized * (1 + aoe / Mathf.Abs(distance - (radius * radius))));
        }
    }