コード例 #1
0
    public void Damage(int damage, string boneName)
    {
        base.Damage(damage);
        SpriteRenderer target = null;

        if (boneName.Equals("head"))
        {
        }
        else if (boneName.Equals("Tail"))
        {
        }
        else
        {
            string num = Regex.Replace(boneName, @"\D", "");
            MDebug.Log(boneName);
            int index = int.Parse(num);
            target = m_destroyBoneList[index - 1].m_renderer;

            m_destroyBoneList[index - 1].m_hp -= 1;

            if (m_destroyBoneList[index - 1].m_hp <= 0)
            {
                m_destroyBoneList[index - 1].m_renderer.enabled = true;
                NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonPartDestroy(index - 1));
            }
        }
        NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonHPUdate(m_name, m_hp));
    }