iosbug;android不需要导出项目;修改样式;可修改头像
This commit is contained in:
1 parent
50ad74bb09
commit
f1f982b90c
28 files changed
+500
-94
No files matched your search
@@ -11,7 +11,7 @@ using Assets.Scripts.Devices;
|
||||
|
||||
public static class App
|
||||
{
|
||||
public static string Host = "http://192.168.0.101:5084/";
|
||||
public static string Host = "http://192.168.0.101:5085/";
|
||||
|
||||
public static string AppVersion = Application.version;
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ public class ImageSelectorController
|
||||
private AndroidJavaObject mainActivityObject = null;
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
private static extern void IOS_OpenCamera();
|
||||
private static extern void IOS_OpenCamera(string pageName);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void IOS_OpenAlbum();
|
||||
private static extern void IOS_OpenAlbum(string pageName);
|
||||
#endif
|
||||
private static ImageSelectorController _instance;
|
||||
public static ImageSelectorController Instance
|
||||
@@ -36,12 +36,12 @@ public class ImageSelectorController
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Select()
|
||||
public void Select(string pageName)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
IOS_OpenAlbum();
|
||||
IOS_OpenAlbum(pageName);
|
||||
#else
|
||||
mainActivityObject.Call("Select");
|
||||
mainActivityObject.Call("Select",pageName);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95192428b4cb1074ebe79c54bc82b61c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Mobile.Interface
|
||||
{
|
||||
interface INativeOnMobileImageSelect
|
||||
{
|
||||
void OnMobileImageSelect(string res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20d3ae0f40b27134cbb2f6f710329532
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,6 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Mobile.Interface;
|
||||
using Assets.Scripts.UI.Control;
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -9,7 +10,7 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FeedbackController : PFUIPanel
|
||||
public class FeedbackController : PFUIPanel, INativeOnMobileImageSelect
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
Transform main,images;
|
||||
@@ -80,7 +81,7 @@ public class FeedbackController : PFUIPanel
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
selectObject = ((PointerEventData)e).pointerEnter;
|
||||
App.imageSelectorController.Select();
|
||||
App.imageSelectorController.Select("FeedbackModal(Clone)");
|
||||
#else
|
||||
var self = ((PointerEventData)e).pointerEnter;
|
||||
Utils.OpenFile((path) =>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Assets.Scripts.Mobile.Interface;
|
||||
using Assets.Scripts.UI.Control;
|
||||
using Assets.Scripts.UI.UIEffect;
|
||||
using DG.Tweening;
|
||||
@@ -17,7 +18,7 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class EditUserController : PFUIPanel
|
||||
public class EditUserController : PFUIPanel, INativeOnMobileImageSelect
|
||||
{
|
||||
private Button mSaveButton;
|
||||
private PFUIDropdown mSexDropdown;
|
||||
@@ -104,6 +105,7 @@ public class EditUserController : PFUIPanel
|
||||
UIManager.AddEvent(mBackButton.gameObject, EventTriggerType.PointerClick, Cancel);
|
||||
UIManager.AddEvent(mChangeAvatar.gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
OpenFileName ofn = new OpenFileName();
|
||||
|
||||
ofn.structSize = Marshal.SizeOf(ofn);
|
||||
@@ -131,6 +133,9 @@ public class EditUserController : PFUIPanel
|
||||
{
|
||||
ChangeAvatar(ofn.file);
|
||||
}
|
||||
#else
|
||||
App.imageSelectorController.Select("EditUserPanel(Clone)");
|
||||
#endif
|
||||
});
|
||||
|
||||
linkContainer = transform.Find("LinkContainer");
|
||||
@@ -425,4 +430,13 @@ public class EditUserController : PFUIPanel
|
||||
// UIManager.ShowPrePanel();
|
||||
//}
|
||||
}
|
||||
|
||||
public void OnMobileImageSelect(string res)
|
||||
{
|
||||
if (res.IndexOf("true,") == 0)
|
||||
{
|
||||
var path = res.Replace("true,", "");
|
||||
ChangeAvatar(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public class HomeController : PFUIPanel
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.ShowConfirm("未检测到应用", "是否前往官网下载?", () =>
|
||||
UIManager.ShowConfirm("Workouts not installed", "Go to the official website to download?", () =>
|
||||
{
|
||||
UIManager.CloseConfirm();
|
||||
Application.OpenURL("http://www.powerfun.com/Download");
|
||||
|
||||
@@ -165,11 +165,17 @@ public class RaceHomeScript : RaceScript
|
||||
//{
|
||||
// banner.GetComponent<RawImage>().color = Utils.HexToColorHtml("#0000ff");
|
||||
//}
|
||||
|
||||
UIManager.AddEvent(banner.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
UIManager.AddEvent(banner, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
OnBannerClick(activity);
|
||||
});
|
||||
#else
|
||||
UIManager.AddEvent(banner.transform.Find("BtnEnter").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
OnBannerClick(activity);
|
||||
});
|
||||
#endif
|
||||
banner.transform.SetParent(scroll.content);
|
||||
dot.GetComponent<Image>().color =
|
||||
i == 0 ? Utils.HexToColorHtml("#f93086") : Utils.HexToColorHtml("#ffffff");
|
||||
|
||||
Reference in new issue
Block a user