Ejemplo n.º 1
0
 // call this sustained.
 public void SnapToSnapPosition(Vector2 pos, bool _snapping)
 {
     if (_snapping)
     {
         snappedToPosition = true;
         controller.Snap(pos);
     }
     else
     {
         controller.StopSnapBraking("SnapToSnapPosition");
     }
 }
Ejemplo n.º 2
0
    protected void Hit()
    {
        //Debug.Log("Hit registered at " + Time.time);
        Rigidbody2D KoRB2D = Ko.GetComponent <Rigidbody2D>();

        KoRB2D.AddForce((hitImpulseBasePower + originalDistanceToKo) * toKo, ForceMode2D.Impulse);
        Vector2 v2 = new Vector2(-toKo.x, -toKo.y);

        rb2d.AddForceAtPosition((hitImpulseBasePower + originalDistanceToKo) * v2 * 10, rb2d.position + Vector2.down * .1f, ForceMode2D.Impulse);
        resetTimer.Start();
        //Debug.LogError("should stop now.");
        controller.Freeze(.5f);
        hit   = true;
        sawKo = false;
        controller.StopSnapBraking("BodySlamEffect");
        audioSource.Play();
        Finale();
    }