Beispiel #1
0
        public override object CreateConverter(ComponentEditor editor)
        {
            TransformPropertyConverter converter = new TransformPropertyConverter();

            converter.Component = (Transform)editor.Component;
            return(converter);
        }
        public override object CreateConverter(ComponentEditor editor)
        {
            TransformPropertyConverter converter = new TransformPropertyConverter();

            converter.ExposeToEditor = editor.Component.GetComponent <ExposeToEditor>();
            return(converter);
        }
Beispiel #3
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)
            });
        }
 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)
     {
         Transform transform = (Transform)components[i];
         if (transform != null)
         {
             converters[i] = new TransformPropertyConverter
             {
                 ExposeToEditor = transform.GetComponent <ExposeToEditor>()
             };
         }
     }
     return(converters);
 }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converterObj)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            TransformPropertyConverter converter = (TransformPropertyConverter)converterObj;

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

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