Example #1
0
        bool AvatarCopyIsUpToDate()
        {
            if (!(animationType == ModelImporterAnimationType.Human || animationType == ModelImporterAnimationType.Generic) || m_AvatarSource.objectReferenceValue == null)
            {
                return(true);
            }

            SerializedProperty humanDescription = serializedObject.FindProperty("m_HumanDescription");

            //Because of the constraint that Editors must share an Animation Source, if we have a mix of different human descriptions, then *at least* one is out of date
            if (humanDescription.hasMultipleDifferentValues)
            {
                return(false);
            }

            //Does the HumanDescription in the Importer match the one in the referenced Avatar?
            return(SerializedProperty.DataEquals(humanDescription, avatarSourceSerializedObject.FindProperty("m_HumanDescription")));
        }
        public bool MaskNeedsUpdating()
        {
            AvatarMask mask = maskSource;

            if (mask == null)
            {
                return(false);
            }

            using (SerializedObject source = new SerializedObject(mask))
            {
                if (!SerializedProperty.DataEquals(bodyMaskProperty, source.FindProperty("m_Mask")))
                {
                    return(true);
                }

                if (!SerializedProperty.DataEquals(transformMaskProperty, source.FindProperty("m_Elements")))
                {
                    return(true);
                }
            }

            return(false);
        }