コード例 #1
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        GameObject box     = coll.gameObject;
        BoxType    boxType = box.GetComponent <BoxType>();

        if (type != boxType.type)
        {
            livesController.getHit();
            print("wrong box");
        }
        else
        {
            scoreController.addScorePoint();
            print("right box");
        }
    }