perogram

There is difference between "Delegate?" and "uGUI OnClick"

  • I want to use Stan's Asset for android gallery
  • I put uGUI button and attach OnClick

f:id:peroon:20181117050026p:plain

    public void OnClickOpenGallery()
    {
        AN_MediaPicker picker = new AN_MediaPicker(AN_MediaType.Image);

        /// Defines if multiple images picker is allowed.
        /// The default falue is < c > false </ c >
        picker.AllowMultiSelect = false;

        /// Max thumbnail size that will be trsnafered to the Unity side.
        /// The thumbnail will be resized before it sent.
        /// The default falue is 512.
        picker.MaxSize = 1;

        /// Starts pick mdeia from a gallery flow.
        picker.Show((result) => {
            PrintPickerResult(result);
        });
    }
  • result.Media[0].Thumbnail.width = 1 ... why?

Resolved

  • I looked at sample
    [SerializeField] Button m_getPictures;
    
    void Awake()
    {
        m_getPictures.onClick.AddListener(() => {

            AN_MediaPicker picker = new AN_MediaPicker(AN_MediaType.Image);

            /// Defines if multiple images picker is allowed.
            /// The default falue is < c > false </ c >
            picker.AllowMultiSelect = true;

            /// Max thumbnail size that will be trsnafered to the Unity side.
            /// The thumbnail will be resized before it sent.
            /// The default falue is 512.
            picker.MaxSize = 512;

            /// Starts pick mdeia from a gallery flow.
            picker.Show((result) => {
                PrintPickerResult(result);
            });
        });
    }
  • It works!
  • There is difference between "Delegate?" and "uGUI OnClick"
  • Follow sample

uGUIではじめるUnity UIデザインの教科書-Unity5対応

uGUIではじめるUnity UIデザインの教科書-Unity5対応