Example #1
0
 public void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         ActionUtilities.GetSpikeAction()(col.gameObject.GetComponent <PlayerDeath>());
     }
 }
Example #2
0
 public void OnCollisionStay2D(Collision2D col)
 {
     if (isDeadly && col.gameObject.tag == "Player")
     {
         ActionUtilities.GetDeadlyPlatformAction()(col.gameObject.GetComponent <PlayerDeath>());
     }
 }
Example #3
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         ActionUtilities.GetBombAction()(collision.gameObject.GetComponent <PlayerDeath>());
     }
 }
Example #4
0
    public void OnCollisionEnter2D(Collision2D col)
    {
        if (col.gameObject.tag == "Player")
        {
            if (isPlatformWin)
            {
                if (!hasBeenTouched)
                {
                    spriteRenderer.color = col.gameObject.GetComponent <SpriteRenderer>().color;
                    WinController.instance.CheckWinCondition(gameObject, col.gameObject);
                }
                hasBeenTouched = true;
            }

            if (isDeadly)
            {
                ActionUtilities.GetDeadlyPlatformAction()(col.gameObject.GetComponent <PlayerDeath>());
            }
        }
    }