Example #1
0
 void FixedUpdate()
 {
     if (Attractor)
     {
         Attractor.Attract(this);
     }
 }
    // 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();
    }
Example #3
0
 void Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args)
 {
     foreach (var ball in bouncingBalls)
     {
         var vv = attractor.Attract(ball);
         ball.Force(vv);
         ball.Update(sender.Size);
     }
 }
    // 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();
    }
Example #5
0
 // Update is called once per frame
 void Update()
 {
     if (attractor != null)
     {
         attractor.Attract(gameObject.transform);
     }
     else
     {
         // GetComponent<Rigidbody2D>().velocity = new Vector2(0, 0);
     }
 }
Example #6
0
 void Update()
 {
     if (isOnAttactor)
     {
         print("is on attractor");
         attractor.Attract(m_transform);
     }
     else
     {
         print("is off");
     }
 }
 private void FixedUpdate()
 {
     attractor.Attract(rb);
 }
 // Update is called once per frame
 void Update()
 {
     attractor.Attract(myTransform);
 }