protected override void RefreshFields()
        {
            Type type = typeof(CharacterController);

            if (Instances == null || Instances.Length == 0)
            {
                return;
            }

            SerializedObject so = new SerializedObject(Instances.Cast <UnityEngine.Object>().ToArray());

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("slopeLimit"),
                                          new DescriptorAttribute("Slope Limit", "The character controllers slope limit in degrees.", "http://docs.unity3d.com/ScriptReference/CharacterController-slopeLimit.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("stepOffset"),
                                          new DescriptorAttribute("Step Offset", "The character controllers step offset in meters.", "http://docs.unity3d.com/ScriptReference/CharacterController-stepOffset.html")));
            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_SkinWidth"),
                                          new DescriptorAttribute("Skin Width", "The thickness of the interpenetration of this capsule.", "")));
            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_MinMoveDistance"),
                                          new DescriptorAttribute("Min Move Distance", "The smallest distance required for the character to move.", "")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("center"),
                                          new DescriptorAttribute("Center", "The center of the character's capsule relative to the transform's position.", "http://docs.unity3d.com/ScriptReference/CharacterController-center.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("radius"),
                                          new DescriptorAttribute("Radius", "The radius of the character's capsule.", "http://docs.unity3d.com/ScriptReference/CharacterController-radius.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("height"),
                                          new DescriptorAttribute("Height", "The height of the character's capsule.", "http://docs.unity3d.com/ScriptReference/CharacterController-height.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("detectCollisions"), new InspectAttribute(InspectorLevel.Advanced),
                                          new DescriptorAttribute("Detect Collisions", "Determines whether other rigidbodies or character controllers collide with this character controller (by default this is always enabled).", "http://docs.unity3d.com/ScriptReference/CharacterController-detectCollisions.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("isGrounded"), new InspectAttribute(InspectorLevel.Advanced),
                                          new DescriptorAttribute("Is Grounded", "Was the CharacterController touching the ground during the last move?", "http://docs.unity3d.com/ScriptReference/CharacterController-isGrounded.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("collisionFlags"), new InspectAttribute(InspectorLevel.Advanced),
                                          new DescriptorAttribute("Collision Flags", "What part of the capsule collided with the environment during the last CharacterController.Move call.", "http://docs.unity3d.com/ScriptReference/CharacterController-collisionFlags.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("velocity"), new InspectAttribute(InspectorLevel.Advanced),
                                          new DescriptorAttribute("Velocity", "The current relative velocity of the Character (see notes).", "http://docs.unity3d.com/ScriptReference/CharacterController-velocity.html")));
        }
예제 #2
0
        protected override void RefreshFields()
        {
            Type type = typeof(Animation);

            if (Instances == null || Instances.Length == 0)
            {
                return;
            }

            SerializedObject so = new SerializedObject(Instances.Cast <UnityEngine.Object>().ToArray());

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("clip"),
                                          new DescriptorAttribute("Animation", "The default animation.", "http://docs.unity3d.com/ScriptReference/Animation-clip.html")));
            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_Animations"),
                                          new DescriptorAttribute("Animations", "")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("playAutomatically"),
                                          new DescriptorAttribute("Play Automatically", "Should the default animation clip (Animation.clip) automatically start playing on startup.", "http://docs.unity3d.com/ScriptReference/Animation-playAutomatically.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("animatePhysics"),
                                          new DescriptorAttribute("Animate Physic", "When turned on, animations will be executed in the physics loop. This is only useful in conjunction with kinematic rigidbodies.", "http://docs.unity3d.com/ScriptReference/Animation-animatePhysics.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("cullingType"),
                                          new DescriptorAttribute("Culling Type", "Controls culling of this Animation component.", "http://docs.unity3d.com/ScriptReference/Animation-cullingType.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("isPlaying"), new InspectAttribute(InspectorLevel.Advanced),
                                          new DescriptorAttribute("Is Playing", "Are we playing any animations?", "http://docs.unity3d.com/ScriptReference/Animation-isPlaying.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("localBounds"), new InspectAttribute(InspectorLevel.Advanced),
                                          new DescriptorAttribute("Bounds", "AABB of this Animation animation component in local space.", "http://docs.unity3d.com/ScriptReference/Animation-localBounds.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("wrapMode"), new InspectAttribute(InspectorLevel.Advanced),
                                          new DescriptorAttribute("Wrap Mode", "How should time beyond the playback range of the clip be treated?", "http://docs.unity3d.com/ScriptReference/Animation-wrapMode.html")));
        }
예제 #3
0
 /// <summary>
 /// Apply the configuration information in this element to the
 /// given <paramref name="container"/>.
 /// </summary>
 /// <param name="container">Container to configure.</param>
 internal void ConfigureContainer(IUnityContainer container)
 {
     Extensions.Cast <ContainerConfiguringElement>()
     .Concat(Registrations.Cast <ContainerConfiguringElement>())
     .Concat(Instances.Cast <ContainerConfiguringElement>())
     .Concat(ConfiguringElements)
     .ForEach(element => element.ConfigureContainerInternal(container));
 }
예제 #4
0
 /// <summary>
 /// Apply the configuration information in this element to the
 /// given <paramref name="container"/>.
 /// </summary>
 /// <param name="container">Container to configure.</param>
 internal void ConfigureContainer(IUnityContainer container)
 {
     foreach (var element in Extensions.Cast <ContainerConfiguringElement>()
              .Concat(Registrations.Cast <ContainerConfiguringElement>())
              .Concat(Instances.Cast <ContainerConfiguringElement>())
              .Concat(ConfiguringElements))
     {
         element.ConfigureContainerInternal(container);
     }
 }
예제 #5
0
파일: PropertyGrid.cs 프로젝트: brobits/ATF
        /// <summary>
        /// Reloads all PropertyNodes in PropertyGrid, recreating all PropertyNodes</summary>
        protected virtual void Reload()
        {
            // Destroy and unsubscribe from old properties
            if (Properties != null)
            {
                foreach (PropertyNode node in Properties)
                {
                    node.UnBind();
                    node.ValueSet   -= new EventHandler(node_ValueSet);
                    node.ValueError -= new EventHandler(node_ValueError);
                }
            }

            object[] instances = Instances.Cast <object>().ToArray();

            // TODO: cache and reuse PropertyNodes where possible to prevent having to
            // rebuild all of the data templates
            IEnumerable <PropertyDescriptor> descriptors = null;

            if (CustomPropertyDescriptors != null)
            {
                descriptors = CustomPropertyDescriptors;
            }
            else if (Instances != null)
            {
                descriptors = PropertyUtils.GetSharedProperties(instances);
            }

            var propertyNodes = new ObservableCollection <PropertyNode>();

            foreach (var descriptor in descriptors)
            {
                if (descriptor.IsBrowsable)
                {
                    PropertyNode node = null;
                    if (PropertyFactory != null)
                    {
                        node = PropertyFactory.CreateProperty(instances, descriptor, true, this);
                    }
                    else
                    {
                        node = new PropertyNode(instances, descriptor, true, this);
                    }

                    node.ValueSet   += new EventHandler(node_ValueSet);
                    node.ValueError += new EventHandler(node_ValueError);
                    propertyNodes.Add(node);
                }
            }

            Properties = propertyNodes;
        }
        protected override void RefreshFields()
        {
            Type type = typeof(TerrainCollider);

            if (Instances == null || Instances.Length == 0)
            {
                return;
            }

            SerializedObject so = new SerializedObject(Instances.Cast <UnityEngine.Object>().ToArray());

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("material"),
                                          new DescriptorAttribute("Material", "The material used by the collider.", "http://docs.unity3d.com/ScriptReference/Collider-material.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("terrainData"),
                                          new DescriptorAttribute("Terrain Data", "The terrain that stores the heightmap.", "http://docs.unity3d.com/ScriptReference/TerrainCollider-terrainData.html")));
            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_EnableTreeColliders"),
                                          new DescriptorAttribute("Enable Tree Colliders", "", "")));
        }
예제 #7
0
        protected override void RefreshFields()
        {
            Type type = typeof(Light);

            if (Instances == null || Instances.Length == 0)
            {
                return;
            }

            SerializedObject so = new SerializedObject(Instances.Cast <UnityEngine.Object>().ToArray());

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("type"),
                                          new DescriptorAttribute("Type", "The type of the light.", "http://docs.unity3d.com/ScriptReference/Light-type.html")));

            m_Lightmapping = so.FindProperty("m_Lightmapping");
            Fields.Add(new InspectorField(type, Instances, m_Lightmapping,
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsNotArea)),
                                          new RestrictAttribute(new RestrictAttribute.RestrictDelegate(Baking)),
                                          new DescriptorAttribute("Baking", "How the light is handled versus lightmaps.")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("range"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsPointOrSpot)),
                                          new DescriptorAttribute("Range", "The range of the light.", "http://docs.unity3d.com/ScriptReference/Light-range.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("spotAngle"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsSpot)),
                                          new DescriptorAttribute("Spot Angle", "The angle of the light's spotlight cone in degrees.", "http://docs.unity3d.com/ScriptReference/Light-spotAngle.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("areaSize"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsArea)),
                                          new DescriptorAttribute("Area Size", "The size of the area light. Editor only.", "http://docs.unity3d.com/ScriptReference/Light-areaSize.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("color"),
                                          new DescriptorAttribute("Color", "The color of the light.", "http://docs.unity3d.com/ScriptReference/Light-color.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("intensity"),
                                          new RangeValueAttribute(0f, 8f),
                                          new DescriptorAttribute("Intensity", "The Intensity of a light is multiplied with the Light color.", "http://docs.unity3d.com/ScriptReference/Light-intensity.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("bounceIntensity"),
                                          new RangeValueAttribute(0f, 8f), new HelpAttribute(new HelpAttribute.HelpDelegate(HelpBouncedGI)),
                                          new DescriptorAttribute("Bounce Intensity", "The multiplier that defines the strength of the bounce lighting.", "http://docs.unity3d.com/ScriptReference/Light-bounceIntensity.html")));



            //Acts like a group
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadows"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsNotArea)),
                                          new DescriptorAttribute("Shadow Type", "How this light casts shadows", "http://docs.unity3d.com/ScriptReference/Light-shadows.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowStrength"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)),
                                          new DescriptorAttribute("Strength", "How this light casts shadows.", "http://docs.unity3d.com/ScriptReference/Light-shadowStrength.html")));
            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_Shadows.m_Resolution"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)),
                                          new DescriptorAttribute("Resolution", "The shadow's resolution.")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowBias"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)),
                                          new DescriptorAttribute("Bias", "Shadow mapping bias.", "http://docs.unity3d.com/ScriptReference/Light-shadowBias.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowNormalBias"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)),
                                          new DescriptorAttribute("Normal Bias", "Shadow mapping normal-based bias.", "http://docs.unity3d.com/ScriptReference/Light-shadowNormalBias.html")));

            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_DrawHalo"),
                                          new DescriptorAttribute("Draw Halo", "Draw a halo around the light. Now work with the Halo class.")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("cookie"),
                                          new DescriptorAttribute("Cookie", "The cookie texture projected by the light.", "http://docs.unity3d.com/ScriptReference/Light-cookie.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("cookieSize"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsDirectional)),
                                          new DescriptorAttribute("Cookie Size", "The size of a directional light's cookie.", "http://docs.unity3d.com/ScriptReference/Light-cookieSize.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("flare"),
                                          new DescriptorAttribute("Flare", "The flare asset to use for this light.", "http://docs.unity3d.com/ScriptReference/Light-flare.html")));

            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_RenderMode"),
                                          new DescriptorAttribute("Render Mode", "The rendering path for the lights.")));

            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_CullingMask"),
                                          new HelpAttribute(new HelpAttribute.HelpDelegate(HelpSceneLighting)),
                                          new DescriptorAttribute("Culling Mask", "The object that are affected or ignored by the light.")));
        }
예제 #8
0
파일: PropertyGrid.cs 프로젝트: zparr/ATF
        protected virtual void RebuildPopertyNodesImpl()
        {
            DestroyPropertyNodes();

            object[] instances = Instances == null ? EmptyArray <object> .Instance
                                     : Instances.Cast <object>().ToArray();

            // TODO: cache and reuse PropertyNodes where possible to prevent having to
            // rebuild all of the data templates
            IEnumerable <PropertyDescriptor> descriptors = null;

            if (CustomPropertyDescriptors != null)
            {
                descriptors = CustomPropertyDescriptors;
            }
            else if (Instances != null)
            {
                descriptors = PropertyUtils.GetSharedPropertiesOriginal(instances);
            }

            PropertyNode headerPropertyNode = null;
            var          propertyNodes      = new ObservableCollection <PropertyNode>();

            if (descriptors != null)
            {
                var context = TransactionContext.As <ITransactionContext>();
                if (context == null)
                {
                    context = DataContext.As <ITransactionContext>();
                }

                foreach (var descriptor in descriptors)
                {
                    if (descriptor.IsBrowsable)
                    {
                        PropertyNode node;
                        if (PropertyFactory != null)
                        {
                            node = PropertyFactory.CreateProperty(instances, descriptor, true, context);
                        }
                        else
                        {
                            node = new PropertyNode();
                            node.Initialize(instances, descriptor, true);
                        }

                        node.ValueSet   += node_ValueSet;
                        node.ValueError += node_ValueError;

                        if (node.Category != null)
                        {
                            bool expansionState;
                            if (m_categoryExpanded.TryGetValue(node.Category, out expansionState))
                            {
                                node.IsExpanded = expansionState;
                            }
                        }

                        if (headerPropertyNode == null && descriptor.Attributes[typeof(HeaderPropertyAttribute)] != null)
                        {
                            headerPropertyNode = node;
                        }
                        else
                        {
                            propertyNodes.Add(node);
                        }
                    }
                }
            }

            // Listen for expansion state changes so that we can persist through different objects.
            m_listener = ChangeListener.Create(propertyNodes, "IsExpanded");
            m_listener.PropertyChanged += ChildExpandedPropertyChanged;

            Properties     = propertyNodes;
            HeaderProperty = headerPropertyNode;
        }
예제 #9
0
        protected override void InitializeInternal()
        {
            base.InitializeInternal();

            // Note: This is attempting to add support for items which become disabled when other
            // items are set to specific values. This will need extending to support listening to multiple items.
            PropertyDescriptorCollection descriptors = null;

            var groupEnableAttribute = Descriptor.Attributes.OfType <GroupEnabledAttribute>().FirstOrDefault();

            if (groupEnableAttribute != null)
            {
                descriptors = new PropertyDescriptorCollection(PropertyUtils.GetProperties(Instances.Cast <object>()).ToArray());

                m_groupEnableAttributes = groupEnableAttribute.GroupEnables;

                var groupEnables = new List <GroupEnables>();
                var masters      = new List <PropertyDescriptor>();
                foreach (var groupEnable in groupEnableAttribute.GroupEnables)
                {
                    var desc = descriptors[groupEnable.GroupName];
                    if (desc != null)
                    {
                        groupEnables.Add(groupEnable);
                        masters.Add(desc);
                    }
                    else
                    {
                        Debug.WriteLine("PropertyNode: Descriptor not found: " + groupEnable.GroupName);
                    }
                }

                m_groupEnableAttributes = groupEnables.ToArray();
                m_masterGroups          = masters.ToArray();

                SetGroupEnabledState();
            }

            var dependencyAttribute = Descriptor.Attributes.OfType <DependencyAttribute>().FirstOrDefault();

            if (dependencyAttribute != null)
            {
                if (descriptors == null)
                {
                    descriptors = new PropertyDescriptorCollection(PropertyUtils.GetProperties(Instances.Cast <object>()).ToArray());
                }

                var groups = new List <PropertyDescriptor>();
                foreach (var descriptorName in dependencyAttribute.DependencyDescriptors)
                {
                    var desc = descriptors[descriptorName];
                    if (desc != null)
                    {
                        groups.Add(desc);
                    }
                    else
                    {
                        Debug.WriteLine("PropertyNode: Descriptor not found: " + descriptorName);
                    }
                }

                m_dependencyGroups = groups.ToArray();
            }
        }
예제 #10
0
        protected override void RefreshFields()
        {
            if (kelvinTexture != null)
            {
                kelvinTexture = CreateKelvinGradientTexture("KelvinGradientTexture", 300, 16, 1000f, 20000f);
            }

            Type gameView = TypeUtility.GetTypeByName("GameView");

            repaintAll = gameView.GetMethod("RepaintAll", BindingFlags.Static | BindingFlags.Public);

            Type type = typeof(Light);

            if (Instances == null || Instances.Length == 0)
            {
                return;
            }

            SerializedObject so = new SerializedObject(Instances.Cast <UnityEngine.Object>().ToArray());

            lightType = new InspectorField(type, Instances, type.GetProperty("type"),
                                           new DescriptorAttribute("Type", "The type of the light.", "http://docs.unity3d.com/ScriptReference/Light-type.html"));

            Fields.Add(lightType);

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("range"),
                                          new ReadOnlyAttribute(new ReadOnlyAttribute.ReadOnlyDelegate(IsArea)),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsDirectional), false),
                                          new DescriptorAttribute("Range", "The range of the light.", "http://docs.unity3d.com/ScriptReference/Light-range.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("spotAngle"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsSpot)),
                                          new DescriptorAttribute("Spot Angle", "The angle of the light's spotlight cone in degrees.", "http://docs.unity3d.com/ScriptReference/Light-spotAngle.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("areaSize"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(IsArea)),
                                          new DescriptorAttribute("Area Size", "The size of the area light. Editor only.", "http://docs.unity3d.com/ScriptReference/Light-areaSize.html")));

            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_UseColorTemperature"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(AllowTemperature)),
                                          new DescriptorAttribute("Use Temperature", "Allow this light to use Kelvin Temperature.", "https://docs.unity3d.com/ScriptReference/Light-colorTemperature.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("color"),
                                          new MenuAttribute("Temperature Lighting", new MenuAttribute.MenuDelegate(ToggleTemperatureLighting), null, AllowTemperature),
                                          new DescriptorAttribute("Color", "The color of the light.", "http://docs.unity3d.com/ScriptReference/Light-color.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("colorTemperature"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(ShowTemperature)),
                                          new DescriptorAttribute("Temperature", "Also known as CCT (Correlated color temperature).The color temperature of the electromagnetic radiation emitted from an ideal black body is defined as its surface temperature in Kelvin.White is 6500K", "https://docs.unity3d.com/ScriptReference/Light-colorTemperature.html")));

            lightBaking = new InspectorField(type, Instances, type.GetProperty("lightmapBakeType"),
                                             new InspectAttribute(new InspectAttribute.InspectDelegate(IsArea), false),
                                             new HelpAttribute(new HelpAttribute.HelpDelegate(LightmapModeWarning)),
                                             new DescriptorAttribute("Mode", "This property describes what part of a light's contribution can be baked.", "http://docs.unity3d.com/ScriptReference/Light-type.html"));

            Fields.Add(lightBaking);

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("intensity"),
                                          new RangeValueAttribute(0f, 8f),
                                          new DescriptorAttribute("Intensity", "The Intensity of a light is multiplied with the Light color.", "http://docs.unity3d.com/ScriptReference/Light-intensity.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("bounceIntensity"),
                                          new RangeValueAttribute(0f, 8f), new HelpAttribute(new HelpAttribute.HelpDelegate(HelpBouncedGI)),
                                          new DescriptorAttribute("Bounce Intensity", "The multiplier that defines the strength of the bounce lighting.", "http://docs.unity3d.com/ScriptReference/Light-bounceIntensity.html")));

            //Acts like a group
            lightShadows = new InspectorField(type, Instances, type.GetProperty("shadows"),
                                              new InspectAttribute(new InspectAttribute.InspectDelegate(IsArea), false),
                                              new DescriptorAttribute("Shadow Type", "How this light casts shadows", "http://docs.unity3d.com/ScriptReference/Light-shadows.html"));

            Fields.Add(lightShadows);

            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_ShadowAngle"),
                                          new ReadOnlyAttribute(new ReadOnlyAttribute.ReadOnlyDelegate(IsSoft), false),
                                          new RangeAttribute(0, 90),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(ShowShadowAngle)),
                                          new DescriptorAttribute("Baked Shadow Angle", "", "")));

            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_ShadowRadius"),
                                          new ReadOnlyAttribute(new ReadOnlyAttribute.ReadOnlyDelegate(IsSoft), false),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(ShowShadowRadius)),
                                          new DescriptorAttribute("Baked Shadow Radius", "", "")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowStrength"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasRealimeShadow)),
                                          new RangeValueAttribute(0f, 1f),
                                          new DescriptorAttribute("Strength", "How this light casts shadows.", "http://docs.unity3d.com/ScriptReference/Light-shadowStrength.html")));
            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_Shadows.m_Resolution"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasRealimeShadow)),
                                          new DescriptorAttribute("Resolution", "The shadow's resolution.")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowBias"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasRealimeShadow)),
                                          new RangeValueAttribute(0f, 2f),
                                          new DescriptorAttribute("Bias", "Shadow mapping bias.", "http://docs.unity3d.com/ScriptReference/Light-shadowBias.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowNormalBias"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasRealimeShadow)),
                                          new RangeValueAttribute(0f, 3f),
                                          new DescriptorAttribute("Normal Bias", "Shadow mapping normal-based bias.", "http://docs.unity3d.com/ScriptReference/Light-shadowNormalBias.html")));
            Fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowNearPlane"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(HasRealimeShadow)),
                                          new RangeValueAttribute(0.1f, 10f),
                                          new DescriptorAttribute("Near Plane", "Near plane value to use for shadow frustums.", "https://docs.unity3d.com/ScriptReference/Light-shadowNearPlane.html")));

            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_DrawHalo"),
                                          new DescriptorAttribute("Draw Halo", "Draw a halo around the light. Now work with the Halo class.")));

            lightCookie = new InspectorField(type, Instances, type.GetProperty("cookie"),
                                             new InspectAttribute(new InspectAttribute.InspectDelegate(CanCookie)),
                                             new DescriptorAttribute("Cookie", "The cookie texture projected by the light.", "http://docs.unity3d.com/ScriptReference/Light-cookie.html"));

            Fields.Add(lightCookie);

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("cookieSize"),
                                          new InspectAttribute(new InspectAttribute.InspectDelegate(CanCookieSize)),
                                          new DescriptorAttribute("Cookie Size", "The size of a directional light's cookie.", "http://docs.unity3d.com/ScriptReference/Light-cookieSize.html")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("flare"),
                                          new DescriptorAttribute("Flare", "The flare asset to use for this light.", "http://docs.unity3d.com/ScriptReference/Light-flare.html")));


            Fields.Add(new InspectorField(type, Instances, so.FindProperty("m_RenderMode"),
                                          new DescriptorAttribute("Render Mode", "The rendering path for the lights.")));

            Fields.Add(new InspectorField(type, Instances, type.GetProperty("cullingMask"), new FieldEditorAttribute("LayerMaskEditor"),
                                          new HelpAttribute(new HelpAttribute.HelpDelegate(HelpSceneLighting)),
                                          new DescriptorAttribute("Culling Mask", "The object that are affected or ignored by the light.")));
        }