コード例 #1
0
        // This is called when performing Undo operations.
        // It needs to be called here since some operations are not
        // allowed (EditorUtility.InstanceIDToObject, for example)
        // during the ISerializationCallbackReceiver methods.
        void OnValidate()
        {
            if (m_SerializedPath == null || m_WindowState == null || m_WindowState.GetWindow() == null)
            {
                return;
            }

            bool hasDifferentRoot = m_WindowState.GetCurrentSequencePath().selectionRoot != m_SerializedPath.selectionRoot;

            if (m_WindowState.GetWindow().locked&& hasDifferentRoot)
            {
                return;
            }
            m_WindowState.SetCurrentSequencePath(m_SerializedPath, true);
        }