public void GetTypes_ReturnsOnly_NonAbstractSubTypes()
        {
            var types = AddressableAssetUtility.GetTypes(typeof(TestBaseClass));

            Assert.AreEqual(1, types.Count);
            Assert.AreEqual(types[0], typeof(TestSubClass));
        }
Пример #2
0
        void OnEnable()
        {
            // Single group editing
            if (targets.Length == 1)
            {
                m_GroupTarget = target as AddressableAssetGroup;
            }
//            // Multi-group editing
//            if (targets.Length > 1)
//            {
//                m_GroupTargets = new AddressableAssetGroup[targets.Length];
//                for(int i = 0; i < targets.Length; i++)
//                {
//                    m_GroupTargets[i] = targets[i] as AddressableAssetGroup;
//                }
//                // use item with largest index as base
//                m_GroupTarget = m_GroupTargets[m_GroupTargets.Length - 1];
//                InitializeMultiSelectGroupSchemas();
//            }

            if (m_GroupTarget != null)
            {
                m_GroupTarget.Settings.OnModification += OnSettingsModification;
                m_SchemaTypes  = AddressableAssetUtility.GetTypes <AddressableAssetGroupSchema>();
                m_FoldoutState = new bool[m_GroupTarget.Schemas.Count];
            }

            for (int i = 0; i < m_FoldoutState.Length; i++)
            {
                m_FoldoutState[i] = true;
            }
        }
Пример #3
0
        static List <Type> GetTypes(FieldInfo fieldInfo)
        {
            var attrs = fieldInfo.GetCustomAttributes(typeof(SerializedTypeRestrictionAttribute), false);

            if (attrs.Length == 0 || !(attrs[0] is SerializedTypeRestrictionAttribute))
            {
                return(null);
            }
            return(AddressableAssetUtility.GetTypes((attrs[0] as SerializedTypeRestrictionAttribute).type));
        }
Пример #4
0
        void OnEnable()
        {
            m_AddressableAssetGroupTarget = target as AddressableAssetGroupTemplate;

            if (m_AddressableAssetGroupTarget != null)
            {
                m_SchemaTypes  = AddressableAssetUtility.GetTypes <AddressableAssetGroupSchema>();
                m_FoldoutState = new bool[m_AddressableAssetGroupTarget.SchemaObjects.Count];
            }

            for (int i = 0; i < m_FoldoutState.Length; i++)
            {
                m_FoldoutState[i] = true;
            }
        }
Пример #5
0
        void OnEnable()
        {
            m_GroupTarget = target as AddressableAssetGroup;
            if (m_GroupTarget != null)
            {
                m_GroupTarget.Settings.OnModification += OnSettingsModification;
                m_SchemaTypes  = AddressableAssetUtility.GetTypes <AddressableAssetGroupSchema>();
                m_FoldoutState = new bool[m_GroupTarget.Schemas.Count];
            }

            for (int i = 0; i < m_FoldoutState.Length; i++)
            {
                m_FoldoutState[i] = true;
            }
        }
        void OnEnable()
        {
            m_GroupTargets = new AddressableAssetGroup[targets.Length];
            for (int i = 0; i < targets.Length; i++)
            {
                m_GroupTargets[i] = targets[i] as AddressableAssetGroup;
            }

            // use item with largest index as base
            m_GroupTarget = m_GroupTargets[m_GroupTargets.Length - 1];

            if (m_GroupTarget != null)
            {
                m_GroupTarget.Settings.OnModification += OnSettingsModification;
                m_SchemaTypes  = AddressableAssetUtility.GetTypes <AddressableAssetGroupSchema>();
                m_FoldoutState = new bool[m_GroupTarget.Schemas.Count];
            }

            for (int i = 0; i < m_FoldoutState.Length; i++)
            {
                m_FoldoutState[i] = true;
            }
        }