コード例 #1
0
        internal void ClearSerializedData()
        {
#if UNITY_EDITOR
            if (!UnityEditor.EditorApplication.isPlaying)
            {
                if (Serialized)
                {
                    m_serializedGeometry.EraseFromDisk();
                }
            }

            m_serializedGeometry = null;
#endif
        }
コード例 #2
0
        internal void Serialize()
        {
#if UNITY_EDITOR
            if (Model == null)
            {
                SoundToolKitDebug.LogWarning("Cannot serialize MeshCluster: " + name + "'s geometry data." +
                                             " No internal SoundToolKitModel exists for that Cluster.");
                return;
            }

            ClearSerializedData();
            m_serializedGeometry = MeshClusterUtility.CreateSerializedGeometry(name + "_SerializedGeometry");
            Model.SaveGeometry(data => m_serializedGeometry.WriteData(name, data));
            SoundToolKitManager.Instance.Finish();

            m_playSessionGeometry = m_serializedGeometry;

            UnityEditor.EditorUtility.SetDirty(this);
            UnityEditor.AssetDatabase.SaveAssets();
            UnityEditor.AssetDatabase.Refresh();
#endif
        }
コード例 #3
0
 internal void RestoreStateForEditmode()
 {
     AcousticMeshNames    = m_playSessionMeshes;
     m_serializedGeometry = m_playSessionGeometry;
 }