意见反馈增加图片
This commit is contained in:
1 parent
b11c5de681
commit
510cd11049
8 files changed
+130
-30
No files matched your search
@@ -75,26 +75,32 @@ public class FeedbackController : PFUIPanel
|
||||
main.Find("Time").Find("Value").Find("Text").GetComponent<Text>().text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
GameObject selectObject = null;
|
||||
void AddImage(BaseEventData e,int index)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
//App.ImageSelectorController.Select();
|
||||
#else
|
||||
selectObject = ((PointerEventData)e).pointerEnter;
|
||||
App.imageSelectorController.Select();
|
||||
#else
|
||||
var self = ((PointerEventData)e).pointerEnter;
|
||||
Utils.OpenFile((path) =>
|
||||
{
|
||||
if (paths.ContainsValue(path))
|
||||
{
|
||||
Utils.showToast(gameObject, "Picture already exists, please choose another picture");//图片已存在,请选择其他图片
|
||||
return;
|
||||
}
|
||||
self.GetComponent<Image>().sprite = Utils.PngToSprite(path, 110, 110);
|
||||
self.transform.Find("close").gameObject.SetActive(true);
|
||||
paths[self.name] = path;
|
||||
HandlePath(self, path);
|
||||
});
|
||||
#endif
|
||||
|
||||
}
|
||||
void HandlePath(GameObject self,string path)
|
||||
{
|
||||
if (paths.ContainsValue(path))
|
||||
{
|
||||
Utils.showToast(gameObject, "Picture already exists, please choose another picture");//图片已存在,请选择其他图片
|
||||
return;
|
||||
}
|
||||
self.GetComponent<Image>().sprite = Utils.PngToSprite(path, 110, 110);
|
||||
self.transform.Find("close").gameObject.SetActive(true);
|
||||
paths[self.name] = path;
|
||||
}
|
||||
void DelImage(BaseEventData e,Transform self,int index)
|
||||
{
|
||||
self.GetComponent<Image>().sprite = plus;
|
||||
@@ -134,6 +140,11 @@ public class FeedbackController : PFUIPanel
|
||||
public void OnMobileImageSelect(string res)
|
||||
{
|
||||
Debug.Log(res);
|
||||
Utils.showToast(gameObject, res, type: 1);
|
||||
if (res.IndexOf("true,") == 0 && selectObject!=null)
|
||||
{
|
||||
var path = res.Replace("true,", "");
|
||||
HandlePath(selectObject, path);
|
||||
}
|
||||
//Utils.showToast(gameObject, res, type: 1);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user