Merge remote-tracking branch 'origin/dev_cyp' into dev_nonearth
# Conflicts: # Assets/Resources/UI/Prefab/Ride/Mobile/Panel.prefab
This commit is contained in:
commit
3da24b200d
92 files changed
+14390
-678
No files matched your search
@@ -18,7 +18,7 @@ public delegate void ChangeLanguageDelegate();
|
||||
|
||||
public static class App
|
||||
{
|
||||
public static string Host = "http://192.168.0.101:5084/";
|
||||
public static string Host = "http://192.168.0.101:5087/";
|
||||
|
||||
public static string AppVersion = Application.version;
|
||||
|
||||
@@ -109,6 +109,7 @@ public static class App
|
||||
private static string language { get; set; }
|
||||
|
||||
public static Dictionary<string, string> LanguageManager { get; set; }
|
||||
public static string CurrentRouteType { get; set; }
|
||||
#region 语言改变事件
|
||||
public static event ChangeLanguageDelegate ChangeLanguageEvent;
|
||||
static Dictionary<string, Dictionary<string, string>> dic;
|
||||
@@ -141,6 +142,7 @@ public static class App
|
||||
private static void InitLanguage()
|
||||
{
|
||||
var systemLanguage = Application.systemLanguage.ToString().ToLower();
|
||||
Debug.Log(systemLanguage);
|
||||
if (systemLanguage.Contains("chinese"))
|
||||
{
|
||||
language = "zh";
|
||||
|
||||
@@ -27,6 +27,9 @@ public class WeChatController
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool checkLocation();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void ShareImgToWX(int scene, byte[] msgByteArrayData, int arrayLength);
|
||||
#endif
|
||||
#endregion
|
||||
/// <summary>
|
||||
@@ -128,6 +131,14 @@ public class WeChatController
|
||||
{
|
||||
mainActivityClass.CallStatic("ShareImageToWX", scene, ImageToBytes(image));
|
||||
}
|
||||
public void ShareImageToWX(int scene, byte[] image)
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
mainActivityClass.CallStatic("ShareImageToWX", scene, image);
|
||||
#elif UNITY_IOS
|
||||
ShareImgToWX(scene,image,image.Length);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分享音乐至微信
|
||||
|
||||
@@ -104,6 +104,7 @@ public class MainController : BaseScene
|
||||
else
|
||||
{
|
||||
UIManager.ShowHomePanel();
|
||||
//UIManager.ShowNewRouteOverviewPanel();
|
||||
//UIManager.ShowUserInfoPanel();
|
||||
//UIManager.ShowEditUserPanel();
|
||||
//UIManager.ShowBigMapPanel();
|
||||
|
||||
@@ -1090,8 +1090,11 @@ public BaseUIManager singleUIManager;
|
||||
}
|
||||
cyclingController.recorderData.SaveWithLocalRecordAysnc(cyclingModel, selectParamModel, imageFileName, recordId, path);
|
||||
}
|
||||
|
||||
protected void CaptureCamera(Camera camera, Rect rect,string fileName)
|
||||
public byte[] CaptureCamera()
|
||||
{
|
||||
return CaptureCameraReturnByte(Camera.main, new Rect(Screen.width * 0f, Screen.height * 0f, Screen.width * 0.5f, Screen.height * 0.5f));
|
||||
}
|
||||
private byte[] CaptureCameraReturnByte(Camera camera, Rect rect)
|
||||
{
|
||||
// 创建一个RenderTexture对象
|
||||
RenderTexture rt = new RenderTexture((int)rect.width, (int)rect.height, 0);
|
||||
@@ -1115,8 +1118,11 @@ public BaseUIManager singleUIManager;
|
||||
RenderTexture.active = null; // JC: added to avoid errors
|
||||
GameObject.Destroy(rt);
|
||||
// 最后将这些纹理数据,成一个图片文件
|
||||
byte[] bytes = screenShot.EncodeToJPG();
|
||||
|
||||
return screenShot.EncodeToJPG();
|
||||
}
|
||||
protected void CaptureCamera(Camera camera, Rect rect,string fileName)
|
||||
{
|
||||
byte[] bytes = CaptureCameraReturnByte(camera, rect);
|
||||
//var path = Helper.GetDataDir("MapWorkoutRecords/images");
|
||||
//string filename = path + "/" + Guid.NewGuid().ToString() + ".png";
|
||||
System.IO.File.WriteAllBytes(fileName, bytes);
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#region 功能按钮
|
||||
GameObject goResultBtn;
|
||||
GameObject cancelBtn;
|
||||
GameObject shareWxBtn;
|
||||
#endregion
|
||||
|
||||
CyclingController cyclingController;
|
||||
@@ -67,6 +68,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#endregion
|
||||
goResultBtn = transform.Find("ConFirmButton").gameObject;
|
||||
cancelBtn = transform.Find("CloseButton").gameObject;
|
||||
shareWxBtn = transform.Find("ToolBarPanel/WeChatButton").gameObject;
|
||||
|
||||
}
|
||||
|
||||
public void InjectController(CyclingController controller)
|
||||
@@ -74,7 +77,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cyclingController = controller;
|
||||
cyclingController.AddEvent(goResultBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, GoResult);
|
||||
cyclingController.AddEvent(cancelBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Cancel);
|
||||
cyclingController.AddEvent(shareWxBtn, EventTriggerType.PointerClick, shareToWx);
|
||||
}
|
||||
|
||||
private void shareToWx(BaseEventData b)
|
||||
{
|
||||
var bs = cyclingController.CaptureCamera();
|
||||
WeChatController.Instance.ShareImageToWX(0, bs);
|
||||
}
|
||||
|
||||
private void GoResult(BaseEventData baseEventData)
|
||||
{
|
||||
if (App.MainSceneParam.ContainsKey("Name"))
|
||||
|
||||
@@ -11,6 +11,7 @@ public class MainNav : MonoBehaviour
|
||||
{
|
||||
private GameObject exit;
|
||||
private GameObject home;
|
||||
private GameObject back;
|
||||
float delayTime = 0;
|
||||
private void Awake()
|
||||
{
|
||||
@@ -35,6 +36,8 @@ public class MainNav : MonoBehaviour
|
||||
|
||||
exit = this.transform.Find("Exit").gameObject;
|
||||
exit.SetActive(false);
|
||||
back = transform.Find("Back").gameObject;
|
||||
back.SetActive(false);
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
UIManager.AddEvent(transform.Find("Delay").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
@@ -50,6 +53,10 @@ public class MainNav : MonoBehaviour
|
||||
Application.Quit();
|
||||
},2);
|
||||
});
|
||||
UIManager.AddEvent(back, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.ShowPrePanel();
|
||||
});
|
||||
|
||||
UIManager.AddEvent(transform.Find("Setting").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
@@ -59,6 +66,7 @@ public class MainNav : MonoBehaviour
|
||||
{
|
||||
UIManager.ShowFeedBackModal();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void ShowRowerTab()
|
||||
@@ -113,4 +121,15 @@ public class MainNav : MonoBehaviour
|
||||
home.SetActive(false);
|
||||
}
|
||||
}
|
||||
public void ShowBack()
|
||||
{
|
||||
if (back)
|
||||
{
|
||||
back.SetActive(true);
|
||||
}
|
||||
if (home)
|
||||
{
|
||||
home.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4af62cb706fda9942811083d25f8979c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class NewRouteGroupController : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2959aae525eea154bbb9c039b9166fd5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -57,6 +57,7 @@ public class EditUserController : PFUIPanel, INativeOnMobileImageSelect
|
||||
userApi = new UserApi();
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
panel = this.transform.Find("Panel");
|
||||
pan = new TKPanRecognizer();
|
||||
#else
|
||||
panel = this.transform.Find("Panel/MainPanel");
|
||||
panelTop = null;
|
||||
|
||||
@@ -112,7 +112,7 @@ public class HomeController : PFUIPanel
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.ShowMapListPanel();
|
||||
UIManager.ShowNewRouteOverviewPanel();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -92,6 +92,7 @@ public class MapListController : PFUIPanel
|
||||
map = Resources.Load<GameObject>("UI/Prefab/MapList/MapItem-Mobile");
|
||||
#else
|
||||
topContainer = transform.Find("Panel").Find("Top");
|
||||
transform.Find("MainNav").GetComponent<MainNav>().ShowBack();
|
||||
#endif
|
||||
sort = "Near";
|
||||
sortDire = "asc";
|
||||
@@ -386,6 +387,10 @@ public class MapListController : PFUIPanel
|
||||
|
||||
public void ResetPanel()
|
||||
{
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
var routeTypeName = transform.Find("Panel/Top/RouteTypeName");
|
||||
routeTypeName.GetComponent<Text>().text = App.GetLocalString(App.CurrentRouteType);
|
||||
#endif
|
||||
if (searchInput != null)
|
||||
{
|
||||
//empty Data
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
using Assets.Scripts;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class NewRouteOverviewController: PFUIPanel
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
Transform tmpGroup;
|
||||
Transform tmpItem;
|
||||
void Start()
|
||||
{
|
||||
tmpGroup = Resources.Load<Transform>("UI/Prefab/NewRoute/RouteGroup");
|
||||
tmpItem = Resources.Load<Transform>("UI/Prefab/NewRoute/RouteItem");
|
||||
var rect = transform.Find("Container/Right/Scroll View/Viewport/Content")
|
||||
.GetComponent<RectTransform>();
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var group = Instantiate<Transform>(tmpGroup);
|
||||
for (int j = 0; j < 10; j++)
|
||||
{
|
||||
var item = Instantiate<Transform>(tmpItem);
|
||||
item.SetParent(group.Find("Content"));
|
||||
}
|
||||
group.SetParent(rect);
|
||||
group.localScale = Vector3.one;
|
||||
}
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
|
||||
|
||||
var left = transform.Find("Container/Left");
|
||||
UIManager.AddEvent(left.Find("MyUpload").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
ToList("My Upload");
|
||||
});
|
||||
UIManager.AddEvent(left.Find("MyCollection").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
ToList("My Collection");
|
||||
});
|
||||
UIManager.AddEvent(left.Find("RecentRoute").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
ToList("Recent Routes");
|
||||
});
|
||||
UIManager.AddEvent(left.Find("AllRoutes").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
ToList("All Route");
|
||||
});
|
||||
}
|
||||
|
||||
void ToList(string type)
|
||||
{
|
||||
App.CurrentRouteType = type;// "";
|
||||
UIManager.ShowMapListPanel();
|
||||
}
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
Debug.Log("触发59");
|
||||
transform.MyDOFade();
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 198d3ec3822927f44af9fb241ac00195
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -310,7 +310,20 @@ public class UIManager : MonoBehaviour
|
||||
UIManager.Show(UIManager.Instance.RowerSelector, null, true);
|
||||
}
|
||||
/*划船机页面*/
|
||||
|
||||
#region 新版路线页面
|
||||
private NewRouteOverviewController mNewRouteOverviewController;
|
||||
public NewRouteOverviewController NewRouteOverviewPanel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetPanelInstance("NewRouteOverviewPanel", ref this.mNewRouteOverviewController);
|
||||
}
|
||||
}
|
||||
public static void ShowNewRouteOverviewPanel()
|
||||
{
|
||||
UIManager.Show(UIManager.Instance.NewRouteOverviewPanel, UIManager.Instance.MainPanel);
|
||||
}
|
||||
#endregion
|
||||
private CountDownAnimation mCountDownAnimation;
|
||||
public CountDownAnimation CountDownAnimation
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user