public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            Camera camera = (Camera)editor.Component;

            PropertyEditorCallback valueChanged     = () => editor.BuildEditor();
            MemberInfo             projection       = Strong.PropertyInfo((CameraPropertyConverter x) => x.Projection, "Projection");
            MemberInfo             orthographic     = Strong.PropertyInfo((Camera x) => x.orthographic, "orthographic");
            MemberInfo             fov              = Strong.PropertyInfo((Camera x) => x.fieldOfView, "fieldOfView");
            MemberInfo             orthographicSize = Strong.PropertyInfo((Camera x) => x.orthographicSize, "orthographicSize");

            List <PropertyDescriptor> descriptors = new List <PropertyDescriptor>();

            descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Projection", "Projection"), converter, projection, orthographic, valueChanged));

            if (!camera.orthographic)
            {
                descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Fov", "Field Of View"), editor.Component, fov, "field of view"));
            }
            else
            {
                descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Size", "Size"), editor.Component, orthographicSize, "orthographic size"));
            }

            return(descriptors.ToArray());
        }
Example #2
0
        public PropertyDescriptor[] GetPropertyDescriptors(Type componentType, ComponentEditor componentEditor = null, object converter = null)
        {
            ComponentEditor editor = componentEditor != null ? componentEditor : VoidComponentEditor;

            IComponentDescriptor componentDescriptor;

            if (!ComponentDescriptors.TryGetValue(componentType, out componentDescriptor))
            {
                componentDescriptor = null;
            }

            if (componentDescriptor != null)
            {
                if (converter == null)
                {
                    converter = componentDescriptor.CreateConverter(editor);
                }

                PropertyDescriptor[] properties = componentDescriptor.GetProperties(editor, converter);
                return(properties);
            }
            else
            {
                if (componentType.IsScript())
                {
                    FieldInfo[] serializableFields = componentType.GetSerializableFields(false);
                    return(serializableFields.Select(f => new PropertyDescriptor(f.Name, editor.Component, f, f)).ToArray());
                }
                else
                {
                    PropertyInfo[] properties = componentType.GetProperties(BindingFlags.Instance | BindingFlags.Public).Where(p => p.CanRead && p.CanWrite).ToArray();
                    return(properties.Select(p => new PropertyDescriptor(p.Name, editor.Component, p, p)).ToArray());
                }
            }
        }
Example #3
0
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo connectedBodyInfo       = Strong.MemberInfo((SpringJoint x) => x.connectedBody);
            MemberInfo anchorInfo              = Strong.MemberInfo((SpringJoint x) => x.anchor);
            MemberInfo autoConfigAnchorInfo    = Strong.MemberInfo((SpringJoint x) => x.autoConfigureConnectedAnchor);
            MemberInfo connectedAnchorInfo     = Strong.MemberInfo((SpringJoint x) => x.connectedAnchor);
            MemberInfo springInfo              = Strong.MemberInfo((SpringJoint x) => x.spring);
            MemberInfo damperInfo              = Strong.MemberInfo((SpringJoint x) => x.damper);
            MemberInfo minDistanceInfo         = Strong.MemberInfo((SpringJoint x) => x.minDistance);
            MemberInfo maxDistanceInfo         = Strong.MemberInfo((SpringJoint x) => x.maxDistance);
            MemberInfo toleranceInfo           = Strong.MemberInfo((SpringJoint x) => x.tolerance);
            MemberInfo breakForceInfo          = Strong.MemberInfo((SpringJoint x) => x.breakForce);
            MemberInfo breakTorqueInfo         = Strong.MemberInfo((SpringJoint x) => x.breakTorque);
            MemberInfo enableCollisionInfo     = Strong.MemberInfo((SpringJoint x) => x.enableCollision);
            MemberInfo enablePreporcessingInfo = Strong.MemberInfo((SpringJoint x) => x.enablePreprocessing);

            return(new[]
            {
                new PropertyDescriptor("ConnectedBody", editor.Component, connectedBodyInfo),
                new PropertyDescriptor("Anchor", editor.Component, anchorInfo),
                new PropertyDescriptor("Auto Configure Connected Anchor", editor.Component, autoConfigAnchorInfo),
                new PropertyDescriptor("Connected Anchor", editor.Component, connectedAnchorInfo),
                new PropertyDescriptor("Spring", editor.Component, springInfo),
                new PropertyDescriptor("Damper", editor.Component, damperInfo),
                new PropertyDescriptor("MinDistance", editor.Component, minDistanceInfo),
                new PropertyDescriptor("MaxDistance", editor.Component, maxDistanceInfo),
                new PropertyDescriptor("Tolerance", editor.Component, toleranceInfo),
                new PropertyDescriptor("Break Force", editor.Component, breakForceInfo),
                new PropertyDescriptor("Break Torque", editor.Component, breakTorqueInfo),
                new PropertyDescriptor("Enable Collision", editor.Component, enableCollisionInfo),
                new PropertyDescriptor("Enable Preprocessing", editor.Component, enablePreporcessingInfo),
            });
        }
Example #4
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            Camera camera = (Camera)editor.Component;

            PropertyEditorCallback valueChanged     = () => editor.BuildEditor();
            MemberInfo             projection       = Strong.PropertyInfo((CameraPropertyConverter x) => x.Projection, "Projection");
            MemberInfo             orthographic     = Strong.PropertyInfo((Camera x) => x.orthographic, "orthographic");
            MemberInfo             fov              = Strong.PropertyInfo((Camera x) => x.fieldOfView, "fieldOfView");
            MemberInfo             orthographicSize = Strong.PropertyInfo((Camera x) => x.orthographicSize, "orthographicSize");

            List <PropertyDescriptor> descriptors = new List <PropertyDescriptor>();

            descriptors.Add(new PropertyDescriptor("Projection", converter, projection, orthographic, valueChanged));

            if (!camera.orthographic)
            {
                descriptors.Add(new PropertyDescriptor("Field Of View", editor.Component, fov, fov));
            }
            else
            {
                descriptors.Add(new PropertyDescriptor("Size", editor.Component, orthographicSize, orthographicSize));
            }

            return(descriptors.ToArray());
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo connectedBodyInfo       = Strong.PropertyInfo((SpringJoint x) => x.connectedBody, "connectedBody");
            MemberInfo anchorInfo              = Strong.PropertyInfo((SpringJoint x) => x.anchor, "anchor");
            MemberInfo autoConfigAnchorInfo    = Strong.PropertyInfo((SpringJoint x) => x.autoConfigureConnectedAnchor, "autoConfigureConnectedAnchor");
            MemberInfo connectedAnchorInfo     = Strong.PropertyInfo((SpringJoint x) => x.connectedAnchor, "connectedAnchor");
            MemberInfo springInfo              = Strong.PropertyInfo((SpringJoint x) => x.spring, "spring");
            MemberInfo damperInfo              = Strong.PropertyInfo((SpringJoint x) => x.damper, "damper");
            MemberInfo minDistanceInfo         = Strong.PropertyInfo((SpringJoint x) => x.minDistance, "minDistance");
            MemberInfo maxDistanceInfo         = Strong.PropertyInfo((SpringJoint x) => x.maxDistance, "maxDistance");
            MemberInfo toleranceInfo           = Strong.PropertyInfo((SpringJoint x) => x.tolerance, "tolerance");
            MemberInfo breakForceInfo          = Strong.PropertyInfo((SpringJoint x) => x.breakForce, "breakForce");
            MemberInfo breakTorqueInfo         = Strong.PropertyInfo((SpringJoint x) => x.breakTorque, "breakTorque");
            MemberInfo enableCollisionInfo     = Strong.PropertyInfo((SpringJoint x) => x.enableCollision, "enableCollision");
            MemberInfo enablePreporcessingInfo = Strong.PropertyInfo((SpringJoint x) => x.enablePreprocessing, "enablePreprocessing");

            return(new[]
            {
                new PropertyDescriptor("ConnectedBody", editor.Component, connectedBodyInfo),
                new PropertyDescriptor("Anchor", editor.Component, anchorInfo, "m_Anchor"),
                new PropertyDescriptor("Auto Configure Connected Anchor", editor.Component, autoConfigAnchorInfo, "m_AutoConfigureConnectedAnchor"),
                new PropertyDescriptor("Connected Anchor", editor.Component, connectedAnchorInfo, "m_ConnectedAnchor"),
                new PropertyDescriptor("Spring", editor.Component, springInfo, "m_Spring"),
                new PropertyDescriptor("Damper", editor.Component, damperInfo, "m_Damper"),
                new PropertyDescriptor("MinDistance", editor.Component, minDistanceInfo, "m_MinDistance"),
                new PropertyDescriptor("MaxDistance", editor.Component, maxDistanceInfo, "m_MaxDistance"),
                new PropertyDescriptor("Tolerance", editor.Component, toleranceInfo, "m_Tolerance"),
                new PropertyDescriptor("Break Force", editor.Component, breakForceInfo, "m_BreakForce"),
                new PropertyDescriptor("Break Torque", editor.Component, breakTorqueInfo, "m_BreakTorque"),
                new PropertyDescriptor("Enable Collision", editor.Component, enableCollisionInfo, "m_EnableCollision"),
                new PropertyDescriptor("Enable Preprocessing", editor.Component, enablePreporcessingInfo, "m_EnablePreprocessing"),
            });
        }
        public override object CreateConverter(ComponentEditor editor)
        {
            TransformPropertyConverter converter = new TransformPropertyConverter();

            converter.ExposeToEditor = editor.Component.GetComponent <ExposeToEditor>();
            return(converter);
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo connectedBodyInfo       = Strong.PropertyInfo((SpringJoint x) => x.connectedBody, "connectedBody");
            MemberInfo anchorInfo              = Strong.PropertyInfo((SpringJoint x) => x.anchor, "anchor");
            MemberInfo autoConfigAnchorInfo    = Strong.PropertyInfo((SpringJoint x) => x.autoConfigureConnectedAnchor, "autoConfigureConnectedAnchor");
            MemberInfo connectedAnchorInfo     = Strong.PropertyInfo((SpringJoint x) => x.connectedAnchor, "connectedAnchor");
            MemberInfo springInfo              = Strong.PropertyInfo((SpringJoint x) => x.spring, "spring");
            MemberInfo damperInfo              = Strong.PropertyInfo((SpringJoint x) => x.damper, "damper");
            MemberInfo minDistanceInfo         = Strong.PropertyInfo((SpringJoint x) => x.minDistance, "minDistance");
            MemberInfo maxDistanceInfo         = Strong.PropertyInfo((SpringJoint x) => x.maxDistance, "maxDistance");
            MemberInfo toleranceInfo           = Strong.PropertyInfo((SpringJoint x) => x.tolerance, "tolerance");
            MemberInfo breakForceInfo          = Strong.PropertyInfo((SpringJoint x) => x.breakForce, "breakForce");
            MemberInfo breakTorqueInfo         = Strong.PropertyInfo((SpringJoint x) => x.breakTorque, "breakTorque");
            MemberInfo enableCollisionInfo     = Strong.PropertyInfo((SpringJoint x) => x.enableCollision, "enableCollision");
            MemberInfo enablePreporcessingInfo = Strong.PropertyInfo((SpringJoint x) => x.enablePreprocessing, "enablePreprocessing");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_ConnectedBody", "ConnectedBody"), editor.Components, connectedBodyInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_Anchor", "Anchor"), editor.Components, anchorInfo, "m_Anchor"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_AutoConfigConnectedAnchor", "Auto Configure Connected Anchor"), editor.Components, autoConfigAnchorInfo, "m_AutoConfigureConnectedAnchor"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_ConnectAnchor", "Connected Anchor"), editor.Components, connectedAnchorInfo, "m_ConnectedAnchor"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_Spring", "Spring"), editor.Components, springInfo, "m_Spring"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_Damper", "Damper"), editor.Components, damperInfo, "m_Damper"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_MinDistance", "MinDistance"), editor.Components, minDistanceInfo, "m_MinDistance"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_MaxDistance", "MaxDistance"), editor.Components, maxDistanceInfo, "m_MaxDistance"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_Tolerance", "Tolerance"), editor.Components, toleranceInfo, "m_Tolerance"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_BreakForce", "Break Force"), editor.Components, breakForceInfo, "m_BreakForce"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_BreakTorque", "Break Torque"), editor.Components, breakTorqueInfo, "m_BreakTorque"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_EnableCollision", "Enable Collision"), editor.Components, enableCollisionInfo, "m_EnableCollision"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SpringJoint_EnablePreprocessing", "Enable Preprocessing"), editor.Components, enablePreporcessingInfo, "m_EnablePreprocessing"),
            });
        }
        public override object CreateConverter(ComponentEditor editor)
        {
            CapsuleColliderPropertyConverter converter = new CapsuleColliderPropertyConverter();

            converter.Component = (CapsuleCollider)editor.Component;
            return(converter);
        }
Example #9
0
        private void Start()
        {
            GameObject voidComponentEditor = new GameObject("VoidComponentEditor");

            voidComponentEditor.transform.SetParent(transform, false);
            VoidComponentEditor = voidComponentEditor.AddComponent <VoidComponentEditor>();
        }
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            PropertyEditorCallback valueChanged = () => editor.BuildEditor();

            MemberInfo convexInfo    = Strong.MemberInfo((MeshCollider x) => x.convex);
            MemberInfo isTriggerInfo = Strong.MemberInfo((MeshCollider x) => x.isTrigger);
            MemberInfo materialInfo  = Strong.MemberInfo((MeshCollider x) => x.sharedMaterial);
            MemberInfo meshInfo      = Strong.MemberInfo((MeshCollider x) => x.sharedMesh);


            MeshCollider collider = (MeshCollider)editor.Component;

            if (collider.convex)
            {
                return(new[]
                {
                    new PropertyDescriptor("Convex", editor.Component, convexInfo, convexInfo, valueChanged),
                    new PropertyDescriptor("Is Trigger", editor.Component, isTriggerInfo, isTriggerInfo),
                    new PropertyDescriptor("Material", editor.Component, materialInfo, materialInfo),
                    new PropertyDescriptor("Mesh", editor.Component, meshInfo, meshInfo),
                });
            }
            else
            {
                return(new[]
                {
                    new PropertyDescriptor("Convex", editor.Component, convexInfo, convexInfo, valueChanged),
                    new PropertyDescriptor("Material", editor.Component, materialInfo, materialInfo),
                    new PropertyDescriptor("Mesh", editor.Component, meshInfo, meshInfo),
                });
            }
        }
Example #11
0
        public override object CreateConverter(ComponentEditor editor)
        {
            TransformPropertyConverter converter = new TransformPropertyConverter();

            converter.Component = (Transform)editor.Component;
            return(converter);
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo materialsInfo = Strong.PropertyInfo((SkinnedMeshRenderer x) => x.sharedMaterials, "sharedMaterials");
            List <PropertyDescriptor> descriptors = new List <PropertyDescriptor>();

            descriptors.Add(new PropertyDescriptor("Materials", editor.Component, materialsInfo, materialsInfo));
            return(descriptors.ToArray());
        }
Example #13
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            object[] converters = (object[])converter;

            ILocalization lc = IOC.Resolve <ILocalization>();

            PropertyEditorCallback valueChanged     = () => editor.BuildEditor();
            MemberInfo             projection       = Strong.PropertyInfo((CameraPropertyConverter x) => x.Projection, "Projection");
            MemberInfo             orthographic     = Strong.PropertyInfo((Camera x) => x.orthographic, "orthographic");
            MemberInfo             fov              = Strong.PropertyInfo((Camera x) => x.fieldOfView, "fieldOfView");
            MemberInfo             orthographicSize = Strong.PropertyInfo((Camera x) => x.orthographicSize, "orthographicSize");
            MemberInfo             cullingMask      = Strong.PropertyInfo((Camera x) => x.cullingMask, "cullingMask");

            List <PropertyDescriptor> descriptors = new List <PropertyDescriptor>();

            descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Projection", "Projection"), converters, projection, orthographic, valueChanged));

            Camera[] cameras = editor.NotNullComponents.OfType <Camera>().ToArray();
            if (cameras.Length > 0)
            {
                bool isCameraOrthographic = cameras[0].orthographic;
                for (int i = 1; i < cameras.Length; ++i)
                {
                    if (cameras[i].orthographic != isCameraOrthographic)
                    {
                        return(descriptors.ToArray());
                    }
                }

                if (!isCameraOrthographic)
                {
                    descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Fov", "Field Of View"), editor.Components, fov, "field of view"));
                }
                else
                {
                    descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Size", "Size"), editor.Components, orthographicSize, "orthographic size"));
                }

                List <RangeOptions.Option> flags = new List <RangeOptions.Option>();
                LayersInfo layersInfo            = LayersEditor.LoadedLayers;
                foreach (LayersInfo.Layer layer in layersInfo.Layers)
                {
                    if (!string.IsNullOrEmpty(layer.Name))
                    {
                        flags.Add(new RangeOptions.Option(layer.Name, layer.Index));
                    }
                }


                descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_CullingMask", "Culling Mask"), editor.Components, cullingMask)
                {
                    Range = new RangeFlags(flags.ToArray())
                });
            }

            return(descriptors.ToArray());
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo materials = Strong.PropertyInfo((MeshRenderer x) => x.sharedMaterials, "sharedMaterials");

            return(new[]
            {
                new PropertyDescriptor("Materials", editor.Component, materials, materials),
            });
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo sharedMeshInfo = Strong.PropertyInfo((MeshFilter x) => x.sharedMesh, "sharedMesh");

            return(new[]
            {
                new PropertyDescriptor("Mesh", editor.Component, sharedMeshInfo, sharedMeshInfo)
            });
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo sharedMeshInfo = Strong.PropertyInfo((MeshFilter x) => x.sharedMesh, "sharedMesh");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshFilter_Mesh", "Mesh"), editor.Components, sharedMeshInfo, sharedMeshInfo)
            });
        }
Example #17
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo clipInfo   = Strong.PropertyInfo((AudioSource x) => x.clip, "clip");
            MemberInfo volumeInfo = Strong.PropertyInfo((AudioSource x) => x.volume, "volume");

            return(new[]
            {
                new PropertyDescriptor("Clip", editor.Component, clipInfo),
                new PropertyDescriptor("Volume", editor.Component, volumeInfo, volumeInfo,
                                       null, new Range(0.0f, 1.0f)),
            });
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization             lc = IOC.Resolve <ILocalization>();
            MemberInfo                castShadowsInfo    = Strong.PropertyInfo((SkinnedMeshRenderer x) => x.shadowCastingMode, "shadowCastingMode");
            MemberInfo                receiveShadowsInfo = Strong.PropertyInfo((SkinnedMeshRenderer x) => x.receiveShadows, "receiveShadows");
            MemberInfo                materialsInfo      = Strong.PropertyInfo((SkinnedMeshRenderer x) => x.sharedMaterials, "sharedMaterials");
            List <PropertyDescriptor> descriptors        = new List <PropertyDescriptor>();

            descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SkinnedMeshRenderer_CastShadows", "Cast Shadows"), editor.Components, castShadowsInfo));
            descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SkinnedMeshRenderer_ReceiveShadows", "Receive Shadows"), editor.Components, receiveShadowsInfo, "m_ReceiveShadows"));
            descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SkinnedMeshRenderer_Materials", "Materials"), editor.Components, materialsInfo, materialsInfo));
            return(descriptors.ToArray());
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo playOnAwakeInfo = Strong.PropertyInfo((RuntimeAnimation x) => x.PlayOnAwake, "PlayOnAwake");
            MemberInfo loopInfo        = Strong.PropertyInfo((RuntimeAnimation x) => x.Loop, "Loop");
            MemberInfo clipsInfo       = Strong.PropertyInfo((RuntimeAnimation x) => x.Clips, "Clips");

            return(new[]
            {
                new PropertyDescriptor("Play On Awake", editor.Component, playOnAwakeInfo),
                new PropertyDescriptor("Loop", editor.Component, loopInfo),
                new PropertyDescriptor("Clips", editor.Component, clipsInfo)
            });
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo connectedBodyInfo       = Strong.PropertyInfo((HingeJoint x) => x.connectedBody, "connectedBody");
            MemberInfo anchorInfo              = Strong.PropertyInfo((HingeJoint x) => x.anchor, "anchor");
            MemberInfo axisInfo                = Strong.PropertyInfo((HingeJoint x) => x.axis, "axis");
            MemberInfo autoConfigAnchorInfo    = Strong.PropertyInfo((HingeJoint x) => x.autoConfigureConnectedAnchor, "autoConfigureConnectedAnchor");
            MemberInfo connectedAnchorInfo     = Strong.PropertyInfo((HingeJoint x) => x.connectedAnchor, "connectedAnchor");
            MemberInfo useSpringInfo           = Strong.PropertyInfo((HingeJoint x) => x.useSpring, "useSpring");
            MemberInfo springInfo              = Strong.PropertyInfo((HingeJoint x) => x.spring, "spring");
            MemberInfo useMotorInfo            = Strong.PropertyInfo((HingeJoint x) => x.useMotor, "useMotor");
            MemberInfo motorInfo               = Strong.PropertyInfo((HingeJoint x) => x.motor, "motor");
            MemberInfo useLimitsInfo           = Strong.PropertyInfo((HingeJoint x) => x.useLimits, "useLimits");
            MemberInfo limitsInfo              = Strong.PropertyInfo((HingeJoint x) => x.limits, "limits");
            MemberInfo breakForceInfo          = Strong.PropertyInfo((HingeJoint x) => x.breakForce, "breakForce");
            MemberInfo breakTorqueInfo         = Strong.PropertyInfo((HingeJoint x) => x.breakTorque, "breakTorque");
            MemberInfo enableCollisionInfo     = Strong.PropertyInfo((HingeJoint x) => x.enableCollision, "enableCollision");
            MemberInfo enablePreporcessingInfo = Strong.PropertyInfo((HingeJoint x) => x.enablePreprocessing, "enablePreprocessing");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_ConnectedBody", "Connected Body"), editor.Component, connectedBodyInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Anchor", "Anchor"), editor.Component, anchorInfo, "m_Anchor"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Axis", "Axis"), editor.Component, axisInfo, "m_Axis"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_AutoConfigure", "Auto Configure Connected Anchor"), editor.Component, autoConfigAnchorInfo, "m_AutoConfigureConnectedAnchor"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_ConnectedAnchor", "Connected Anchor"), editor.Component, connectedAnchorInfo, "m_ConnectedAnchor"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_UseSpring", "Use Spring"), editor.Component, useSpringInfo, "m_UseSpring"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Spring", "Spring"), editor.Component, springInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_UseMotor", "Use Motor"), editor.Component, useMotorInfo, "m_UseMotor"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Motor", "Motor"), editor.Component, motorInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_UseLimits", "Use Limits"), editor.Component, useLimitsInfo, "m_UseLimits"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Limits", "Limits"), editor.Component, limitsInfo)
                {
                    ChildDesciptors = new[]
                    {
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Min", "Min"), null, Strong.PropertyInfo((JointLimits x) => x.min, "min")),
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Max", "Max"), null, Strong.PropertyInfo((JointLimits x) => x.max, "max")),
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_Bounciness", "Bounciness"), null, Strong.PropertyInfo((JointLimits x) => x.bounciness, "bounciness")),
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_BounceMinVelocity", "Bounce Min Velocity"), null, Strong.PropertyInfo((JointLimits x) => x.bounceMinVelocity, "bounceMinVelocity")),
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_ContactDistance", "Contact Distance"), null, Strong.PropertyInfo((JointLimits x) => x.contactDistance, "contactDistance")),
                    }
                },
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_BreakForce", "Break Force"), editor.Component, breakForceInfo, "m_BreakForce"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_BreakTorque", "Break Torque"), editor.Component, breakTorqueInfo, "m_BreakTorque"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_BreakEnableCollision", "Enable Collision"), editor.Component, enableCollisionInfo, "m_EnableCollision"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_HingeJoint_BreakEnablePreprocessing", "Enable Preprocessing"), editor.Component, enablePreporcessingInfo, "m_EnablePreprocessing"),
            });
        }
Example #21
0
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo isTriggerInfo = Strong.MemberInfo((BoxCollider x) => x.isTrigger);
            MemberInfo materialInfo  = Strong.MemberInfo((BoxCollider x) => x.sharedMaterial);
            MemberInfo centerInfo    = Strong.MemberInfo((BoxCollider x) => x.center);
            MemberInfo sizeInfo      = Strong.MemberInfo((BoxCollider x) => x.size);

            return(new[]
            {
                new PropertyDescriptor("Is Trigger", editor.Component, isTriggerInfo, isTriggerInfo),
                new PropertyDescriptor("Material", editor.Component, materialInfo, materialInfo),
                new PropertyDescriptor("Center", editor.Component, centerInfo, centerInfo),
                new PropertyDescriptor("Size", editor.Component, sizeInfo, sizeInfo),
            });
        }
Example #22
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo playOnAwakeInfo = Strong.PropertyInfo((RuntimeAnimation x) => x.PlayOnAwake, "PlayOnAwake");
            MemberInfo loopInfo        = Strong.PropertyInfo((RuntimeAnimation x) => x.Loop, "Loop");
            MemberInfo clipsInfo       = Strong.PropertyInfo((RuntimeAnimation x) => x.Clips, "Clips");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_RuntimeAnimation_PlayOnAwake", "Play On Awake"), editor.Components, playOnAwakeInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_RuntimeAnimation_Loop", "Loop"), editor.Components, loopInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_RuntimeAnimation_Clips", "Clips"), editor.Components, clipsInfo)
            });
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo shadowCastingMode = Strong.PropertyInfo((MeshRenderer x) => x.shadowCastingMode, "shadowCastingMode");
            MemberInfo receiveShadows    = Strong.PropertyInfo((MeshRenderer x) => x.receiveShadows, "receiveShadows");
            MemberInfo materials         = Strong.PropertyInfo((MeshRenderer x) => x.sharedMaterials, "sharedMaterials");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshRenderer_CastShadows", "Cast Shadows"), editor.Component, shadowCastingMode),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshRenderer_ReceiveShadows", "Receive Shadows"), editor.Component, receiveShadows, "m_ReceiveShadows"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshRenderer_Materials", "Materials"), editor.Component, materials),
            });
        }
Example #24
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo isTriggerInfo = Strong.PropertyInfo((BoxCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo  = Strong.PropertyInfo((BoxCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo centerInfo    = Strong.PropertyInfo((BoxCollider x) => x.center, "center");
            MemberInfo sizeInfo      = Strong.PropertyInfo((BoxCollider x) => x.size, "size");

            return(new[]
            {
                new PropertyDescriptor("Is Trigger", editor.Component, isTriggerInfo, "m_IsTrigger"),
                new PropertyDescriptor("Material", editor.Component, materialInfo),
                new PropertyDescriptor("Center", editor.Component, centerInfo, "m_Center"),
                new PropertyDescriptor("Size", editor.Component, sizeInfo, "m_Size"),
            });
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo isTriggerInfo = Strong.PropertyInfo((SphereCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo  = Strong.PropertyInfo((SphereCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo centerInfo    = Strong.PropertyInfo((SphereCollider x) => x.center, "center");
            MemberInfo radiusInfo    = Strong.PropertyInfo((SphereCollider x) => x.radius, "radius");


            return(new[]
            {
                new PropertyDescriptor("Is Trigger", editor.Component, isTriggerInfo, "m_IsTrigger"),
                new PropertyDescriptor("Material", editor.Component, materialInfo),
                new PropertyDescriptor("Center", editor.Component, centerInfo, "m_Center"),
                new PropertyDescriptor("Radius", editor.Component, radiusInfo, "m_Radius")
            });
        }
Example #26
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converterObj)
        {
            TransformPropertyConverter converter = (TransformPropertyConverter)converterObj;

            MemberInfo position          = Strong.PropertyInfo((Transform x) => x.position, "position");
            MemberInfo rotation          = Strong.PropertyInfo((Transform x) => x.rotation, "rotation");
            MemberInfo rotationConverted = Strong.PropertyInfo((TransformPropertyConverter x) => x.Rotation, "Rotation");
            MemberInfo scale             = Strong.PropertyInfo((Transform x) => x.localScale, "localScale");

            return(new[]
            {
                new PropertyDescriptor("Position", editor.Component, position, position),
                new PropertyDescriptor("Rotation", converter, rotationConverted, rotation),
                new PropertyDescriptor("Scale", editor.Component, scale, scale)
            });
        }
Example #27
0
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo isTriggerInfo = Strong.MemberInfo((SphereCollider x) => x.isTrigger);
            MemberInfo materialInfo  = Strong.MemberInfo((SphereCollider x) => x.sharedMaterial);
            MemberInfo centerInfo    = Strong.MemberInfo((SphereCollider x) => x.center);
            MemberInfo radiusInfo    = Strong.MemberInfo((SphereCollider x) => x.radius);


            return(new[]
            {
                new PropertyDescriptor("Is Trigger", editor.Component, isTriggerInfo, isTriggerInfo),
                new PropertyDescriptor("Material", editor.Component, materialInfo, materialInfo),
                new PropertyDescriptor("Center", editor.Component, centerInfo, centerInfo),
                new PropertyDescriptor("Radius", editor.Component, radiusInfo, radiusInfo),
            });
        }
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo connectedBodyInfo       = Strong.PropertyInfo((HingeJoint x) => x.connectedBody, "connectedBody");
            MemberInfo anchorInfo              = Strong.PropertyInfo((HingeJoint x) => x.anchor, "anchor");
            MemberInfo axisInfo                = Strong.PropertyInfo((HingeJoint x) => x.axis, "axis");
            MemberInfo autoConfigAnchorInfo    = Strong.PropertyInfo((HingeJoint x) => x.autoConfigureConnectedAnchor, "autoConfigureConnectedAnchor");
            MemberInfo connectedAnchorInfo     = Strong.PropertyInfo((HingeJoint x) => x.connectedAnchor, "connectedAnchor");
            MemberInfo useSpringInfo           = Strong.PropertyInfo((HingeJoint x) => x.useSpring, "useSpring");
            MemberInfo springInfo              = Strong.PropertyInfo((HingeJoint x) => x.spring, "spring");
            MemberInfo useMotorInfo            = Strong.PropertyInfo((HingeJoint x) => x.useMotor, "useMotor");
            MemberInfo motorInfo               = Strong.PropertyInfo((HingeJoint x) => x.motor, "motor");
            MemberInfo useLimitsInfo           = Strong.PropertyInfo((HingeJoint x) => x.useLimits, "useLimits");
            MemberInfo limitsInfo              = Strong.PropertyInfo((HingeJoint x) => x.limits, "limits");
            MemberInfo breakForceInfo          = Strong.PropertyInfo((HingeJoint x) => x.breakForce, "breakForce");
            MemberInfo breakTorqueInfo         = Strong.PropertyInfo((HingeJoint x) => x.breakTorque, "breakTorque");
            MemberInfo enableCollisionInfo     = Strong.PropertyInfo((HingeJoint x) => x.enableCollision, "enableCollision");
            MemberInfo enablePreporcessingInfo = Strong.PropertyInfo((HingeJoint x) => x.enablePreprocessing, "enablePreprocessing");

            return(new[]
            {
                new PropertyDescriptor("ConnectedBody", editor.Component, connectedBodyInfo),
                new PropertyDescriptor("Anchor", editor.Component, anchorInfo),
                new PropertyDescriptor("Axis", editor.Component, axisInfo),
                new PropertyDescriptor("Auto Configure Connected Anchor", editor.Component, autoConfigAnchorInfo),
                new PropertyDescriptor("Connected Anchor", editor.Component, connectedAnchorInfo),
                new PropertyDescriptor("Use Spring", editor.Component, useSpringInfo),
                new PropertyDescriptor("Spring", editor.Component, springInfo),
                new PropertyDescriptor("Use Motor", editor.Component, useMotorInfo),
                new PropertyDescriptor("Motor", editor.Component, motorInfo),
                new PropertyDescriptor("Use Limits", editor.Component, useLimitsInfo),
                new PropertyDescriptor("Limits", editor.Component, limitsInfo)
                {
                    ChildDesciptors = new[]
                    {
                        new PropertyDescriptor("Min", null, Strong.PropertyInfo((JointLimits x) => x.min, "min")),
                        new PropertyDescriptor("Max", null, Strong.PropertyInfo((JointLimits x) => x.max, "max")),
                        new PropertyDescriptor("Bounciness", null, Strong.PropertyInfo((JointLimits x) => x.bounciness, "bounciness")),
                        new PropertyDescriptor("Bounce Min Velocity", null, Strong.PropertyInfo((JointLimits x) => x.bounceMinVelocity, "bounceMinVelocity")),
                        new PropertyDescriptor("Contact Distance", null, Strong.PropertyInfo((JointLimits x) => x.contactDistance, "contactDistance")),
                    }
                },
                new PropertyDescriptor("Break Force", editor.Component, breakForceInfo),
                new PropertyDescriptor("Break Torque", editor.Component, breakTorqueInfo),
                new PropertyDescriptor("Enable Collision", editor.Component, enableCollisionInfo),
                new PropertyDescriptor("Enable Preprocessing", editor.Component, enablePreporcessingInfo),
            });
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo isTriggerInfo = Strong.PropertyInfo((SphereCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo  = Strong.PropertyInfo((SphereCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo centerInfo    = Strong.PropertyInfo((SphereCollider x) => x.center, "center");
            MemberInfo radiusInfo    = Strong.PropertyInfo((SphereCollider x) => x.radius, "radius");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SphereCollider_IsTrigger", "Is Trigger"), editor.Components, isTriggerInfo, "m_IsTrigger"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SphereCollider_Material", "Material"), editor.Components, materialInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SphereCollider_Center", "Center"), editor.Components, centerInfo, "m_Center"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_SphereCollider_Radius", "Radius"), editor.Components, radiusInfo, "m_Radius")
            });
        }
Example #30
0
 public override object CreateConverter(ComponentEditor editor)
 {
     object[]    converters = new object[editor.Components.Length];
     Component[] components = editor.Components;
     for (int i = 0; i < components.Length; ++i)
     {
         Camera camera = (Camera)components[i];
         if (camera != null)
         {
             converters[i] = new CameraPropertyConverter
             {
                 Component = camera
             };
         }
     }
     return(converters);
 }