public void Save(ref LusuoStream ls) { //Debug.Log("模型自身保存数据"); ls.WriteInt(m_resID); ls.WriteString(m_strName); ls.WriteVector3(m_vPos.x, m_vPos.y, m_vPos.z); ls.WriteVector3(m_vRotate.x, m_vRotate.y, m_vRotate.z); ls.WriteVector3(m_vScale.x, m_vScale.y, m_vScale.z); ls.WriteBool(m_bStatic); // 读取子模型个数,遍历写入个数,索引,和偏移 ls.WriteInt(m_lightMapIndexNum); for (int i = 0; i < m_lightMapIndexNum; i++) { ls.WriteInt(m_lightMapIndex[i]); } for (int i = 0; i < m_lightMapIndexNum; i++) { ls.WriteVector4(ref m_lightMapScaleOffset[i]); } // 写入环境音效 ls.WriteInt(m_envSoundNum); for (int i = 0; i < m_envSoundNum; i++) { ls.WriteInt(m_envSoundResId[i]); } }