// Update is called once per frame
    void FixedUpdate()
    {
        Vector2 force = a.Attract(m.body); // Apply the attraction from the Attractor on the Mover

        m.ApplyForce(force);
        m.Update();
        a.Update();
    }
예제 #2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        Vector3 force      = a.Attract(m.body); // Apply the attraction from the Attractor on the Mover
        Vector3 repelForce = a.Repelling(m.body);

        a.ApplyRepel(repelForce);
        m.ApplyForce(force);
        m.Update();
        a.Update();
    }