void Setup() { if (imagePick == null) { imagePick = SmartMonoBehaviour.FindOrCreate <ImagePicker>(); } //if(data == null) { data = new ImagePickerData(); data.fileSubDir = subDir; data.maxHeight = 512; data.maxWidth = 512; data.quality = -1; //force png's so we can get transparant items data.bestFit = true; data.showCamera = showCam; data.useDefault = useDefault; data.gameObject = imagePick.name; data.callback = imagePick.ImagePickerCallback; data.callbackError = OnError; //data.fileType = "image/png"; //we could change it to Mime Types like */* or image/png, make sure you test any changes in this, as it might lead to segmentation faults if misused. //only mimetypes that start with "image" will be copied and resized, other files will be returned as a path to their original location } StartCoroutine(ScanForFile()); }
public override void Start() { base.Start(); if (items > 0) { items = 0; } #if !UNITY_EDITOR || DEBUG imagePicker = GetOrCreateComponent <ImagePicker>(this); data = new ImagePickerData(null, null, "Gallery", 512, 512, true, true); data.gameObject = gameObject.name; data.callback = CustomeReceiver; #endif lookAt = Camera.main.transform; }