示例#1
0
        private MightySerializedField CacheSerializedField(FieldInfo field, SerializedProperty property, MightyContext context)
        {
            m_serializedFieldCount++;

            var serializedField = (MightySerializedField)m_membersCache.Add(new MightySerializedField(property, field, context));

            var wrappedAttributes = serializedField.GetWrappedAttributes <BaseMightyAttribute>();

            m_hasOrder = serializedField.CacheOrderDrawerForField(field, wrappedAttributes) || m_hasOrder;

            serializedField.CacheAutoValueDrawerForField(field, wrappedAttributes);

            if ((hideStatus & HideStatus.SerializedFields) == HideStatus.SerializedFields)
            {
                return(serializedField);
            }

            serializedField.CacheShowConditionForMember(field, wrappedAttributes);
            serializedField.CacheEnableConditionForMember(field, wrappedAttributes);

            serializedField.CacheChangeCheckForField(field, wrappedAttributes);
            serializedField.CacheValidatorsForField(field, wrappedAttributes);

            serializedField.CacheGlobalDecoratorsForField(field, wrappedAttributes);

            serializedField.CachePropertyDrawerForField(field, wrappedAttributes);
            serializedField.CacheArrayDrawerForField(field, wrappedAttributes);

            serializedField.CacheSimpleGrouperForField(field, wrappedAttributes);
            serializedField.CacheFoldableGrouperForField(field, wrappedAttributes);

            return(serializedField);
        }
示例#2
0
 private static void CacheComponents(Assembly assembly, Type type)
 {
     for (var i = 0; i < SceneManager.sceneCount; i++)
     {
         foreach (Object obj in type.FindAllObjects(SceneManager.GetSceneAt(i)))
         {
             var mightyType        = (MightyType)MightyTypesCache.Add(new MightyType(type, assembly, obj));
             var wrappedAttributes = mightyType.GetWrappedAttributes <BaseReloadScriptsAttribute>();
             mightyType.CacheReloadScriptForType(type, wrappedAttributes);
         }
     }
 }
示例#3
0
        private static void CacheScenes()
        {
            MightyTypesCache.ClearCache();

            for (var i = 0; i < SceneManager.sceneCount; i++)
            {
                foreach (var monoBehaviour in ReferencesUtilities.FindAllObjects <MonoBehaviour>(SceneManager.GetSceneAt(i)))
                {
                    if (monoBehaviour == null)
                    {
                        continue;
                    }
                    var type = monoBehaviour.GetType();
                    if (!type.HasAttributeOfType <BaseHierarchyAttribute>())
                    {
                        continue;
                    }

                    var mightyComponent =
                        (MightyComponent)MightyTypesCache.Add(new MightyComponent(type, new MightyComponentContext(monoBehaviour)));
                    var wrappedAttributes = mightyComponent.GetWrappedAttributes <BaseHierarchyAttribute>();
                    mightyComponent.CacheHierarchyForType(type, wrappedAttributes);
                }
            }
        }