UnityEngine.Rigidbody2D.AddRelativeForce C# (CSharp) 메소드

AddRelativeForce() 공개 메소드

Adds a force to the rigidbody2D relative to its coordinate system.

public AddRelativeForce ( Vector2 relativeForce, [ mode ) : void
relativeForce Vector2 Components of the force in the X and Y axes.
mode [ The method used to apply the specified force.
리턴 void
        public void AddRelativeForce(Vector2 relativeForce, [DefaultValue("ForceMode2D.Force")] ForceMode2D mode)
        {
            INTERNAL_CALL_AddRelativeForce(this, ref relativeForce, mode);
        }

Usage Example

예제 #1
0
파일: Bullet.cs 프로젝트: EduBeziaco/2Dgame
 // Use this for initialization
 void Start()
 {
     r2d = GetComponent<Rigidbody2D> ();
     if(Movimentacao.left){
         r2d.AddRelativeForce (new Vector2 (-speed, 0));
     }else{
         r2d.AddRelativeForce (new Vector2 (speed, 0));
     }
 }
All Usage Examples Of UnityEngine.Rigidbody2D::AddRelativeForce