Пример #1
0
        private void SetValue <TValue>(TextOutline instance, string fieldName, TValue value)
        {
            UnityEditorUtility.RegisterUndo("TextOutlineInspector Undo", instance);
            Reflection.SetPrivateField(instance, fieldName, value);

            update = true;
        }
Пример #2
0
        //----- property -----

        //----- method -----

        public override void OnInspectorGUI()
        {
            instance = target as TextOutline;

            var color = Reflection.GetPrivateField <TextOutline, Color>(instance, "color");

            EditorGUI.BeginChangeCheck();

            color = EditorGUILayout.ColorField("Color", color);

            if (EditorGUI.EndChangeCheck())
            {
                SetValue(instance, "color", color);
            }

            var distance = Reflection.GetPrivateField <TextOutline, float>(instance, "distance");

            EditorGUI.BeginChangeCheck();

            distance = EditorGUILayout.DelayedFloatField("Distance", distance);

            if (EditorGUI.EndChangeCheck())
            {
                SetValue(instance, "distance", distance);
            }

            DrawMaterialSelector(instance);
        }
Пример #3
0
        private void UpdateParams(TextOutline instance, Color color, float distance)
        {
            UnityEditorUtility.RegisterUndo("TextOutlineInspector Undo", instance);

            Reflection.SetPrivateField(instance, "color", color);
            Reflection.SetPrivateField(instance, "distance", distance);

            update = true;
        }