예제 #1
0
    void Update()
    {
        if (body == BodyType.MovingBody)
        {
            Jump();

            float jumping = isJump ? -jumpSpeed : 1.0f;
            attractor.Attract(myTransform, gravity, jumping, rotationSpeed);
        }
        else
        {
            attractor.Attract(myTransform, gravity, 1.0f, rotationSpeed);
        }
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (Time.timeScale > 0)
     {
         if (useAlternativeGravity)
         {
             attractor.Attract(transform, rig, newGravity);
         }
         else
         {
             attractor.Attract(transform, rig);
         }
     }
 }
예제 #3
0
 void Update()
 {
     if (rotateUpwardGravity)
     {
         attractor.Attract(myTransform, rotateUpwardGravity);
     }
     else if (alwaysFacing)
     {
         attractor.Attract(myTransform, facingDirection);
     }
     else
     {
         attractor.Attract(myTransform, rotateUpwardGravity);
     }
 }
예제 #4
0
 void FixedUpdate()
 {
     if (attractor)
     {
         attractor.Attract(myTransform);
     }
 }
예제 #5
0
 private void Update()
 {
     if (canAttract)
     {
         attracter.Attract(myTransform);
     }
 }
예제 #6
0
    void FixedUpdate()
    {
        if (Config.isPause)
        {
            return;
        }
        if (PlayerCollision.isDie)
        {
            return;
        }

        if (placeOnSurface)
        {
            if (rb != null)
            {
                attractor.PlaceOnSurface(rb);
            }
        }
        else
        {
            if (rb != null)
            {
                attractor.Attract(rb);
            }
        }
    }
예제 #7
0
 // Update is called once per frame
 void Update()
 {
     if (attractor)
     {
         attractor.Attract(myTransform, lockedRotation);
     }
 }
예제 #8
0
    // Update is called once per frame

    void FixedUpdate()
    {
        if (OnPlanet)
        {
            planet.Attract(myTransform, customGravity);
        }
    }
예제 #9
0
    // Update is called once per frame
    void Update()
    {
        switch (Faux)
        {
        case 1:
            attractors1.Attract(myTransform);
            break;

        case 2:
            attractors2.Attract(myTransform);
            break;

        case 3:
            attractors3.Attract(myTransform);
            break;

        case 4:
            attractors4.Attract(myTransform);
            break;

        case 5:
            attractors5.Attract(myTransform);
            break;

        case 6:
            attractors6.Attract(myTransform);
            break;

        default:
            break;
        }
    }
예제 #10
0
 void FixedUpdate()
 {
     if (attractorPlanet)
     {
         attractorPlanet.Attract(bodyTransform);
     }
 }
예제 #11
0
    void Update()
    {
        attractor.Attract(myTransform);



        rb.AddForce(new Vector2(x, y), ForceMode2D.Force);
    }
예제 #12
0
    void FixedUpdate()
    {
        myRigidBody.AddForce(transform.forward * thrust);

        if (attractor)
        {
            attractor.Attract(myTransform);
        }
    }
예제 #13
0
 void FixedUpdate()
 {
     attractor.Attract(myTransform, gravity, rotation);
     if (myRigidBody2D.velocity.magnitude > speedLimit)
     {
         limitSpeed_Strict();
     }
     currentSpeed = myRigidBody2D.velocity.magnitude;
 }
예제 #14
0
 void FixedUpdate()
 {
     if (placeOnSurface)
     {
         attractor.PlaceOnSurface(rb);
     }
     else
     {
         attractor.Attract(rb);
     }
 }
예제 #15
0
    // Update is called once per frame
    void Update()
    {
        attractor.Attract(myTransform);

        /*
         * if (attractor)
         * {
         *  attractor.Attract(myTransform);
         * }
         */
    }
예제 #16
0
 /// <summary>
 /// This function is called every fixed framerate frame, if the MonoBehaviour is enabled.
 /// </summary>
 void FixedUpdate()
 {
     // place the player on surface
     if (placeOnSurface)
     {
         fauxGravityAttractor.PlaceOnSurface(rb);
     }
     else
     {
         fauxGravityAttractor.Attract(rb);
     }
 }
예제 #17
0
 void FixedUpdate()
 //give Component Rigidbody to Attractor
 {
     if (placeOnSurface)
     {
         attractor.PlaceOnSurface(rb);
     }
     else
     {
         attractor.Attract(rb);
     }
 }
예제 #18
0
 // Update is called once per frame
 void Update()
 {
     //if (Input.GetKeyDown(KeyCode.Space) && playerJump.IsGrounded())
     //{
     //    attractor.Jump(m_MyTransform);
     //    //playerJump.Jump();
     //}
     //check that there is something to pull body towards
     if (attractor)
     {
         attractor.Attract(m_MyRigid);
     }
 }
 void Update()
 {
     if (useMultiAttractor)
     {
         for (int i = 1; i < _attractor.Count; i++)
         {
             _attractor[i - 1].GetComponent <FauxGravityAttractor>().Attract(myTransform);
         }
     }
     else
     {
         attractor.Attract(myTransform);
     }
 }
    private void Update()
    {
        gravityUp = attractor.Attract(transform, gravityMultiplier);

        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (GetComponent <PlayerController>() != null)
            {
                Vector3 gravityUp = (transform.position - attractor.transform.position).normalized;
                Vector3 bodyUp    = transform.up;

                GetComponent <Rigidbody>().AddForce(gravityUp * 500.0f);
            }
        }
    }
예제 #21
0
 // Update is called once per frame
 void Update()
 {
     attractor.Attract(currentTransform);
 }
예제 #22
0
 // Update is called once per frame
 void Update()
 {
     attractor.Attract(myTransform);
 }
예제 #23
0
 void FixedUpdate()
 {
     attractor.Attract(_rigidbody);
 }
예제 #24
0
 void FixedUpdate()
 {
     attractor.Attract(_rb);
 }
예제 #25
0
 // Update is called once per frame
 void FixedUpdate()
 {
     attractor.Attract(transform);
 }
예제 #26
0
 // Update is called once per frame
 void Update()
 {
     attractor.Attract(carTransform);
 }
예제 #27
0
 // Update is called once per frame
 void Update()
 {
     attractor.Attract(GetComponent <Transform> ());
 }
예제 #28
0
 void Update()
 {
     _attractor.Attract(rb);
 }
예제 #29
0
 // Update is called once per frame
 void Update()
 {
     Attractor.Attract(planetTransform);
 }
예제 #30
0
 // Update is called once per frame
 void LateUpdate()
 {
     GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeRotation;
     //GetComponent<Rigidbody>().useGravity = true;
     attractor.Attract(transform);
 }