Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble

This commit is contained in:
lishuo committed 2021-09-09 16:32:17 +08:00
commit ca51e06d37
38 files changed
+2373 -1351

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ using Assets.Scripts.Devices;
public static class App
{
public static string Host = "http://192.168.0.101:5184/";
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
@@ -35,12 +35,13 @@ public class ImageSelectorController
//RegisterApp(_APP_ID);
#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
}
}
+8
View File
@@ -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");
@@ -57,7 +57,6 @@ public class MapListController : PFUIPanel
//rectTransform.offsetMin = new Vector2(0, offsetMin.y);
var widthDelta = (transform.parent.parent.GetComponent<RectTransform>().sizeDelta.x -
transform.GetComponent<RectTransform>().sizeDelta.x)/2;
Debug.Log(widthDelta);
//筛选按钮
var topRect = topContainer.GetComponent<RectTransform>();
topRect.localPosition = new Vector3(topRect.localPosition.x - widthDelta
@@ -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");
@@ -193,22 +193,27 @@ public class RaceItemScript : MonoBehaviour
var status = transform.Find("Status");
if (mapCompetition.Status <= 1)
{
status.gameObject.SetActive(false);
status.GetComponent<CanvasGroup>().alpha = 0;
}
else
{
status.GetComponent<RawImage>().color = Utils.HexToColorHtml(statusColorDict[mapCompetition.Status]);
if (mapCompetition.Status == 2 && !mapCompetition.HasJoin)
{
status.gameObject.SetActive(false);
status.GetComponent<CanvasGroup>().alpha = 0;
}
else
{
status.gameObject.SetActive(true);
status.GetComponent<CanvasGroup>().alpha = 1;
status.Find("Text").GetComponent<Text>().text =
mapCompetition.Status == 2?"Registered":mapCompetition.StatusVlaue;
}
}
if (status.GetComponent<ContentFitterController>())
{
Debug.Log("cf刷新一次1");
status.GetComponent<ContentFitterController>().Refresh();
}
}
float? localY = null;
public void OnPointerExit(PointerEventData eventData)
@@ -14,7 +14,7 @@ public class RaceListScript : RaceScript
{
// Start is called before the first frame update
private GameObject scroll;
private Transform content,statusOptionContainer, reserveContainer,dirContainer, searchInput,btnReturn,avatar;
private Transform content,statusOptionContainer, reserveContainer,dirContainer, searchInput,btnReturn,avatar, btnFilter,conditions;
private bool startMouse = false,isEnd = false;
private int pageIndex = 0, pageSize = 24;
private string raceName = "";
@@ -70,7 +70,8 @@ public class RaceListScript : RaceScript
content = scroll.GetComponent<ScrollRect>().content;
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
}
statusOptionContainer = transform.Find("ListContainer/Conditions/StatusContainer");
conditions = transform.Find("Conditions");
statusOptionContainer = conditions.Find("StatusContainer");
if (statusOptionContainer != null)
{
foreach (Transform t in statusOptionContainer)
@@ -140,7 +141,7 @@ public class RaceListScript : RaceScript
}
}
}
reserveContainer = transform.Find("ListContainer/Conditions/ReserveContainer");
reserveContainer = conditions.Find("ReserveContainer");
if (reserveContainer != null)
{
UIManager.AddEvent(reserveContainer.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b=>
@@ -152,7 +153,7 @@ public class RaceListScript : RaceScript
Refresh();
});
}
dirContainer = transform.Find("ListContainer/Conditions/Dir");
dirContainer = transform.Find("Dir");
if (dirContainer != null)
{
var image = dirContainer.Find("Image").GetComponent<Image>();
@@ -171,7 +172,7 @@ public class RaceListScript : RaceScript
Refresh();
});
}
searchInput = transform.Find("ListContainer/Conditions/SearchInput");
searchInput = transform.Find("SearchInput");
if (searchInput != null)
{
//UIManager.AddEvent(searchInput.Find("Button").gameObject, EventTriggerType.PointerClick, (b) =>
@@ -183,7 +184,7 @@ public class RaceListScript : RaceScript
onEndEdit();
});
}
btnReturn = transform.Find("BtnReturn");
btnReturn = transform.Find("SwitchMode/BtnReturn");
if (btnReturn != null)
{
UIManager.AddEvent(btnReturn.gameObject, EventTriggerType.PointerClick, (b) =>
@@ -191,6 +192,8 @@ public class RaceListScript : RaceScript
UIManager.ShowRaceHomePanel(true);
});
}
//Refresh();
}
protected override void Start()
@@ -204,6 +207,33 @@ public class RaceListScript : RaceScript
var rect = transform.GetComponent<RectTransform>();
rect.offsetMax = new Vector2(rect.offsetMax.x, 0);
rect.offsetMin = new Vector2(rect.offsetMin.x, 0);
var widthDelta = (transform.parent.parent.GetComponent<RectTransform>().sizeDelta.x -
transform.GetComponent<RectTransform>().sizeDelta.x) / 2;
var topRect = conditions.GetComponent<RectTransform>();
topRect.localPosition = new Vector3(topRect.localPosition.x - widthDelta
, topRect.localPosition.y, topRect.localPosition.z);
if (!App.topRectStartX.HasValue)
{
App.topRectStartX = topRect.localPosition.x;
}
var mc = transform.Find("MC");
UIManager.AddEvent(transform.Find("SwitchMode/BtnFilter").gameObject, EventTriggerType.PointerClick, b =>
{
conditions.DOLocalMoveX(App.topRectStartX.Value + topRect.rect.width, 0.3f);
mc.gameObject.SetActive(true);
mc.GetComponent<CanvasGroup>().alpha = 0;
mc.GetComponent<CanvasGroup>().DOFade(1, 0.3f);
});
UIManager.AddEvent(mc.gameObject, EventTriggerType.PointerClick, b =>
{
conditions.DOLocalMoveX(App.topRectStartX.Value, 0.3f);
mc.GetComponent<CanvasGroup>().DOFade(0, 0.3f).onComplete = () =>
{
mc.gameObject.SetActive(false);
};
});
#else
#endif
}
+1
View File
@@ -214,6 +214,7 @@ public class UIManager : MonoBehaviour
public static void ShowRaceDetailModal(Transform parent,MapCompetition mapCompetition)
{
UIManager.Show(UIManager.Instance.RaceDetailModal, null, true);
UIManager.Instance.RaceDetailModal.transform.SetAsFirstSibling();
UIManager.Instance.mRaceModalScript.Initial(parent, mapCompetition);
//UIManager.Show(UIManager.Instance.RaceListPanel, UIManager.Instance.MainPanel);
}