コード例 #1
0
    public void TakeDamage(GameObject go)
    {
        //read in the game object that is hit, disable the corrosponding visual

        if (go.tag == "Head")
        {
            headVisual.SetActive(false);
            fpsPlayer.headNum++;
            fpsPlayer.UpdateScoreUI();
            Destroy(go);
        }
        else if (go.tag == "Torso")
        {
            torsoVisual.SetActive(false);
            fpsPlayer.torsoNum++;
            fpsPlayer.UpdateScoreUI();
            Destroy(go);
        }
        else if (go.tag == "LArm")
        {
            lArmVisual.SetActive(false);
            fpsPlayer.armNum++;
            fpsPlayer.UpdateScoreUI();
            Destroy(go);
        }
        else if (go.tag == "RArm")
        {
            rArmVisual.SetActive(false);
            fpsPlayer.armNum++;
            fpsPlayer.UpdateScoreUI();
            Destroy(go);
        }
        else if (go.tag == "Wheel")
        {
            wheelVisual.SetActive(false);
            fpsPlayer.wheelNum++;
            fpsPlayer.UpdateScoreUI();
            Destroy(go);
        }
    }