Пример #1
0
        public object CreateConverter(ComponentEditor editor)
        {
            TransformPropertyConverter converter = new TransformPropertyConverter();

            converter.Component = (Transform)editor.Component;
            return(converter);
        }
Пример #2
0
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converterObj)
        {
            TransformPropertyConverter converter = (TransformPropertyConverter)converterObj;

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

            return(new[]
            {
                new PropertyDescriptor("Position", editor.Component, position, position),
                new PropertyDescriptor("Rotation", converter, rotationConverted, rotation),
                new PropertyDescriptor("Scale", editor.Component, scale, scale)
            });
        }