Exemple #1
0
    private Vector3 GetForce(Vector3 pos, ref bool collided)
    {
        Vector3 dest = Vector3.zero;

        foreach (AGravitational gravityField in SceneObjectManager.FindCachedObjectsOfType <AGravitational>())
        {
            dest += gravityField.GetForceOnPoint(pos);
            if (Vector3.Distance(gravityField.transform.position, pos) < 1.0f)
            {
                collided = true;
            }
        }
        return(dest);
    }