예제 #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        BlockController blockController = GameObject.Find("Player").GetComponent <BlockController>();

        if (blockController.isGameEnd)
        {
            return;
        }
        Debug.Log(this.name + " trigger with " + other.name);
        if (other.GetComponent <BlockCollide>() == null)
        {
            if (other.name == "Death")
            {
                blockController.gameEnd();
                return;
            }
            blockController.ColliderWith(other.transform, other.GetComponent <Block>().isFalling);
        }
    }