コード例 #1
0
    void OnTriggerEnter2D(Collider2D touched)
    {
        if (touched.gameObject.tag == "Paper Token")
        {
            rps.addToStack("Paper");
            sui.thirdSlotCheck();
            ts.paperGone = true;
            Destroy(touched.gameObject);
        }

        if (touched.gameObject.tag == "Rock Token")
        {
            rps.addToStack("Rock");
            sui.thirdSlotCheck();
            ts.rockGone = true;
            Destroy(touched.gameObject);
        }

        if (touched.gameObject.tag == "Scissors Token")
        {
            rps.addToStack("Scissors");
            sui.thirdSlotCheck();
            ts.scissorsGone = true;
            Destroy(touched.gameObject);
        }
    }