Esempio n. 1
0
    protected void SpritePushback(object sender, System.EventArgs e)
    {
        if (!canAct || boxCollider == null)
        {
            return;
        }
        Debug.Log("Pushback");
        PlayerCollisionArgs arg = (PlayerCollisionArgs)e;

        bIsPushBack    = true;
        perpDirection  = (Vector2)(boxCollider.transform.position - arg.direction) * arg.pushbackValue;
        perpDirection += (Vector2)boxCollider.transform.position;
        pushbackSpeed  = arg.pushbackValue;

        SpriteRenderer[] sprites = GetComponentsInChildren <SpriteRenderer>();
        StartCoroutine(SpriteFlash(sprites, invulnFlashes, startingFlashCD));
        StartCoroutine(SpriteSlideBack());
    }
Esempio n. 2
0
 public static void PlayerCollision(object sender, PlayerCollisionArgs eventArgs)
 {
     OnPlayerCollision(sender, eventArgs);
 }