切换移动端暂存
This commit is contained in:
parent
11e9acdb14
commit
35b5ab59d3
@ -12,10 +12,11 @@ public class MyBuildPostprocessor
|
||||
{
|
||||
//Debug.Log(pathToBuiltProject);
|
||||
//System.IO.File.AppendAllText("D:\\test.txt",pathToBuiltProject);
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
var dir = Path.GetDirectoryName(pathToBuiltProject);
|
||||
|
||||
File.Copy(dir + "\\PowerFun_Data\\Plugins\\x86_64\\ANT_WrappedLib.dll", dir + "\\PowerFun_Data\\Managed\\ANT_WrappedLib.dll");
|
||||
File.Copy(dir + "\\PowerFun_Data\\Plugins\\x86_64\\DSI_CP210xManufacturing_3_1.dll", dir + "\\PowerFun_Data\\Managed\\DSI_CP210xManufacturing_3_1.dll");
|
||||
File.Copy(dir + "\\PowerFun_Data\\Plugins\\x86_64\\DSI_SiUSBXp_3_1.dll", dir + "\\PowerFun_Data\\Managed\\DSI_SiUSBXp_3_1.dll");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#import <MapboxMobileEvents/MapboxMobileEvents.h>
|
||||
#import "MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h"
|
||||
|
||||
void initialize(const char* accessToken, const char* userAgentBase, const char* hostSDKVersion) {
|
||||
[[MMEEventsManager sharedManager] initializeWithAccessToken:[NSString stringWithUTF8String:accessToken]
|
||||
|
||||
@ -8,7 +8,7 @@ FOUNDATION_EXPORT const unsigned char MapboxMobileEventsVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <MapboxMobileEvents/PublicHeader.h>
|
||||
|
||||
#import <MapboxMobileEvents/MMEConstants.h>
|
||||
#import <MapboxMobileEvents/MMEEvent.h>
|
||||
#import <MapboxMobileEvents/MMETypes.h>
|
||||
#import <MapboxMobileEvents/MMEEventsManager.h>
|
||||
#import <MMEConstants.h>
|
||||
#import <MMEEvent.h>
|
||||
#import <MMETypes.h>
|
||||
#import <MMEEventsManager.h>
|
||||
8
Assets/Plugins/Android.meta
Normal file
8
Assets/Plugins/Android.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c0b73ecbec479c43a99fc8513bbf95b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17
Assets/Plugins/Android/AndroidManifest.xml
Normal file
17
Assets/Plugins/Android/AndroidManifest.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
|
||||
<application>
|
||||
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="powerfunx" android:host="app" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
7
Assets/Plugins/Android/AndroidManifest.xml.meta
Normal file
7
Assets/Plugins/Android/AndroidManifest.xml.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 506e447c8b55f0449ae2b5b5ed37dd99
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -5,7 +5,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Apis
|
||||
{
|
||||
internal class MapCompetitionApi : ApiBase
|
||||
|
||||
@ -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:5083/";
|
||||
|
||||
public static string AppVersion = Application.version;
|
||||
|
||||
@ -72,12 +72,12 @@ public static class App
|
||||
static App()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
// Host = "http://pf.juze.pro/";
|
||||
// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
||||
// TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
|
||||
Host = "https://wx.powerfun.com.cn/";
|
||||
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
|
||||
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
|
||||
Host = "http://pf.juze.pro/";
|
||||
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
||||
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
|
||||
//Host = "https://wx.powerfun.com.cn/";
|
||||
//UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
|
||||
//TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,8 +14,10 @@ namespace Assets.Scripts.Devices
|
||||
private List<DeviceAdapter> adapters = new List<DeviceAdapter>();
|
||||
public MainDeviceAdapter()
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
this.CreateAntAdapter();
|
||||
this.CreateBleAdapter();
|
||||
#endif
|
||||
}
|
||||
|
||||
private void CreateAntAdapter()
|
||||
|
||||
@ -21,7 +21,9 @@ using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
using ZenFulcrum.EmbeddedBrowser;
|
||||
#endif
|
||||
//记录:小f 是-457和-681
|
||||
|
||||
public class QUserInfo
|
||||
@ -86,7 +88,9 @@ public class LoginController : MonoBehaviour
|
||||
//注册主页面
|
||||
private UserResultModel userResult;
|
||||
/*微信相关*/
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
private Browser wxBrowser;
|
||||
#endif
|
||||
private string wxState;
|
||||
private Transform wxLogin1;
|
||||
private Transform wxLogin2;
|
||||
@ -252,6 +256,7 @@ public class LoginController : MonoBehaviour
|
||||
var wechatLogin = loginContainer.Find("otherContainer").Find("Wechat").GetComponent<Button>();
|
||||
UIManager.AddEvent(wechatLogin.gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
if (wxLock) return;
|
||||
wxLock = true;
|
||||
//wxState = (DateTime.Now.ToUniversalTime().Ticks / 10000 * new System.Random().Next(1, 5)).ToString();
|
||||
@ -269,7 +274,7 @@ public class LoginController : MonoBehaviour
|
||||
//Debug.Log(178 + "已经开启" + wx1.gameObject.activeSelf);
|
||||
//wx1.GetComponent<CanvasGroup>().DOFade(1, 0.8f).onComplete = () => { wxLock = false; };
|
||||
wxLogin1.DOLocalMoveY(0, 0.3f).onComplete = () => { wxLock = false; };
|
||||
|
||||
#endif
|
||||
});
|
||||
|
||||
var login = loginContainer.Find("login").GetComponent<Button>();
|
||||
@ -311,6 +316,7 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
wxReturnLogin();
|
||||
});
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
wxBrowser = wxLogin1.Find("Browser (GUI)").GetComponent<Browser>();
|
||||
if (wxBrowser != null)
|
||||
{
|
||||
@ -333,6 +339,7 @@ public class LoginController : MonoBehaviour
|
||||
//browser.Zoom = 0.5f;
|
||||
//browser.
|
||||
}
|
||||
#endif
|
||||
}
|
||||
wxLogin2 = mainContent.Find("FormContainer-wx2");
|
||||
if (wxLogin2 != null)
|
||||
@ -519,6 +526,7 @@ public class LoginController : MonoBehaviour
|
||||
/// </summary>
|
||||
private void AdjustWxQrCode()
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
wxBrowser.EvalJSCSP(@"
|
||||
document.getElementsByClassName('qrcode')[0].style.marginTop = 0;
|
||||
document.getElementsByClassName('title')[0].style.display = 'none';
|
||||
@ -528,8 +536,11 @@ public class LoginController : MonoBehaviour
|
||||
document.body.style.transformOrigin = 'top left';
|
||||
document.body.style.transform = 'scale(0.85106382978)';
|
||||
document.body.style.padding = '0';").Done();
|
||||
#endif
|
||||
}
|
||||
//浏览器加载回调
|
||||
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
private async void OnUserScan()
|
||||
{
|
||||
if (wxBrowser.Url.Contains("qrconnect"))
|
||||
@ -590,7 +601,9 @@ public class LoginController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
private void goThirdNext()
|
||||
{
|
||||
this.StartScrollPanel(4);
|
||||
@ -605,7 +618,7 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
#region 倒计时获取验证码
|
||||
#region 倒计时获取验证码
|
||||
int time = 0;
|
||||
float timer = 0f;
|
||||
bool startCaptcha = false;
|
||||
@ -644,7 +657,7 @@ public class LoginController : MonoBehaviour
|
||||
Utils.SetValidate(signFormDict, r.errFieldMsg);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
void CaptchaTimerTick()
|
||||
{
|
||||
@ -882,7 +895,9 @@ public class LoginController : MonoBehaviour
|
||||
void wxReturnLogin()
|
||||
{
|
||||
wxLock = true;
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
wxBrowser.LoadHTML("<div/>");
|
||||
#endif
|
||||
//wxBrowser.Url = "chrome://version/";
|
||||
wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () =>
|
||||
{
|
||||
@ -1178,7 +1193,7 @@ public class LoginController : MonoBehaviour
|
||||
}
|
||||
//float adjTime = 0;
|
||||
//bool startJs = false;
|
||||
#region 主页面滑动逻辑
|
||||
#region 主页面滑动逻辑
|
||||
private int tmpImdex = 0;
|
||||
private int scrollPanelIndex = 2;
|
||||
//private float scrollValue = 0.5f;
|
||||
@ -1217,9 +1232,9 @@ public class LoginController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 注册页面滑动逻辑
|
||||
#region 注册页面滑动逻辑
|
||||
private bool startScrollSign = false;
|
||||
private int scrollSignIndex = 0;
|
||||
|
||||
@ -1285,5 +1300,5 @@ public class LoginController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -175,9 +175,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected virtual void StartRide(BaseEventData baseEvent)
|
||||
{
|
||||
var checkAnt = cyclingController.CheckAnt();
|
||||
#if UNITY_EDITOR
|
||||
//#if UNITY_EDITOR
|
||||
checkAnt = true;
|
||||
#endif
|
||||
//#endif
|
||||
if (!checkAnt && !cyclingController.isWatch)
|
||||
{
|
||||
var alert = (GameObject)Instantiate(Resources.Load("UI/Prefab/Ride/Alert"), panel.transform);
|
||||
|
||||
@ -55,9 +55,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cadance = mainController.UpdateCadence();
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
#if UNITY_EDITOR
|
||||
//#if UNITY_EDITOR
|
||||
power = 500;
|
||||
#endif
|
||||
//#endif
|
||||
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -53,20 +53,8 @@ public class HomeController : PFUIPanel
|
||||
BtnTraining = BtnContainer.Find("BtnTraining");
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
|
||||
//Debug.Log(System.IO.File.Exists(path + ));
|
||||
if (!System.IO.File.Exists(path))
|
||||
{
|
||||
//TODO: auto update
|
||||
UIManager.ShowDownloadWorkoutsPanel();
|
||||
//Application.OpenURL("https://powerfun.oss-cn-shanghai.aliyuncs.com/Releases/PowerFunWorkouts.exe");
|
||||
return;
|
||||
}
|
||||
UIManager.ShowConfirm("Switch to PowerFun Workouts?", "We will close the Powerfun and start PowerFun Workouts.", () =>
|
||||
{
|
||||
Utils.ExecFile(path);
|
||||
Application.Quit();
|
||||
});
|
||||
Debug.Log(Application.platform);
|
||||
goTraining(e);
|
||||
});
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
@ -117,6 +105,27 @@ public class HomeController : PFUIPanel
|
||||
}
|
||||
OnExit(e);
|
||||
}
|
||||
void goTraining(BaseEventData e)
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
|
||||
//Debug.Log(System.IO.File.Exists(path + ));
|
||||
if (!System.IO.File.Exists(path))
|
||||
{
|
||||
//TODO: auto update
|
||||
UIManager.ShowDownloadWorkoutsPanel();
|
||||
//Application.OpenURL("https://powerfun.oss-cn-shanghai.aliyuncs.com/Releases/PowerFunWorkouts.exe");
|
||||
return;
|
||||
}
|
||||
UIManager.ShowConfirm("Switch to PowerFun Workouts?", "We will close the Powerfun and start PowerFun Workouts.", () =>
|
||||
{
|
||||
Utils.ExecFile(path);
|
||||
Application.Quit();
|
||||
});
|
||||
#else
|
||||
Application.OpenURL("powerfun://app");
|
||||
#endif
|
||||
}
|
||||
//进入比赛
|
||||
private void GoMatch(BaseEventData e)
|
||||
{
|
||||
|
||||
@ -38,6 +38,7 @@ GraphicsSettings:
|
||||
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_PreloadedShaders: []
|
||||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
||||
type: 0}
|
||||
|
||||
@ -8,7 +8,7 @@ PlayerSettings:
|
||||
AndroidProfiler: 0
|
||||
AndroidFilterTouchesWhenObscured: 0
|
||||
AndroidEnableSustainedPerformanceMode: 0
|
||||
defaultScreenOrientation: 4
|
||||
defaultScreenOrientation: 3
|
||||
targetDevice: 2
|
||||
useOnDemandResources: 0
|
||||
accelerometerFrequency: 60
|
||||
@ -78,7 +78,7 @@ PlayerSettings:
|
||||
macRetinaSupport: 1
|
||||
runInBackground: 1
|
||||
captureSingleScreen: 0
|
||||
muteOtherAudioSources: 0
|
||||
muteOtherAudioSources: 1
|
||||
Prepare IOS For Recording: 0
|
||||
Force IOS Speakers When Recording: 0
|
||||
deferSystemGesturesMode: 0
|
||||
@ -179,7 +179,7 @@ PlayerSettings:
|
||||
applicationIdentifier: {}
|
||||
buildNumber: {}
|
||||
AndroidBundleVersionCode: 1
|
||||
AndroidMinSdkVersion: 19
|
||||
AndroidMinSdkVersion: 24
|
||||
AndroidTargetSdkVersion: 0
|
||||
AndroidPreferredInstallLocation: 1
|
||||
aotOptions:
|
||||
@ -234,7 +234,8 @@ PlayerSettings:
|
||||
iOSUseLaunchScreenStoryboard: 0
|
||||
iOSLaunchScreenCustomStoryboardPath:
|
||||
iOSDeviceRequirements: []
|
||||
iOSURLSchemes: []
|
||||
iOSURLSchemes:
|
||||
- powerfunx
|
||||
iOSBackgroundModes: 0
|
||||
iOSMetalForceHardShadows: 0
|
||||
metalEditorSupport: 1
|
||||
@ -322,7 +323,99 @@ PlayerSettings:
|
||||
m_Width: 128
|
||||
m_Height: 128
|
||||
m_Kind: 0
|
||||
m_BuildTargetPlatformIcons: []
|
||||
m_BuildTargetPlatformIcons:
|
||||
- m_BuildTarget: Android
|
||||
m_Icons:
|
||||
- m_Textures: []
|
||||
m_Width: 432
|
||||
m_Height: 432
|
||||
m_Kind: 2
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 324
|
||||
m_Height: 324
|
||||
m_Kind: 2
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 216
|
||||
m_Height: 216
|
||||
m_Kind: 2
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 162
|
||||
m_Height: 162
|
||||
m_Kind: 2
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 108
|
||||
m_Height: 108
|
||||
m_Kind: 2
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 81
|
||||
m_Height: 81
|
||||
m_Kind: 2
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 192
|
||||
m_Height: 192
|
||||
m_Kind: 0
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 144
|
||||
m_Height: 144
|
||||
m_Kind: 0
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 96
|
||||
m_Height: 96
|
||||
m_Kind: 0
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 72
|
||||
m_Height: 72
|
||||
m_Kind: 0
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 48
|
||||
m_Height: 48
|
||||
m_Kind: 0
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 36
|
||||
m_Height: 36
|
||||
m_Kind: 0
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 192
|
||||
m_Height: 192
|
||||
m_Kind: 1
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 144
|
||||
m_Height: 144
|
||||
m_Kind: 1
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 96
|
||||
m_Height: 96
|
||||
m_Kind: 1
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 72
|
||||
m_Height: 72
|
||||
m_Kind: 1
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 48
|
||||
m_Height: 48
|
||||
m_Kind: 1
|
||||
m_SubKind:
|
||||
- m_Textures: []
|
||||
m_Width: 36
|
||||
m_Height: 36
|
||||
m_Kind: 1
|
||||
m_SubKind:
|
||||
m_BuildTargetBatching:
|
||||
- m_BuildTarget: Standalone
|
||||
m_StaticBatching: 1
|
||||
@ -637,7 +730,8 @@ PlayerSettings:
|
||||
webGLThreadsSupport: 0
|
||||
webGLWasmStreaming: 0
|
||||
scriptingDefineSymbols: {}
|
||||
platformArchitecture: {}
|
||||
platformArchitecture:
|
||||
iPhone: 1
|
||||
scriptingBackend:
|
||||
Standalone: 0
|
||||
il2cppCompilerConfiguration:
|
||||
@ -651,7 +745,9 @@ PlayerSettings:
|
||||
assemblyVersionValidation: 1
|
||||
gcWBarrierValidation: 0
|
||||
apiCompatibilityLevelPerPlatform:
|
||||
Android: 3
|
||||
Standalone: 3
|
||||
iPhone: 3
|
||||
m_RenderingPath: 1
|
||||
m_MobileRenderingPath: 1
|
||||
metroPackageName: Template_3D
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user