Ejemplo n.º 1
0
 /// <summary> `BuildFromCollision2D` builds a new `Direction` by using a `Collision2D` value. </summary>
 /// <param name="collision"> The `Collision2D` used in building this new direction. </param>
 public static Direction BuildFromCollision2D(Collision2D collision)
 {
     return(DirectionGenerator.BuildFromRigidbody2D(collision.rigidbody));
 }
Ejemplo n.º 2
0
 public static Direction BuildFromRigidbody2D(Rigidbody2D rigidbody2D)
 {
     return(DirectionGenerator.BuildFromPosition(rigidbody2D.position));
 }
Ejemplo n.º 3
0
 void Start()
 {
     this.hitbox          = GetComponent <Rigidbody2D>();
     this.direction       = DirectionGenerator.BuildFromRigidbody2D(this.hitbox);
     this.directionVector = VectorGenerator.fromDirection(this.direction);
 }