Beispiel #1
0
    void OnCollisionEnter2D(Collision2D collision)
    {
        NPlayerController np = collision.collider.gameObject.GetComponent <NPlayerController>();
        NWeapon           w  = collision.collider.gameObject.GetComponent <NWeapon>();

        if (np != null)
        {
            if (!np.GetMovementBool("pushed"))
            {
                np.HitByAir(-collision.contacts[0].normal);
            }
            if (!collided)
            {
                IEnumerator coroutine = Explosion(false);
                StartCoroutine(coroutine);
            }
        }
        if (w != null)
        {
            w.HitByAir(-collision.contacts[0].normal, wielder);
            if (!collided)
            {
                IEnumerator coroutine = Explosion(false);
                StartCoroutine(coroutine);
            }
        }
        else if (collision.collider.gameObject.layer.Equals(LayerMask.NameToLayer("Platforms")))
        {
            if (!collided)
            {
                IEnumerator coroutine = Explosion(true);
                StartCoroutine(coroutine);
            }
        }
    }
Beispiel #2
0
 public bool GetBool(string s)
 {
     return(player.GetMovementBool(s));
 }