示例#1
0
        /// <summary>
        /// Draw the details of the selected module (below the list)
        /// </summary>
        /// <param name="rItem"></param>
        /// <returns></returns>
        private bool DrawModuleDetailItem(SetupModule rItem)
        {
            bool lIsDirty = false;

            if (rItem == null)
            {
                EditorGUILayout.LabelField("NULL");
                return(false);
            }

            Type lType = rItem.GetType();

            EditorGUI.BeginDisabledGroup(lType == typeof(UndefinedSetupModule));
            if (rItem.Name.Length > 0)
            {
                EditorHelper.DrawSmallTitle(rItem.Name.Length > 0 ? rItem.Name : "Module");
            }
            else
            {
                string lName = ModuleNameAttribute.GetName(rItem.GetType());
                EditorHelper.DrawSmallTitle(lName.Length > 0 ? lName : "Module");
            }

            string lDescription = ModuleDescriptionAttribute.GetDescription(rItem.GetType());

            if (lDescription.Length > 0)
            {
                EditorHelper.DrawInspectorDescription(lDescription, MessageType.None);
            }

            // Draw the Inspector for the individual module
            bool lModuleDirty = rItem.OnInspectorGUI(mTarget);

            if (lModuleDirty)
            {
                lIsDirty = true;
            }

            EditorGUI.EndDisabledGroup();

            if (lIsDirty)
            {
                UpdateModuleDefinition(mModuleList.index, rItem);
            }

            return(lIsDirty);
        }
示例#2
0
        /// <summary>
        /// Scan all assemblies for Character Wizard Modules
        /// </summary>
        private void FindModuleTypes()
        {
            var lFoundTypes = AssemblyHelper.FoundTypes;

            foreach (Type lType in lFoundTypes)
            {
                if (lType.IsAbstract)
                {
                    continue;
                }
                if (typeof(SetupModule).IsAssignableFrom(lType) &&
                    !HideModuleAttribute.GetHidden(lType))
                {
                    mModuleTypes.Add(lType);
                    mModuleNames.Add(ModuleNameAttribute.GetName(lType));
                }
            }
        }