Пример #1
0
        private Example4Flyer AddFlyer()
        {
            GameObject    gobj = GameObject.CreatePrimitive(PrimitiveType.Quad);
            Example4Flyer fly  = gobj.AddComponent <Example4Flyer>();

            gobj.SetActive(false);
            fly.transform.parent = _transform;
            fly.GetComponent <Renderer>().sharedMaterial = material;

            galleryFlyers.Add(fly);
            return(fly);
        }
Пример #2
0
        /// <summary>
        /// Example callback from plugin, matching both possible callbacks
        /// </summary>
        /// <param name="value">the filename (or names) of the selected file</param>
        internal void CustomeReceiver(string result)
        {
            int index = -1;

            string[] parts = result.Split('|');

            string load = null;

            if (parts.Length == 1)
            {
                //picker result
                load = parts[0];
            }
            else
            {
                if (parts.Length != 2 || !int.TryParse(parts[0], out index))
                {
                    Debug.LogError("Selected callback was not valid for the executed action");
                    return;
                }

                load = parts[1];

                //manually remove the entry
                imagePicker.RemoveReceivedEntry(index);
            }


            if (string.IsNullOrEmpty(load))
            {
                //use logcat to get more information
                Debug.Log("SDCard full or invalid file selected, please try again");
                return;
            }

            Example4Flyer fly = AddFlyer();

            StartCoroutine(LoadImage(load, texture => fly.image = texture));
        }