Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebe3dc11e6 | ||
|
|
8dfd4d696c | ||
|
|
734893ff83 | ||
|
|
dd474f1f61 | ||
|
|
936d325cf9 | ||
|
|
5f7cc43593 | ||
|
|
15e440715d | ||
|
|
abd35810bc | ||
|
|
5ec6f4caca | ||
|
|
25c866d090 | ||
|
|
4064d4294a | ||
|
|
541aefe4dd | ||
|
|
1020632757 | ||
|
|
35b50efded | ||
|
|
aa75bb281f | ||
|
|
b6d70e6856 | ||
|
|
432e02e3de | ||
|
|
17eaccb72e | ||
|
|
5671b35dce | ||
|
|
7729332f41 | ||
|
|
2f84f70a5f | ||
|
|
84e8b50bbf | ||
|
|
8e1b4bbbca | ||
|
|
e88f32e99b | ||
|
|
4e4da38252 | ||
|
|
3757ae6e6c |
No files matched your search
@@ -1,71 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Networking;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
using UnityEngine.EventSystems;
|
|
||||||
using UnityEngine.SceneManagement;
|
|
||||||
|
|
||||||
public class ButtonScript : MonoBehaviour
|
|
||||||
{
|
|
||||||
[SerializeField] Button button;
|
|
||||||
[SerializeField] Text text;
|
|
||||||
[SerializeField] GUISkin skin;
|
|
||||||
[SerializeField] InputField input;
|
|
||||||
[SerializeField] Image image;
|
|
||||||
[SerializeField] RawImage rawImage;
|
|
||||||
[SerializeField] EventSystem ec;
|
|
||||||
[SerializeField] UnityEngine.UIElements.ScrollView scroll;
|
|
||||||
private string btnText = "This is a button";
|
|
||||||
// Start is called before the first frame update
|
|
||||||
private void OnGUI()
|
|
||||||
{
|
|
||||||
//GUI.skin = skin;
|
|
||||||
GUI.Label(new Rect(0, 0, 200, 100), "Hi - I'm a label looking like a box", "box");
|
|
||||||
|
|
||||||
// 创建使用"“切换键" GUIStyle 的按钮
|
|
||||||
if (Time.time % 2 < 1 && GUI.Button(new Rect(10, 140, 180, 20), btnText))
|
|
||||||
{
|
|
||||||
btnText = "hello world" + Time.time;
|
|
||||||
}
|
|
||||||
GUI.Button(new Rect(100, 100, 300, 30), "Skinned Button");
|
|
||||||
}
|
|
||||||
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
var a = GameObject.Find("ViewportGrid");
|
|
||||||
Debug.Log($"{Screen.width},{Screen.height}");
|
|
||||||
Debug.Log(gameObject.name);
|
|
||||||
button.onClick.AddListener(() =>
|
|
||||||
{
|
|
||||||
if (SceneManager.GetActiveScene().name == "Demo1")
|
|
||||||
{
|
|
||||||
SceneManager.LoadScene("Demo2");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SceneManager.LoadScene("Demo1");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
input.onEndEdit.AddListener((t)=>
|
|
||||||
{
|
|
||||||
Debug.Log(t);
|
|
||||||
text.text = t;
|
|
||||||
});
|
|
||||||
//image.flexibleWidth = Screen.width;
|
|
||||||
//image.flexibleHeight = Screen.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
void OnDestroy()
|
|
||||||
{
|
|
||||||
button.onClick.RemoveAllListeners();
|
|
||||||
input.onEndEdit.RemoveAllListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
public class ScrollTest : MonoBehaviour
|
|
||||||
{
|
|
||||||
// Start is called before the first frame update
|
|
||||||
private ScrollRect scroll;
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
scroll = gameObject.GetComponent<ScrollRect>();
|
|
||||||
}
|
|
||||||
private bool dir = true;
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
if (dir)
|
|
||||||
{
|
|
||||||
scroll.horizontalNormalizedPosition += 0.01f;
|
|
||||||
if (scroll.horizontalNormalizedPosition >= 1)
|
|
||||||
{
|
|
||||||
dir = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scroll.horizontalNormalizedPosition -= 0.01f;
|
|
||||||
if (scroll.horizontalNormalizedPosition <= 0)
|
|
||||||
{
|
|
||||||
dir = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
Shader "Custom/ImageMask"
|
|
||||||
{
|
|
||||||
Properties
|
|
||||||
{
|
|
||||||
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
|
|
||||||
_Mask ("Base (RGB)", 2D) = "white" {}
|
|
||||||
_Color ("Tint", Color) = (1,1,1,1)
|
|
||||||
_StencilComp ("Stencil Comparison", Float) = 8
|
|
||||||
_Stencil ("Stencil ID", Float) = 0
|
|
||||||
_StencilOp ("Stencil Operation", Float) = 0
|
|
||||||
_StencilWriteMask ("Stencil Write Mask", Float) = 255
|
|
||||||
_StencilReadMask ("Stencil Read Mask", Float) = 255
|
|
||||||
_ColorMask ("Color Mask", Float) = 15
|
|
||||||
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SubShader
|
|
||||||
{
|
|
||||||
Tags
|
|
||||||
{
|
|
||||||
"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True"
|
|
||||||
}
|
|
||||||
|
|
||||||
Stencil
|
|
||||||
{
|
|
||||||
Ref [_Stencil]
|
|
||||||
Comp [_StencilComp]
|
|
||||||
Pass [_StencilOp]
|
|
||||||
ReadMask [_StencilReadMask]
|
|
||||||
WriteMask [_StencilWriteMask]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Cull Off
|
|
||||||
Lighting Off
|
|
||||||
ZWrite Off
|
|
||||||
ZTest [unity_GUIZTestMode]
|
|
||||||
Blend SrcAlpha OneMinusSrcAlpha
|
|
||||||
ColorMask [_ColorMask]
|
|
||||||
|
|
||||||
|
|
||||||
Pass
|
|
||||||
{
|
|
||||||
CGPROGRAM
|
|
||||||
#pragma vertex vert
|
|
||||||
#pragma fragment frag
|
|
||||||
|
|
||||||
|
|
||||||
#include "UnityCG.cginc"
|
|
||||||
#include "UnityUI.cginc"
|
|
||||||
|
|
||||||
|
|
||||||
#pragma multi_compile __ UNITY_UI_ALPHACLIP
|
|
||||||
|
|
||||||
|
|
||||||
struct a2v
|
|
||||||
{
|
|
||||||
fixed2 uv : TEXCOORD0;
|
|
||||||
half4 vertex : POSITION;
|
|
||||||
float4 color : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
fixed4 _Color;
|
|
||||||
|
|
||||||
|
|
||||||
struct v2f
|
|
||||||
{
|
|
||||||
fixed2 uv : TEXCOORD0;
|
|
||||||
half4 vertex : SV_POSITION;
|
|
||||||
float4 color : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
sampler2D _MainTex;
|
|
||||||
sampler2D _Mask;
|
|
||||||
|
|
||||||
|
|
||||||
v2f vert (a2v i)
|
|
||||||
{
|
|
||||||
v2f o;
|
|
||||||
o.vertex = UnityObjectToClipPos(i.vertex);
|
|
||||||
o.uv = i.uv;
|
|
||||||
|
|
||||||
|
|
||||||
o.color = i.color * _Color;
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
fixed4 frag (v2f i) : COLOR
|
|
||||||
{
|
|
||||||
half4 color = tex2D(_MainTex, i.uv) * i.color;
|
|
||||||
half4 mask = tex2D(_Mask, i.uv);
|
|
||||||
color.a *= mask.a;
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
ENDCG
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 36c797600830d844eaec2cfe2b90bfb0
|
|
||||||
ShaderImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
defaultTextures: []
|
|
||||||
nonModifiableTextures: []
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 85685edc9f6bc7a4388e6c542d4de93b
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!21 &2100000
|
|
||||||
Material:
|
|
||||||
serializedVersion: 6
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: New Material
|
|
||||||
m_Shader: {fileID: 4800000, guid: 36c797600830d844eaec2cfe2b90bfb0, type: 3}
|
|
||||||
m_ShaderKeywords:
|
|
||||||
m_LightmapFlags: 4
|
|
||||||
m_EnableInstancingVariants: 0
|
|
||||||
m_DoubleSidedGI: 0
|
|
||||||
m_CustomRenderQueue: -1
|
|
||||||
stringTagMap: {}
|
|
||||||
disabledShaderPasses: []
|
|
||||||
m_SavedProperties:
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TexEnvs:
|
|
||||||
- _BumpMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _DetailAlbedoMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _DetailMask:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _DetailNormalMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _EmissionMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _MainTex:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _Mask:
|
|
||||||
m_Texture: {fileID: 2800000, guid: 426bc972b7c244d40b428c79111a0d76, type: 3}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _MetallicGlossMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _OcclusionMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
- _ParallaxMap:
|
|
||||||
m_Texture: {fileID: 0}
|
|
||||||
m_Scale: {x: 1, y: 1}
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
m_Floats:
|
|
||||||
- _BumpScale: 1
|
|
||||||
- _ColorMask: 15
|
|
||||||
- _Cutoff: 0.5
|
|
||||||
- _DetailNormalMapScale: 1
|
|
||||||
- _DstBlend: 0
|
|
||||||
- _GlossMapScale: 1
|
|
||||||
- _Glossiness: 0.5
|
|
||||||
- _GlossyReflections: 1
|
|
||||||
- _Metallic: 0
|
|
||||||
- _Mode: 0
|
|
||||||
- _OcclusionStrength: 1
|
|
||||||
- _Parallax: 0.02
|
|
||||||
- _SmoothnessTextureChannel: 0
|
|
||||||
- _SpecularHighlights: 1
|
|
||||||
- _SrcBlend: 1
|
|
||||||
- _Stencil: 0
|
|
||||||
- _StencilComp: 8
|
|
||||||
- _StencilOp: 0
|
|
||||||
- _StencilReadMask: 255
|
|
||||||
- _StencilWriteMask: 255
|
|
||||||
- _UVSec: 0
|
|
||||||
- _UseUIAlphaClip: 0
|
|
||||||
- _ZWrite: 1
|
|
||||||
m_Colors:
|
|
||||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: dd6552bd9b1de2747aa636527513d0b8
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 2100000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
Shader "Custom/RotateUVs" {
|
|
||||||
Properties {
|
|
||||||
_MainTex ("Base (RGB)", 2D) = "white" {}
|
|
||||||
_RotationSpeed ("Rotation Speed", Float) = 2.0
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
Tags { "RenderType"="Opaque" }
|
|
||||||
LOD 200
|
|
||||||
|
|
||||||
CGPROGRAM
|
|
||||||
#pragma surface surf Lambert vertex:vert
|
|
||||||
|
|
||||||
sampler2D _MainTex;
|
|
||||||
|
|
||||||
struct Input {
|
|
||||||
float2 uv_MainTex;
|
|
||||||
};
|
|
||||||
|
|
||||||
float _RotationSpeed;
|
|
||||||
void vert (inout appdata_full v) {
|
|
||||||
v.texcoord.xy -=0.5;
|
|
||||||
float s = sin ( _RotationSpeed * _Time );
|
|
||||||
float c = cos ( _RotationSpeed * _Time );
|
|
||||||
float2x2 rotationMatrix = float2x2( c, -s, s, c);
|
|
||||||
rotationMatrix *=0.5;
|
|
||||||
rotationMatrix +=0.5;
|
|
||||||
rotationMatrix = rotationMatrix * 2-1;
|
|
||||||
v.texcoord.xy = mul ( v.texcoord.xy, rotationMatrix );
|
|
||||||
v.texcoord.xy += 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
void surf (Input IN, inout SurfaceOutput o) {
|
|
||||||
half4 c = tex2D (_MainTex, IN.uv_MainTex);
|
|
||||||
o.Albedo = c.rgb;
|
|
||||||
o.Alpha = c.a;
|
|
||||||
}
|
|
||||||
ENDCG
|
|
||||||
}
|
|
||||||
FallBack "Diffuse"
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5a1aa2bd026c81c48bdbc2d02be7dd04
|
|
||||||
ShaderImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
defaultTextures: []
|
|
||||||
nonModifiableTextures: []
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 603 B |
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,116 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b880d26a12584a04ab6b96e822b9e360
|
|
||||||
TextureImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 11
|
|
||||||
mipmaps:
|
|
||||||
mipMapMode: 0
|
|
||||||
enableMipMap: 0
|
|
||||||
sRGBTexture: 1
|
|
||||||
linearTexture: 0
|
|
||||||
fadeOut: 0
|
|
||||||
borderMipMap: 0
|
|
||||||
mipMapsPreserveCoverage: 0
|
|
||||||
alphaTestReferenceValue: 0.5
|
|
||||||
mipMapFadeDistanceStart: 1
|
|
||||||
mipMapFadeDistanceEnd: 3
|
|
||||||
bumpmap:
|
|
||||||
convertToNormalMap: 0
|
|
||||||
externalNormalMap: 0
|
|
||||||
heightScale: 0.25
|
|
||||||
normalMapFilter: 0
|
|
||||||
isReadable: 0
|
|
||||||
streamingMipmaps: 0
|
|
||||||
streamingMipmapsPriority: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 6
|
|
||||||
cubemapConvolution: 0
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: 1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
filterMode: -1
|
|
||||||
aniso: -1
|
|
||||||
mipBias: -100
|
|
||||||
wrapU: 0
|
|
||||||
wrapV: 0
|
|
||||||
wrapW: 0
|
|
||||||
nPOTScale: 0
|
|
||||||
lightmap: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 1
|
|
||||||
spriteExtrude: 1
|
|
||||||
spriteMeshType: 1
|
|
||||||
alignment: 0
|
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
|
||||||
spritePixelsToUnits: 100
|
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
|
||||||
alphaUsage: 1
|
|
||||||
alphaIsTransparency: 1
|
|
||||||
spriteTessellationDetail: -1
|
|
||||||
textureType: 8
|
|
||||||
textureShape: 1
|
|
||||||
singleChannelComponent: 0
|
|
||||||
maxTextureSizeSet: 0
|
|
||||||
compressionQualitySet: 0
|
|
||||||
textureFormatSet: 0
|
|
||||||
applyGammaDecoding: 0
|
|
||||||
platformSettings:
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: DefaultTexturePlatform
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Standalone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
|
||||||
serializedVersion: 2
|
|
||||||
sprites: []
|
|
||||||
outline: []
|
|
||||||
physicsShape: []
|
|
||||||
bones: []
|
|
||||||
spriteID: 5e97eb03825dee720800000000000000
|
|
||||||
internalID: 0
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
secondaryTextures: []
|
|
||||||
spritePackingTag:
|
|
||||||
pSDRemoveMatte: 0
|
|
||||||
pSDShowRemoveMatteOption: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,256 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6ab82263af6297c409a983013c26f174
|
|
||||||
TextureImporter:
|
|
||||||
internalIDToNameTable:
|
|
||||||
- first:
|
|
||||||
213: 134134969389708294
|
|
||||||
second: png-4_0
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 11
|
|
||||||
mipmaps:
|
|
||||||
mipMapMode: 0
|
|
||||||
enableMipMap: 0
|
|
||||||
sRGBTexture: 1
|
|
||||||
linearTexture: 0
|
|
||||||
fadeOut: 0
|
|
||||||
borderMipMap: 0
|
|
||||||
mipMapsPreserveCoverage: 0
|
|
||||||
alphaTestReferenceValue: 0.5
|
|
||||||
mipMapFadeDistanceStart: 1
|
|
||||||
mipMapFadeDistanceEnd: 3
|
|
||||||
bumpmap:
|
|
||||||
convertToNormalMap: 0
|
|
||||||
externalNormalMap: 0
|
|
||||||
heightScale: 0.25
|
|
||||||
normalMapFilter: 0
|
|
||||||
isReadable: 0
|
|
||||||
streamingMipmaps: 0
|
|
||||||
streamingMipmapsPriority: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 6
|
|
||||||
cubemapConvolution: 0
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: 1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
filterMode: -1
|
|
||||||
aniso: -1
|
|
||||||
mipBias: -100
|
|
||||||
wrapU: 1
|
|
||||||
wrapV: 1
|
|
||||||
wrapW: -1
|
|
||||||
nPOTScale: 0
|
|
||||||
lightmap: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 2
|
|
||||||
spriteExtrude: 1
|
|
||||||
spriteMeshType: 0
|
|
||||||
alignment: 0
|
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
|
||||||
spritePixelsToUnits: 100
|
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
|
||||||
alphaUsage: 1
|
|
||||||
alphaIsTransparency: 1
|
|
||||||
spriteTessellationDetail: 0
|
|
||||||
textureType: 8
|
|
||||||
textureShape: 1
|
|
||||||
singleChannelComponent: 0
|
|
||||||
maxTextureSizeSet: 0
|
|
||||||
compressionQualitySet: 0
|
|
||||||
textureFormatSet: 0
|
|
||||||
applyGammaDecoding: 0
|
|
||||||
platformSettings:
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: DefaultTexturePlatform
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Standalone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
|
||||||
serializedVersion: 2
|
|
||||||
sprites:
|
|
||||||
- serializedVersion: 2
|
|
||||||
name: png-4_0
|
|
||||||
rect:
|
|
||||||
serializedVersion: 2
|
|
||||||
x: 0
|
|
||||||
y: 0
|
|
||||||
width: 100
|
|
||||||
height: 60
|
|
||||||
alignment: 0
|
|
||||||
pivot: {x: 0.5, y: 0.5}
|
|
||||||
border: {x: 28, y: 0, z: 25, w: 0}
|
|
||||||
outline: []
|
|
||||||
physicsShape: []
|
|
||||||
tessellationDetail: 0
|
|
||||||
bones: []
|
|
||||||
spriteID: 6047e624b0b8cd100800000000000000
|
|
||||||
internalID: 134134969389708294
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
outline:
|
|
||||||
- - {x: 0, y: 30}
|
|
||||||
- {x: -2.453384, y: 29.963863}
|
|
||||||
- {x: -4.900857, y: 29.855541}
|
|
||||||
- {x: -7.3365235, y: 29.675295}
|
|
||||||
- {x: -9.754517, y: 29.423557}
|
|
||||||
- {x: -12.14901, y: 29.100937}
|
|
||||||
- {x: -14.514234, y: 28.70821}
|
|
||||||
- {x: -16.844492, y: 28.246323}
|
|
||||||
- {x: -19.13417, y: 27.716387}
|
|
||||||
- {x: -21.377752, y: 27.119678}
|
|
||||||
- {x: -23.569836, y: 26.457638}
|
|
||||||
- {x: -25.705137, y: 25.731857}
|
|
||||||
- {x: -27.778513, y: 24.944088}
|
|
||||||
- {x: -29.784966, y: 24.096226}
|
|
||||||
- {x: -31.719667, y: 23.190313}
|
|
||||||
- {x: -33.57795, y: 22.22853}
|
|
||||||
- {x: -35.355343, y: 21.213202}
|
|
||||||
- {x: -37.047558, y: 20.146767}
|
|
||||||
- {x: -38.650528, y: 19.031796}
|
|
||||||
- {x: -40.16038, y: 17.870975}
|
|
||||||
- {x: -41.573486, y: 16.667103}
|
|
||||||
- {x: -42.886436, y: 15.423078}
|
|
||||||
- {x: -44.09607, y: 14.141897}
|
|
||||||
- {x: -45.19947, y: 12.826647}
|
|
||||||
- {x: -46.19398, y: 11.480496}
|
|
||||||
- {x: -47.07721, y: 10.106688}
|
|
||||||
- {x: -47.84702, y: 8.708532}
|
|
||||||
- {x: -48.501568, y: 7.2893963}
|
|
||||||
- {x: -49.03927, y: 5.8527}
|
|
||||||
- {x: -49.458828, y: 4.401904}
|
|
||||||
- {x: -49.75924, y: 2.9405036}
|
|
||||||
- {x: -49.939774, y: 1.4720187}
|
|
||||||
- {x: -50, y: -0.000012040178}
|
|
||||||
- {x: -49.939774, y: -1.4720428}
|
|
||||||
- {x: -49.75923, y: -2.9405274}
|
|
||||||
- {x: -49.458824, y: -4.401928}
|
|
||||||
- {x: -49.03926, y: -5.852724}
|
|
||||||
- {x: -48.501556, y: -7.2894197}
|
|
||||||
- {x: -47.847008, y: -8.708555}
|
|
||||||
- {x: -47.077194, y: -10.106711}
|
|
||||||
- {x: -46.193966, y: -11.480519}
|
|
||||||
- {x: -45.199455, y: -12.826665}
|
|
||||||
- {x: -44.096054, y: -14.1419115}
|
|
||||||
- {x: -42.886425, y: -15.42309}
|
|
||||||
- {x: -41.57348, y: -16.66711}
|
|
||||||
- {x: -40.160378, y: -17.870981}
|
|
||||||
- {x: -38.650524, y: -19.031797}
|
|
||||||
- {x: -37.04756, y: -20.146767}
|
|
||||||
- {x: -35.355347, y: -21.213198}
|
|
||||||
- {x: -33.57796, y: -22.228527}
|
|
||||||
- {x: -31.71968, y: -23.190306}
|
|
||||||
- {x: -29.784986, y: -24.096216}
|
|
||||||
- {x: -27.77854, y: -24.944077}
|
|
||||||
- {x: -25.705168, y: -25.731848}
|
|
||||||
- {x: -23.569874, y: -26.457626}
|
|
||||||
- {x: -21.377796, y: -27.119667}
|
|
||||||
- {x: -19.134218, y: -27.716373}
|
|
||||||
- {x: -16.844545, y: -28.246311}
|
|
||||||
- {x: -14.514293, y: -28.7082}
|
|
||||||
- {x: -12.149074, y: -29.100927}
|
|
||||||
- {x: -9.754586, y: -29.42355}
|
|
||||||
- {x: -7.3365993, y: -29.67529}
|
|
||||||
- {x: -4.9009376, y: -29.855536}
|
|
||||||
- {x: -2.4534698, y: -29.963861}
|
|
||||||
- {x: -0.00009099629, y: -30}
|
|
||||||
- {x: 2.4532878, y: -29.963867}
|
|
||||||
- {x: 4.9007564, y: -29.855547}
|
|
||||||
- {x: 7.336419, y: -29.675304}
|
|
||||||
- {x: 9.754408, y: -29.423573}
|
|
||||||
- {x: 12.148896, y: -29.100954}
|
|
||||||
- {x: 14.514118, y: -28.708231}
|
|
||||||
- {x: 16.844374, y: -28.246347}
|
|
||||||
- {x: 19.13405, y: -27.716415}
|
|
||||||
- {x: 21.377632, y: -27.119713}
|
|
||||||
- {x: 23.569714, y: -26.457678}
|
|
||||||
- {x: 25.705013, y: -25.731903}
|
|
||||||
- {x: 27.778387, y: -24.944138}
|
|
||||||
- {x: 29.78484, y: -24.096281}
|
|
||||||
- {x: 31.719542, y: -23.190374}
|
|
||||||
- {x: 33.577827, y: -22.2286}
|
|
||||||
- {x: 35.35522, y: -21.213276}
|
|
||||||
- {x: 37.04744, y: -20.146847}
|
|
||||||
- {x: 38.650417, y: -19.031878}
|
|
||||||
- {x: 40.160282, y: -17.871056}
|
|
||||||
- {x: 41.573395, y: -16.667185}
|
|
||||||
- {x: 42.886356, y: -15.423158}
|
|
||||||
- {x: 44.095997, y: -14.141976}
|
|
||||||
- {x: 45.199406, y: -12.826725}
|
|
||||||
- {x: 46.193928, y: -11.480574}
|
|
||||||
- {x: 47.077164, y: -10.106763}
|
|
||||||
- {x: 47.846985, y: -8.708605}
|
|
||||||
- {x: 48.501537, y: -7.2894673}
|
|
||||||
- {x: 49.039246, y: -5.852768}
|
|
||||||
- {x: 49.45881, y: -4.4019685}
|
|
||||||
- {x: 49.759228, y: -2.9405649}
|
|
||||||
- {x: 49.93977, y: -1.4720769}
|
|
||||||
- {x: 50, y: -0.0000425576}
|
|
||||||
- {x: 49.939774, y: 1.4719919}
|
|
||||||
- {x: 49.759243, y: 2.9404802}
|
|
||||||
- {x: 49.45883, y: 4.4018846}
|
|
||||||
- {x: 49.039272, y: 5.852684}
|
|
||||||
- {x: 48.50157, y: 7.2893844}
|
|
||||||
- {x: 47.847027, y: 8.708524}
|
|
||||||
- {x: 47.077213, y: 10.106684}
|
|
||||||
- {x: 46.19398, y: 11.4804945}
|
|
||||||
- {x: 45.19947, y: 12.826648}
|
|
||||||
- {x: 44.096066, y: 14.141901}
|
|
||||||
- {x: 42.88643, y: 15.423084}
|
|
||||||
- {x: 41.573475, y: 16.667112}
|
|
||||||
- {x: 40.160362, y: 17.870989}
|
|
||||||
- {x: 38.650505, y: 19.03181}
|
|
||||||
- {x: 37.047535, y: 20.146784}
|
|
||||||
- {x: 35.355312, y: 21.21322}
|
|
||||||
- {x: 33.57791, y: 22.228554}
|
|
||||||
- {x: 31.719622, y: 23.190334}
|
|
||||||
- {x: 29.784914, y: 24.096249}
|
|
||||||
- {x: 27.778456, y: 24.94411}
|
|
||||||
- {x: 25.705072, y: 25.731882}
|
|
||||||
- {x: 23.569765, y: 26.457663}
|
|
||||||
- {x: 21.377674, y: 27.119701}
|
|
||||||
- {x: 19.134083, y: 27.716408}
|
|
||||||
- {x: 16.844397, y: 28.246344}
|
|
||||||
- {x: 14.514129, y: 28.70823}
|
|
||||||
- {x: 12.148896, y: 29.100954}
|
|
||||||
- {x: 9.754395, y: 29.423574}
|
|
||||||
- {x: 7.3363943, y: 29.675306}
|
|
||||||
- {x: 4.90072, y: 29.85555}
|
|
||||||
- {x: 2.453239, y: 29.963867}
|
|
||||||
physicsShape: []
|
|
||||||
bones: []
|
|
||||||
spriteID: 5e97eb03825dee720800000000000000
|
|
||||||
internalID: 0
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
secondaryTextures: []
|
|
||||||
spritePackingTag:
|
|
||||||
pSDRemoveMatte: 0
|
|
||||||
pSDShowRemoveMatteOption: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
Before Width: | Height: | Size: 178 B |
|
Before Width: | Height: | Size: 581 KiB |
@@ -1137,7 +1137,7 @@ namespace Mapbox.Unity.Map
|
|||||||
|
|
||||||
public virtual void SetCenterLatitudeLongitude(Vector2d centerLatitudeLongitude)
|
public virtual void SetCenterLatitudeLongitude(Vector2d centerLatitudeLongitude)
|
||||||
{
|
{
|
||||||
_options.locationOptions.latitudeLongitude = string.Format("{0}, {1}", centerLatitudeLongitude.x, centerLatitudeLongitude.y);
|
_options.locationOptions.latitudeLongitude = string.Format("{0}, {1}", centerLatitudeLongitude.x.ToString(CultureInfo.InvariantCulture), centerLatitudeLongitude.y.ToString(CultureInfo.InvariantCulture));
|
||||||
_centerLatitudeLongitude = centerLatitudeLongitude;
|
_centerLatitudeLongitude = centerLatitudeLongitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cfc0710c09383b54f8aa661624975c47
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
After Width: | Height: | Size: 4.9 KiB |
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f71381890422d934694a45aeabea2f98
|
guid: 05133d14d67abd743954cf1d04471e99
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 9ec69ed9fb1e5cf49a927dfd46451979
|
guid: 4990d472dee7f3b428ae030c3a2b936f
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 62645928dbf0a324b8a1492a94593da6
|
guid: c8bf9a7776d716b4db8c80b65a648469
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -40,9 +40,9 @@ TextureImporter:
|
|||||||
nPOTScale: 0
|
nPOTScale: 0
|
||||||
lightmap: 0
|
lightmap: 0
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
spriteMode: 3
|
spriteMode: 1
|
||||||
spriteExtrude: 1
|
spriteExtrude: 1
|
||||||
spriteMeshType: 0
|
spriteMeshType: 1
|
||||||
alignment: 0
|
alignment: 0
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
spritePixelsToUnits: 100
|
spritePixelsToUnits: 100
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e2ea38974d9f086499bcf5a101e2e739
|
guid: 06916ce30a8274a4eb000d5781570ad3
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -42,7 +42,7 @@ TextureImporter:
|
|||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
spriteMode: 1
|
spriteMode: 1
|
||||||
spriteExtrude: 1
|
spriteExtrude: 1
|
||||||
spriteMeshType: 0
|
spriteMeshType: 1
|
||||||
alignment: 0
|
alignment: 0
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
spritePixelsToUnits: 100
|
spritePixelsToUnits: 100
|
||||||
@@ -86,11 +86,7 @@ TextureImporter:
|
|||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
outline:
|
outline: []
|
||||||
- - {x: 0, y: 96}
|
|
||||||
- {x: -96, y: -0.000004196293}
|
|
||||||
- {x: 0.000008392586, y: -96}
|
|
||||||
- {x: 96, y: 0.0000011447885}
|
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID: 5e97eb03825dee720800000000000000
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,104 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7ba84d52fa6fd2b428fe76e532bc7c6c
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 11
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: -1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
After Width: | Height: | Size: 519 B |
@@ -0,0 +1,104 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0b4912f50e70fe94485136c6f248136f
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 11
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: -1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
After Width: | Height: | Size: 565 B |
@@ -0,0 +1,104 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0ccaf81a4ca1c1e4ea20f4c52f30a579
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 11
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: -1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -104,7 +104,8 @@ RectTransform:
|
|||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 4347642619387382541}
|
- {fileID: 4347642619387382541}
|
||||||
- {fileID: 5333104648953487716}
|
- {fileID: 5333104648953487716}
|
||||||
- {fileID: 4582282901144642708}
|
- {fileID: 6514089965287851756}
|
||||||
|
- {fileID: 965028425746119384}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
@@ -153,6 +154,80 @@ MonoBehaviour:
|
|||||||
m_DisabledTrigger: Disabled
|
m_DisabledTrigger: Disabled
|
||||||
m_Interactable: 1
|
m_Interactable: 1
|
||||||
m_TargetGraphic: {fileID: 0}
|
m_TargetGraphic: {fileID: 0}
|
||||||
|
--- !u!1 &6092777681612193971
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6514089965287851756}
|
||||||
|
- component: {fileID: 6121838685697673260}
|
||||||
|
- component: {fileID: 7411279575339221392}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Network
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &6514089965287851756
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6092777681612193971}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 189965521107699628}
|
||||||
|
m_RootOrder: 2
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 42, y: 0}
|
||||||
|
m_SizeDelta: {x: 24, y: 24}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &6121838685697673260
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6092777681612193971}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &7411279575339221392
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6092777681612193971}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 0b4912f50e70fe94485136c6f248136f, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
--- !u!1 &6417040487747213529
|
--- !u!1 &6417040487747213529
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -187,7 +262,7 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 50, y: -12}
|
m_AnchoredPosition: {x: 64, y: -12}
|
||||||
m_SizeDelta: {x: 220, y: 30}
|
m_SizeDelta: {x: 220, y: 30}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!222 &7318458415531256946
|
--- !u!222 &7318458415531256946
|
||||||
@@ -231,7 +306,7 @@ MonoBehaviour:
|
|||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: New Text
|
m_Text: New Text
|
||||||
--- !u!1 &8513862428541677370
|
--- !u!1 &6790451822861370522
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -239,73 +314,69 @@ GameObject:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 4582282901144642708}
|
- component: {fileID: 965028425746119384}
|
||||||
- component: {fileID: 828510373746272033}
|
- component: {fileID: 4105398655127643970}
|
||||||
- component: {fileID: 1484798634535886974}
|
- component: {fileID: 8805901114678668108}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: Type
|
m_Name: Signal
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
--- !u!224 &4582282901144642708
|
--- !u!224 &965028425746119384
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8513862428541677370}
|
m_GameObject: {fileID: 6790451822861370522}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 189965521107699628}
|
m_Father: {fileID: 189965521107699628}
|
||||||
m_RootOrder: 2
|
m_RootOrder: 3
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 1, y: 0.5}
|
m_AnchorMin: {x: 1, y: 0.5}
|
||||||
m_AnchorMax: {x: 1, y: 0.5}
|
m_AnchorMax: {x: 1, y: 0.5}
|
||||||
m_AnchoredPosition: {x: -43.46, y: 15}
|
m_AnchoredPosition: {x: -58, y: 0}
|
||||||
m_SizeDelta: {x: 65.85498, y: 30}
|
m_SizeDelta: {x: 16, y: 16}
|
||||||
m_Pivot: {x: 1, y: 1}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &828510373746272033
|
--- !u!222 &4105398655127643970
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8513862428541677370}
|
m_GameObject: {fileID: 6790451822861370522}
|
||||||
m_CullTransparentMesh: 0
|
m_CullTransparentMesh: 0
|
||||||
--- !u!114 &1484798634535886974
|
--- !u!114 &8805901114678668108
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8513862428541677370}
|
m_GameObject: {fileID: 6790451822861370522}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 0.9764706, g: 0.1882353, b: 0.5254902, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 1
|
||||||
m_Maskable: 1
|
m_Maskable: 1
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_FontData:
|
m_Sprite: {fileID: 0}
|
||||||
m_Font: {fileID: 12800000, guid: 9428f2aab98e9c34d923a9174035a197, type: 3}
|
m_Type: 0
|
||||||
m_FontSize: 16
|
m_PreserveAspect: 0
|
||||||
m_FontStyle: 0
|
m_FillCenter: 1
|
||||||
m_BestFit: 0
|
m_FillMethod: 4
|
||||||
m_MinSize: 1
|
m_FillAmount: 1
|
||||||
m_MaxSize: 40
|
m_FillClockwise: 1
|
||||||
m_Alignment: 3
|
m_FillOrigin: 0
|
||||||
m_AlignByGeometry: 0
|
m_UseSpriteMesh: 0
|
||||||
m_RichText: 1
|
m_PixelsPerUnitMultiplier: 1
|
||||||
m_HorizontalOverflow: 0
|
|
||||||
m_VerticalOverflow: 0
|
|
||||||
m_LineSpacing: 1
|
|
||||||
m_Text: ANT+
|
|
||||||
@@ -308,7 +308,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 30, y: -169}
|
m_AnchoredPosition: {x: 30, y: -169}
|
||||||
m_SizeDelta: {x: 85, y: 20}
|
m_SizeDelta: {x: 205.19348, y: 20}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!222 &615180660641507081
|
--- !u!222 &615180660641507081
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 124, y: -40}
|
m_AnchoredPosition: {x: 60, y: -40}
|
||||||
m_SizeDelta: {x: 62, y: 64}
|
m_SizeDelta: {x: 62, y: 64}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!1 &2745425216517653314
|
--- !u!1 &2745425216517653314
|
||||||
@@ -111,6 +111,43 @@ MonoBehaviour:
|
|||||||
m_FillOrigin: 0
|
m_FillOrigin: 0
|
||||||
m_UseSpriteMesh: 0
|
m_UseSpriteMesh: 0
|
||||||
m_PixelsPerUnitMultiplier: 1
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!1 &2777627832895409916
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 2165555432541117810}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: AntIcon
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &2165555432541117810
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2777627832895409916}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 540031521672414432}
|
||||||
|
- {fileID: 4177612200037049886}
|
||||||
|
m_Father: {fileID: 6430829710355291381}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 24.4, y: 1}
|
||||||
|
m_SizeDelta: {x: 44, y: 44}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!1 &3159732546393567601
|
--- !u!1 &3159732546393567601
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -140,15 +177,15 @@ RectTransform:
|
|||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 540031521672414432}
|
- {fileID: 2165555432541117810}
|
||||||
- {fileID: 4177612200037049886}
|
- {fileID: 7669984967702354254}
|
||||||
m_Father: {fileID: 2716191576886074694}
|
m_Father: {fileID: 2716191576886074694}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 64, y: 64}
|
m_SizeDelta: {x: 118, y: 64}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!222 &6268486626046139400
|
--- !u!222 &6268486626046139400
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
@@ -705,6 +742,80 @@ CanvasGroup:
|
|||||||
m_Interactable: 1
|
m_Interactable: 1
|
||||||
m_BlocksRaycasts: 1
|
m_BlocksRaycasts: 1
|
||||||
m_IgnoreParentGroups: 0
|
m_IgnoreParentGroups: 0
|
||||||
|
--- !u!1 &5162363420470615978
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 652708983550405284}
|
||||||
|
- component: {fileID: 2795585007386087676}
|
||||||
|
- component: {fileID: 6254887144258792832}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Image
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &652708983550405284
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5162363420470615978}
|
||||||
|
m_LocalRotation: {x: 0.08715578, y: -0, z: -0, w: 0.9961947}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 7669984967702354254}
|
||||||
|
m_RootOrder: 1
|
||||||
|
m_LocalEulerAnglesHint: {x: 10, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 44, y: 44}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &2795585007386087676
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5162363420470615978}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &6254887144258792832
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5162363420470615978}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 407dc13d102a8d842bbaa773773df936, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
--- !u!1 &5440549946619805752
|
--- !u!1 &5440549946619805752
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -741,7 +852,7 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 1}
|
m_AnchorMin: {x: 0.5, y: 1}
|
||||||
m_AnchorMax: {x: 0.5, y: 1}
|
m_AnchorMax: {x: 0.5, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -90}
|
m_AnchoredPosition: {x: 35.2, y: -90}
|
||||||
m_SizeDelta: {x: 134, y: 34}
|
m_SizeDelta: {x: 134, y: 34}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &3527654833021650121
|
--- !u!222 &3527654833021650121
|
||||||
@@ -828,7 +939,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 136, y: -72}
|
m_AnchoredPosition: {x: 136, y: -72}
|
||||||
m_SizeDelta: {x: 85, y: 20}
|
m_SizeDelta: {x: 251.36475, y: 20}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!222 &6939795344602196707
|
--- !u!222 &6939795344602196707
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
@@ -974,11 +1085,11 @@ RectTransform:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 6502171739230510504}
|
m_GameObject: {fileID: 6502171739230510504}
|
||||||
m_LocalRotation: {x: 0.08715578, y: 0, z: 0, w: 0.9961947}
|
m_LocalRotation: {x: 0.08715578, y: -0, z: -0, w: 0.9961947}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 6430829710355291381}
|
m_Father: {fileID: 2165555432541117810}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 10, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 10, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
@@ -1048,11 +1159,11 @@ RectTransform:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 7066476020851680862}
|
m_GameObject: {fileID: 7066476020851680862}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 6430829710355291381}
|
m_Father: {fileID: 2165555432541117810}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
@@ -1175,6 +1286,117 @@ MonoBehaviour:
|
|||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: Searching...
|
m_Text: Searching...
|
||||||
|
--- !u!1 &8591994605769169618
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6521823677394231837}
|
||||||
|
- component: {fileID: 743327725710735410}
|
||||||
|
- component: {fileID: 1839312524778472856}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Ble
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &6521823677394231837
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8591994605769169618}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 7669984967702354254}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 44, y: 44}
|
||||||
|
m_Pivot: {x: 0, y: 1}
|
||||||
|
--- !u!222 &743327725710735410
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8591994605769169618}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &1839312524778472856
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8591994605769169618}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 05133d14d67abd743954cf1d04471e99, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!1 &8808031170711301744
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 7669984967702354254}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: BleIcon
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &7669984967702354254
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8808031170711301744}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 6521823677394231837}
|
||||||
|
- {fileID: 652708983550405284}
|
||||||
|
m_Father: {fileID: 6430829710355291381}
|
||||||
|
m_RootOrder: 1
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: -28.5, y: 1.4}
|
||||||
|
m_SizeDelta: {x: 44, y: 44}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!1001 &564608893206712879
|
--- !u!1001 &564608893206712879
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1496,7 +1718,7 @@ PrefabInstance:
|
|||||||
- target: {fileID: 2947521786256289149, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
- target: {fileID: 2947521786256289149, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: mType
|
propertyPath: mType
|
||||||
value: 1
|
value: 5
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4634260803276928508, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
- target: {fileID: 4634260803276928508, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -2052,7 +2274,7 @@ PrefabInstance:
|
|||||||
- target: {fileID: 2947521786256289149, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
- target: {fileID: 2947521786256289149, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: mType
|
propertyPath: mType
|
||||||
value: 5
|
value: 4
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4634260803276928508, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
- target: {fileID: 4634260803276928508, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ MonoBehaviour:
|
|||||||
m_ChildForceExpandWidth: 1
|
m_ChildForceExpandWidth: 1
|
||||||
m_ChildForceExpandHeight: 1
|
m_ChildForceExpandHeight: 1
|
||||||
m_ChildControlWidth: 0
|
m_ChildControlWidth: 0
|
||||||
m_ChildControlHeight: 0
|
m_ChildControlHeight: 1
|
||||||
m_ChildScaleWidth: 0
|
m_ChildScaleWidth: 0
|
||||||
m_ChildScaleHeight: 0
|
m_ChildScaleHeight: 0
|
||||||
--- !u!114 &2674253312174825381
|
--- !u!114 &2674253312174825381
|
||||||
@@ -1275,12 +1275,12 @@ PrefabInstance:
|
|||||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -1290,7 +1290,7 @@ PrefabInstance:
|
|||||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -9
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8688565590564084001, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
- target: {fileID: 8688565590564084001, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|||||||
@@ -1320,7 +1320,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: Total riding time
|
m_Text: Total Riding Time
|
||||||
--- !u!1 &4080633421470452234
|
--- !u!1 &4080633421470452234
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -3474,7 +3474,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: Max heart rate
|
m_Text: Max Heart Rate
|
||||||
--- !u!1 &7462604566789801356
|
--- !u!1 &7462604566789801356
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -3708,7 +3708,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: Bike weight
|
m_Text: Bike Weight
|
||||||
--- !u!1 &7462604567111632052
|
--- !u!1 &7462604567111632052
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -5430,6 +5430,11 @@ PrefabInstance:
|
|||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: RideResultList
|
value: RideResultList
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1441145903752631099, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 300
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7974311519597661726, guid: ed226fe096f17a0459f856db5fc494af,
|
- target: {fileID: 7974311519597661726, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
@@ -5470,17 +5475,37 @@ PrefabInstance:
|
|||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8884056308248339237, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_SizeDelta.x
|
||||||
|
value: 261.7354
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8884056308248339243, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Text
|
||||||
|
value: TRAINING DIARY
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8884056308248339243, guid: ed226fe096f17a0459f856db5fc494af,
|
- target: {fileID: 8884056308248339243, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_FontData.m_Font
|
propertyPath: m_FontData.m_Font
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 12800000, guid: 9428f2aab98e9c34d923a9174035a197,
|
objectReference: {fileID: 12800000, guid: 9428f2aab98e9c34d923a9174035a197,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
- target: {fileID: 8884056308248339243, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_FontData.m_Alignment
|
||||||
|
value: 6
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8884056308736538996, guid: ed226fe096f17a0459f856db5fc494af,
|
- target: {fileID: 8884056308736538996, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_SizeDelta.x
|
propertyPath: m_SizeDelta.x
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8884056309303262656, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.x
|
||||||
|
value: 295
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8884056309303262662, guid: ed226fe096f17a0459f856db5fc494af,
|
- target: {fileID: 8884056309303262662, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Text
|
propertyPath: m_Text
|
||||||
@@ -5492,6 +5517,11 @@ PrefabInstance:
|
|||||||
value:
|
value:
|
||||||
objectReference: {fileID: 12800000, guid: 9428f2aab98e9c34d923a9174035a197,
|
objectReference: {fileID: 12800000, guid: 9428f2aab98e9c34d923a9174035a197,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
- target: {fileID: 8884056309303262662, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_FontData.m_Alignment
|
||||||
|
value: 7
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8884056309872452861, guid: ed226fe096f17a0459f856db5fc494af,
|
- target: {fileID: 8884056309872452861, guid: ed226fe096f17a0459f856db5fc494af,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Material
|
propertyPath: m_Material
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: <color=#5c5c6e>Cycling equipment:</color>Dynastream
|
m_Text: <color=#5c5c6e>Cycling Equipment:</color>Dynastream
|
||||||
--- !u!1 &331225471740520315
|
--- !u!1 &331225471740520315
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1582,7 +1582,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: <color=#5c5c6e>Riding time:</color>00:18:52
|
m_Text: <color=#5c5c6e>Riding Time:</color>00:18:52
|
||||||
--- !u!1 &5077901321725402009
|
--- !u!1 &5077901321725402009
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: <color=#5c5c6e>Cycling equipment:</color>Dynastream
|
m_Text: <color=#5c5c6e>Cycling Equipment:</color>Dynastream
|
||||||
--- !u!1 &331225471740520315
|
--- !u!1 &331225471740520315
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1396,7 +1396,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: <color=#5c5c6e>Riding time:</color>00:18:52
|
m_Text: <color=#5c5c6e>Riding Time:</color>00:18:52
|
||||||
--- !u!1 &5077901321725402009
|
--- !u!1 &5077901321725402009
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 1}
|
m_AnchorMin: {x: 0.5, y: 1}
|
||||||
m_AnchorMax: {x: 0.5, y: 1}
|
m_AnchorMax: {x: 0.5, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -65}
|
m_AnchoredPosition: {x: -0.0000038146973, y: -65}
|
||||||
m_SizeDelta: {x: 92, y: 50}
|
m_SizeDelta: {x: 163.5351, y: 50}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &2030232658984377928
|
--- !u!222 &2030232658984377928
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
@@ -155,7 +155,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: Warn
|
m_Text: Warning
|
||||||
--- !u!1 &2030232659281999545
|
--- !u!1 &2030232659281999545
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ GameObject:
|
|||||||
- component: {fileID: 1148602845821646045}
|
- component: {fileID: 1148602845821646045}
|
||||||
- component: {fileID: 1148602845821646048}
|
- component: {fileID: 1148602845821646048}
|
||||||
- component: {fileID: 1148602845821646051}
|
- component: {fileID: 1148602845821646051}
|
||||||
- component: {fileID: 1148602845821646050}
|
- component: {fileID: 6957187063806588864}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: arrow
|
m_Name: MiniArrow
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@@ -65,8 +65,8 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 0}
|
m_Sprite: {fileID: 21300000, guid: 8a1f5dd0a18144c498c99139fcfa3547, type: 3}
|
||||||
m_Type: 0
|
m_Type: 1
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
m_FillMethod: 4
|
m_FillMethod: 4
|
||||||
@@ -75,7 +75,7 @@ MonoBehaviour:
|
|||||||
m_FillOrigin: 0
|
m_FillOrigin: 0
|
||||||
m_UseSpriteMesh: 0
|
m_UseSpriteMesh: 0
|
||||||
m_PixelsPerUnitMultiplier: 1
|
m_PixelsPerUnitMultiplier: 1
|
||||||
--- !u!114 &1148602845821646050
|
--- !u!114 &6957187063806588864
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@@ -84,7 +84,10 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 1148602845821646044}
|
m_GameObject: {fileID: 1148602845821646044}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: adb30198aa32dd140b5750692dd48104, type: 3}
|
m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
radius: 4
|
m_Inverse: 0
|
||||||
|
m_MaskInteraction: 85
|
||||||
|
m_UseStencil: 1
|
||||||
|
m_RaycastFilter: 0
|
||||||
@@ -198,7 +198,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 215, y: 48}
|
m_SizeDelta: {x: 225, y: 48}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &8877223148509276859
|
--- !u!222 &8877223148509276859
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|||||||
@@ -739,6 +739,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: ff5927b9099e57740a8e1c1296251a99, type: 3}
|
m_Script: {fileID: 11500000, guid: ff5927b9099e57740a8e1c1296251a99, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
mMainPanel: {fileID: 0}
|
||||||
Root: {fileID: 0}
|
Root: {fileID: 0}
|
||||||
--- !u!4 &1962586927
|
--- !u!4 &1962586927
|
||||||
Transform:
|
Transform:
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
||||||
using Assets.Scripts.Apis.Models;
|
using Assets.Scripts.Apis.Models;
|
||||||
|
using ChartAndGraph;
|
||||||
|
using DG.Tweening;
|
||||||
using GeoJSON.Net.Geometry;
|
using GeoJSON.Net.Geometry;
|
||||||
using Mapbox.Unity.Map;
|
using Mapbox.Unity.Map;
|
||||||
using Mapbox.Utils;
|
using Mapbox.Utils;
|
||||||
@@ -11,6 +13,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TurfCS;
|
using TurfCS;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Assets.Scenes.Ride.Scripts
|
namespace Assets.Scenes.Ride.Scripts
|
||||||
{
|
{
|
||||||
@@ -76,7 +79,14 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
public Vector2d Currentlatlong { get => currentlatlong; }
|
public Vector2d Currentlatlong { get => currentlatlong; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region UI对象
|
||||||
|
|
||||||
|
//UI对象
|
||||||
|
protected GameObject headPanel;
|
||||||
|
protected GraphChartBase graph;
|
||||||
|
protected ChartDataSourceScript chartDataSourceScript;
|
||||||
|
|
||||||
|
#endregion
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
@@ -102,6 +112,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
mainController = transform.parent.GetComponent<CyclingController>();
|
mainController = transform.parent.GetComponent<CyclingController>();
|
||||||
map = transform.parent.Find("Map").GetComponent<AbstractMap>();
|
map = transform.parent.Find("Map").GetComponent<AbstractMap>();
|
||||||
mapData = mainController.GetMapData();//获取路书信息
|
mapData = mainController.GetMapData();//获取路书信息
|
||||||
|
|
||||||
|
//获取海拔图UI对象
|
||||||
|
var graphObject = transform.parent.Find("SingleUI/Panel/GraphChart");
|
||||||
|
chartDataSourceScript = graphObject.GetComponent<ChartDataSourceScript>();
|
||||||
|
graph = graphObject.GetComponent<GraphChartBase>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Excute()
|
protected virtual void Excute()
|
||||||
@@ -119,9 +134,12 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
//骑行中
|
//骑行中
|
||||||
protected virtual void Run()
|
protected virtual void Run()
|
||||||
{
|
{
|
||||||
|
if (mapData == null)
|
||||||
|
return;
|
||||||
ComputeNextSlope();//计算下一个坡度相关数据
|
ComputeNextSlope();//计算下一个坡度相关数据
|
||||||
|
MoveGraphHead();//移动海拔图头像
|
||||||
//人物动画控制
|
//人物动画控制
|
||||||
if (characterAnimator != null && mapData != null)
|
if (characterAnimator != null)
|
||||||
{
|
{
|
||||||
characterAnimator.SetFloat("Speed", (float)speed);
|
characterAnimator.SetFloat("Speed", (float)speed);
|
||||||
characterAnimator.SetFloat("Slope", (float)currentSlope);
|
characterAnimator.SetFloat("Slope", (float)currentSlope);
|
||||||
@@ -286,5 +304,14 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region UI行为
|
||||||
|
|
||||||
|
protected virtual void MoveGraphHead()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,6 +44,22 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
return index - graph.HorizontalScrolling >= graph.DataSource.HorizontalViewSize / 2;
|
return index - graph.HorizontalScrolling >= graph.DataSource.HorizontalViewSize / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InitHorizontalScrolling(int index)
|
||||||
|
{
|
||||||
|
var halfView = graph.DataSource.HorizontalViewSize / 2;
|
||||||
|
if (index >= halfView)
|
||||||
|
{
|
||||||
|
if (index + halfView >= mData.Count)
|
||||||
|
{
|
||||||
|
graph.HorizontalScrolling = mData.Count - graph.DataSource.HorizontalViewSize;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
graph.HorizontalScrolling = index - halfView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
bool VerifySorted(List<DoubleVector2> data)
|
bool VerifySorted(List<DoubleVector2> data)
|
||||||
{
|
{
|
||||||
if (data == null)
|
if (data == null)
|
||||||
@@ -162,8 +178,6 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
if (graph != null)
|
if (graph != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
Debug.Log("Loading page :" + pagePosition);
|
|
||||||
graph.DataSource.StartBatch(); // call start batch
|
graph.DataSource.StartBatch(); // call start batch
|
||||||
graph.DataSource.HorizontalViewOrigin = 0;
|
graph.DataSource.HorizontalViewOrigin = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -59,8 +59,10 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
}
|
}
|
||||||
GameObject miniMap;
|
GameObject miniMap;
|
||||||
GameObject resultPanel;
|
GameObject resultPanel;
|
||||||
void Awake()
|
|
||||||
|
protected override void Awake()
|
||||||
{
|
{
|
||||||
|
base.Awake();
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (App.CurrentUser == null)
|
if (App.CurrentUser == null)
|
||||||
{
|
{
|
||||||
@@ -189,6 +191,8 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
mapRouteRankingList = shaowList.data.list;
|
mapRouteRankingList = shaowList.data.list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Vector3 mapPos = Vector3.zero;
|
||||||
//加载人物和地图以及UI界面
|
//加载人物和地图以及UI界面
|
||||||
private void InitGameObject()
|
private void InitGameObject()
|
||||||
{
|
{
|
||||||
@@ -197,6 +201,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
UIObject.SetActive(true);
|
UIObject.SetActive(true);
|
||||||
miniMap.SetActive(true);
|
miniMap.SetActive(true);
|
||||||
map.OnTileFinished += Map_OnTileFinished;
|
map.OnTileFinished += Map_OnTileFinished;
|
||||||
|
mapPos = map.transform.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
//private void Map_OnTileFinished(Mapbox.Unity.MeshGeneration.Data.UnityTile obj)
|
//private void Map_OnTileFinished(Mapbox.Unity.MeshGeneration.Data.UnityTile obj)
|
||||||
@@ -243,6 +248,9 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
Quaternion neededRotation = Quaternion.LookRotation(s - e);
|
Quaternion neededRotation = Quaternion.LookRotation(s - e);
|
||||||
player.transform.rotation = Quaternion.Euler(0, neededRotation.eulerAngles.y, 0);
|
player.transform.rotation = Quaternion.Euler(0, neededRotation.eulerAngles.y, 0);
|
||||||
playerController.currentRotation = neededRotation;
|
playerController.currentRotation = neededRotation;
|
||||||
|
//初始化海拔图头像位置
|
||||||
|
var index = GetCurrentIndex(recorderData.EndDistance);
|
||||||
|
playerController.InitGraph(index);
|
||||||
}
|
}
|
||||||
SingleUIManager singleUIManager;
|
SingleUIManager singleUIManager;
|
||||||
public void AutoStart()
|
public void AutoStart()
|
||||||
@@ -284,6 +292,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
var currentUser = currentOnlineUserList.Where(c => c.UserId == item.UserId).FirstOrDefault();
|
var currentUser = currentOnlineUserList.Where(c => c.UserId == item.UserId).FirstOrDefault();
|
||||||
var onlineDistance = onlineRider.EndDistance - onlineRider.PreDistance;
|
var onlineDistance = onlineRider.EndDistance - onlineRider.PreDistance;
|
||||||
var onlineTotalDistance = onlineRider.EndDistance;
|
var onlineTotalDistance = onlineRider.EndDistance;
|
||||||
|
var index = GetCurrentIndex(onlineTotalDistance);
|
||||||
|
|
||||||
if (currentUser == null)
|
if (currentUser == null)
|
||||||
{
|
{
|
||||||
@@ -294,7 +303,8 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
otherList.Add(onlinePlayerController);
|
otherList.Add(onlinePlayerController);
|
||||||
|
|
||||||
onlinePlayerController.UserId = onlineRider.UserId;
|
onlinePlayerController.UserId = onlineRider.UserId;
|
||||||
onlinePlayerController.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg);
|
|
||||||
|
onlinePlayerController.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg, index);
|
||||||
onlinePlayerController.SetHead(onlineRider.WxHeadImg);
|
onlinePlayerController.SetHead(onlineRider.WxHeadImg);
|
||||||
//小地图人物
|
//小地图人物
|
||||||
GameObject miniPlayer = (GameObject)Instantiate(miniMapPlayerPrefab, transform);
|
GameObject miniPlayer = (GameObject)Instantiate(miniMapPlayerPrefab, transform);
|
||||||
@@ -304,11 +314,10 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
if(messageIndex > 0)
|
if(messageIndex > 0)
|
||||||
EventQueueSystem.QueueEvent(new JoinMessageEvent(onlineRider.NickName, onlineRider.WxHeadImg));
|
EventQueueSystem.QueueEvent(new JoinMessageEvent(onlineRider.NickName, onlineRider.WxHeadImg));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentUser.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg);
|
currentUser.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(onlineRiders.Count > 0)
|
if(onlineRiders.Count > 0)
|
||||||
@@ -355,6 +364,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
map.Terrain.SetElevationType(ElevationLayerType.TerrainWithElevation);
|
map.Terrain.SetElevationType(ElevationLayerType.TerrainWithElevation);
|
||||||
map.ImageLayer.SetLayerSource(ImagerySourceType.Custom);
|
map.ImageLayer.SetLayerSource(ImagerySourceType.Custom);
|
||||||
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
||||||
|
map.transform.position = mapPos;
|
||||||
//map3d.gameObject.SetActive(true);
|
//map3d.gameObject.SetActive(true);
|
||||||
//map.gameObject.SetActive(false);
|
//map.gameObject.SetActive(false);
|
||||||
//人物属性变更
|
//人物属性变更
|
||||||
@@ -374,6 +384,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
map.Terrain.ExaggerationFactor = 0f;
|
map.Terrain.ExaggerationFactor = 0f;
|
||||||
map.Terrain.SetElevationType(ElevationLayerType.FlatTerrain);
|
map.Terrain.SetElevationType(ElevationLayerType.FlatTerrain);
|
||||||
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
||||||
|
map.transform.position = Vector3.zero;
|
||||||
//map.gameObject.SetActive(true);
|
//map.gameObject.SetActive(true);
|
||||||
//map3d.gameObject.SetActive(false);
|
//map3d.gameObject.SetActive(false);
|
||||||
//人物属性变更
|
//人物属性变更
|
||||||
@@ -381,9 +392,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
player.transform.position = pos;
|
player.transform.position = pos;
|
||||||
player.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
|
player.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
|
||||||
target.position = pos;
|
target.position = pos;
|
||||||
playerController.currentPos = Vector3.zero;
|
//playerController.currentPos = Vector3.zero;
|
||||||
|
|
||||||
|
|
||||||
arrowGameObj.SetActive(true);
|
arrowGameObj.SetActive(true);
|
||||||
Is3dView = false;
|
Is3dView = false;
|
||||||
}
|
}
|
||||||
@@ -397,6 +406,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
player.transform.localScale = new Vector3(3f, 3f, 3f);
|
player.transform.localScale = new Vector3(3f, 3f, 3f);
|
||||||
var locations = playerController.Currentlatlong == null ? playerController.Currentlatlong : new Vector2d(mapData.List[0].Point[0], mapData.List[0].Point[1]);
|
var locations = playerController.Currentlatlong == null ? playerController.Currentlatlong : new Vector2d(mapData.List[0].Point[0], mapData.List[0].Point[1]);
|
||||||
player.transform.position = map.GeoToWorldPosition(locations);
|
player.transform.position = map.GeoToWorldPosition(locations);
|
||||||
|
mapPos = map.transform.position;
|
||||||
if (recorderData != null)
|
if (recorderData != null)
|
||||||
{
|
{
|
||||||
var lastLatLon = Along(recorderData.EndDistance);
|
var lastLatLon = Along(recorderData.EndDistance);
|
||||||
@@ -494,6 +504,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
cyclingController.recorderData.EndDistance = totalDistance;
|
cyclingController.recorderData.EndDistance = totalDistance;
|
||||||
cyclingController.recorderData.AntModelId = AntModelId;
|
cyclingController.recorderData.AntModelId = AntModelId;
|
||||||
cyclingController.recorderData.ManufacturerId = ManufacturerId;
|
cyclingController.recorderData.ManufacturerId = ManufacturerId;
|
||||||
|
cyclingController.recorderData.ManufacturerName = ManufacturerName;
|
||||||
cyclingController.recorderData.DeviceNumber = DeviceNumber;
|
cyclingController.recorderData.DeviceNumber = DeviceNumber;
|
||||||
//显示骑行结果
|
//显示骑行结果
|
||||||
resultPanel.SetActive(true);
|
resultPanel.SetActive(true);
|
||||||
@@ -539,6 +550,25 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
{
|
{
|
||||||
return coordiantes;
|
return coordiantes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetCurrentIndex(double endDistance)
|
||||||
|
{
|
||||||
|
int index = 0;
|
||||||
|
var pointList = mapData.List;
|
||||||
|
double sumDistance = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < pointList.Count; i++)
|
||||||
|
{
|
||||||
|
sumDistance += pointList[i].Distance;
|
||||||
|
if (endDistance * 1000 <= sumDistance)
|
||||||
|
{
|
||||||
|
index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index = endDistance >= mapData.TotalDistance ? index + 1 : index;
|
||||||
|
return index;
|
||||||
|
}
|
||||||
public Vector2d Along(double endDistance)
|
public Vector2d Along(double endDistance)
|
||||||
{
|
{
|
||||||
if (mapData != null)
|
if (mapData != null)
|
||||||
@@ -577,7 +607,5 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
var list = mapData.List.Select(c => (float)c.Elevation).ToArray();
|
var list = mapData.List.Select(c => (float)c.Elevation).ToArray();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
using Assets.Scripts.Devices.Ant;
|
using Assets.Scripts.Ble;
|
||||||
|
using Assets.Scripts.Devices;
|
||||||
|
using Assets.Scripts.Devices.Ant;
|
||||||
using Assets.Scripts.Devices.Ant.Interfaces;
|
using Assets.Scripts.Devices.Ant.Interfaces;
|
||||||
|
using Assets.Scripts.Devices.Ble;
|
||||||
|
using Assets.Scripts.Scenes;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -7,11 +11,11 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace Assets.Scenes.Ride.Scripts
|
namespace Assets.Scenes.Ride.Scripts
|
||||||
{
|
{
|
||||||
public class DeviceServiceMonoBase: MonoBehaviour
|
public class DeviceServiceMonoBase: BaseScene
|
||||||
{
|
{
|
||||||
public void TrackResistance(double grade)
|
public void TrackResistance(double grade)
|
||||||
{
|
{
|
||||||
var device = (CurrentTrainer as FitDevice);
|
var device = (CurrentTrainer as ITrainerDevice);
|
||||||
if (device != null)
|
if (device != null)
|
||||||
{
|
{
|
||||||
device.SetTrackResistance(grade);
|
device.SetTrackResistance(grade);
|
||||||
@@ -19,10 +23,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
#region 获取设备数据
|
#region 获取设备数据
|
||||||
|
|
||||||
public AbstractAntDevice CurrentTrainer
|
public AbstractDevice CurrentTrainer
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
var devices = AntConnector.Instance().discoveredDevices.Where(d => d.State == DeviceState.Connected && (d.Sensor == SensorType.Trainer));
|
var devices = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && (d.Sensor == SensorType.Trainer));
|
||||||
_device = null;//重置设备状态
|
_device = null;//重置设备状态
|
||||||
if (devices.Count() > 0)
|
if (devices.Count() > 0)
|
||||||
{
|
{
|
||||||
@@ -32,9 +36,19 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
|
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
|
||||||
}
|
}
|
||||||
ManufacturerId = _device.ManufacturerId;
|
if (_device.Network == NetworkType.ANT)
|
||||||
DeviceNumber = $"{ _device.DeviceNumber },{ _device.DeviceType }";
|
{
|
||||||
AntModelId = _device.AntModelId;
|
var antDevice = _device as AbstractAntDevice;
|
||||||
|
ManufacturerId = antDevice.ManufacturerId;
|
||||||
|
AntModelId = antDevice.AntModelId;
|
||||||
|
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var bleDevice = _device as BleDevice;
|
||||||
|
DeviceNumber = $"{ Helper.FormateMacAddress(bleDevice.Address) },{ ServiceUuids.GetBySensor(bleDevice.Sensor) }";
|
||||||
|
ManufacturerName = bleDevice.Name + "," + bleDevice.Network + "," + bleDevice.Sensor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _device;
|
return _device;
|
||||||
@@ -69,7 +83,8 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double UpdatePower()
|
public double UpdatePower()
|
||||||
{
|
{
|
||||||
return PowerDevice == null ? 0 : PowerDevice.Power;
|
var t = PowerDevice == null ? 0 : PowerDevice.Power;
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新踏频
|
/// 更新踏频
|
||||||
@@ -94,10 +109,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
|
|
||||||
#region field
|
#region field
|
||||||
|
|
||||||
protected AbstractAntDevice _device;
|
protected AbstractDevice _device;
|
||||||
protected AntConnector _antConnector;
|
protected AntConnector _antConnector;
|
||||||
|
|
||||||
public int ManufacturerId { get; private set; }
|
public int? ManufacturerId { get; private set; }
|
||||||
|
public string ManufacturerName { get; private set; }
|
||||||
public string DeviceNumber { get; private set; }
|
public string DeviceNumber { get; private set; }
|
||||||
public int? AntModelId { get; private set; }
|
public int? AntModelId { get; private set; }
|
||||||
|
|
||||||
@@ -111,8 +127,8 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
#endregion
|
#endregion
|
||||||
public bool CheckAnt()
|
public bool CheckAnt()
|
||||||
{
|
{
|
||||||
_antConnector = AntConnector.Instance();
|
//_antConnector = AntConnector.Instance();
|
||||||
var devices = _antConnector.discoveredDevices.Where(d => d.State == DeviceState.Connected && (d.Sensor == SensorType.Trainer || d.Sensor == SensorType.Power));
|
var devices = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && (d.Sensor == SensorType.Trainer || d.Sensor == SensorType.Power));
|
||||||
if (devices.Count() > 0)
|
if (devices.Count() > 0)
|
||||||
{
|
{
|
||||||
_device = devices.OrderByDescending(d => d.Sensor == SensorType.Trainer).First();
|
_device = devices.OrderByDescending(d => d.Sensor == SensorType.Trainer).First();
|
||||||
@@ -120,9 +136,20 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
|
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
|
||||||
}
|
}
|
||||||
ManufacturerId = _device.ManufacturerId;
|
if (_device.Network == NetworkType.ANT)
|
||||||
DeviceNumber = $"{ _device.DeviceNumber },{ _device.DeviceType }";
|
{
|
||||||
AntModelId = _device.AntModelId;
|
var antDevice = _device as AbstractAntDevice;
|
||||||
|
ManufacturerId = antDevice.ManufacturerId;
|
||||||
|
AntModelId = antDevice.AntModelId;
|
||||||
|
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var bleDevice =_device as BleDevice;
|
||||||
|
DeviceNumber = $"{ bleDevice.Address },{ bleDevice.Sensor }";
|
||||||
|
ManufacturerName = bleDevice.Name + " " + bleDevice.Network + " " + bleDevice.Sensor;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -146,11 +173,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
//速度和踏频一体的传感器,里面的速度是不可以读的,只允许读 踏频,切记
|
//速度和踏频一体的传感器,里面的速度是不可以读的,只允许读 踏频,切记
|
||||||
if (_antConnector == null)
|
//if (_antConnector == null)
|
||||||
{
|
//{
|
||||||
return null;
|
// return null;
|
||||||
}
|
//}
|
||||||
var device = _antConnector.discoveredDevices.Where(d => d.State == DeviceState.Connected && d is ISpeedDevice).FirstOrDefault();
|
var device = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && d is ISpeedDevice).FirstOrDefault();
|
||||||
if (device != null)
|
if (device != null)
|
||||||
{
|
{
|
||||||
return (ISpeedDevice)device;
|
return (ISpeedDevice)device;
|
||||||
@@ -165,11 +192,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_antConnector == null)
|
//if (_antConnector == null)
|
||||||
{
|
//{
|
||||||
return null;
|
// return null;
|
||||||
}
|
//}
|
||||||
var device = _antConnector.discoveredDevices.Where(d => d.State == DeviceState.Connected && d is IHeartRateDevice).FirstOrDefault();
|
var device = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && d is IHeartRateDevice).FirstOrDefault();
|
||||||
if (device != null)
|
if (device != null)
|
||||||
{
|
{
|
||||||
return (IHeartRateDevice)device;
|
return (IHeartRateDevice)device;
|
||||||
@@ -184,11 +211,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_antConnector == null)
|
//if (_antConnector == null)
|
||||||
{
|
//{
|
||||||
return null;
|
// return null;
|
||||||
}
|
//}
|
||||||
var powerDevices = _antConnector.discoveredDevices.Where(d => d.State == DeviceState.Connected && d is IPowerDevice).ToList();
|
var powerDevices = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && d is IPowerDevice).ToList();
|
||||||
var power = powerDevices.FirstOrDefault(d => d.Sensor == SensorType.Power);
|
var power = powerDevices.FirstOrDefault(d => d.Sensor == SensorType.Power);
|
||||||
if (power != null)
|
if (power != null)
|
||||||
{
|
{
|
||||||
@@ -210,11 +237,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_antConnector == null)
|
//if (_antConnector == null)
|
||||||
{
|
//{
|
||||||
return null;
|
// return null;
|
||||||
}
|
//}
|
||||||
var cadences = _antConnector.discoveredDevices.Where(d => d.State == DeviceState.Connected && d is ICadenceDevice).ToList();
|
var cadences = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && d is ICadenceDevice).ToList();
|
||||||
var cadence = cadences.FirstOrDefault(d => d.Sensor == SensorType.Cadence);
|
var cadence = cadences.FirstOrDefault(d => d.Sensor == SensorType.Cadence);
|
||||||
if (cadence != null)
|
if (cadence != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -108,6 +108,36 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
S = s.ToString();
|
S = s.ToString();
|
||||||
return $"{H}:{M}:{S}";
|
return $"{H}:{M}:{S}";
|
||||||
}
|
}
|
||||||
|
public static string FormateMacAddress(string v)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//var s = Convert.ToInt64(v).ToString("x8").ToUpperInvariant();
|
||||||
|
var array = v.ToCharArray();
|
||||||
|
StringBuilder newLsit = new StringBuilder();
|
||||||
|
List<string> li = new List<string>();
|
||||||
|
for (int i = 0; i < array.Length; i++)
|
||||||
|
{
|
||||||
|
if ((i+1) % 2 == 0 && i > 0)
|
||||||
|
{
|
||||||
|
li.Add(array[i-1].ToString()+ array[i].ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = li.Count() -1 ; i >= 0 ; i--)
|
||||||
|
{
|
||||||
|
newLsit.Append(li[i]);
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
newLsit.Append(":");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newLsit.ToString();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算速度
|
/// 计算速度
|
||||||
/// 参考 http://bikecalculator.com/index.html
|
/// 参考 http://bikecalculator.com/index.html
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using GeoJSON.Net.Geometry;
|
using GeoJSON.Net.Geometry;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -394,16 +395,16 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
|||||||
{
|
{
|
||||||
return new ReceiveMsgModel
|
return new ReceiveMsgModel
|
||||||
{
|
{
|
||||||
RouteId = Convert.ToInt32(list[0]),
|
RouteId = Convert.ToInt32(list[0],CultureInfo.InvariantCulture),
|
||||||
MemberId = Convert.ToInt32(list[1]),
|
MemberId = Convert.ToInt32(list[1], CultureInfo.InvariantCulture),
|
||||||
Point = new double[] { double.Parse(list[2].Split(':')[0]), double.Parse(list[2].Split(':')[1]) },
|
Point = new double[] { double.Parse(list[2].Split(':')[0], CultureInfo.InvariantCulture), double.Parse(list[2].Split(':')[1], CultureInfo.InvariantCulture) },
|
||||||
IsCompleted = ToBoolean(list[3]),
|
IsCompleted = ToBoolean(list[3]),
|
||||||
//exit = ToBoolean(list[4]),
|
//exit = ToBoolean(list[4]),
|
||||||
Speed = Convert.ToDouble(list[4]),
|
Speed = Convert.ToDouble(list[4], CultureInfo.InvariantCulture),
|
||||||
PreDistance = Convert.ToDouble(list[5]),
|
PreDistance = Convert.ToDouble(list[5], CultureInfo.InvariantCulture),
|
||||||
EndDistance = Convert.ToDouble(list[6]),
|
EndDistance = Convert.ToDouble(list[6], CultureInfo.InvariantCulture),
|
||||||
WeightKg = Convert.ToDouble(list[7]),
|
WeightKg = Convert.ToDouble(list[7], CultureInfo.InvariantCulture),
|
||||||
Competitionid = Convert.ToInt32(list[8]),
|
Competitionid = Convert.ToInt32(list[8], CultureInfo.InvariantCulture),
|
||||||
Saved = ToBoolean(list[9])
|
Saved = ToBoolean(list[9])
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 厂商Id
|
/// 厂商Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ManufacturerId { get; set; }
|
public int? ManufacturerId { get; set; }
|
||||||
|
|
||||||
|
public string ManufacturerName { get; set; }
|
||||||
|
|
||||||
public int? AntModelId { get; set; }
|
public int? AntModelId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -154,7 +156,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
|||||||
ContinueIndex = ContinueIndex,
|
ContinueIndex = ContinueIndex,
|
||||||
IsDelete = false,
|
IsDelete = false,
|
||||||
MapCompetitionId = Competitionid,
|
MapCompetitionId = Competitionid,
|
||||||
ManufacturerName = "",//manufacturer == null ? "" : manufacturer.Name,
|
ManufacturerName = ManufacturerName,//manufacturer == null ? "" : manufacturer.Name,
|
||||||
DeviceNumber = DeviceNumber,
|
DeviceNumber = DeviceNumber,
|
||||||
IsRanking = IsNeedRanking,
|
IsRanking = IsNeedRanking,
|
||||||
CurrentRouteStartDistance = CurrentRouteStartDistance,
|
CurrentRouteStartDistance = CurrentRouteStartDistance,
|
||||||
|
|||||||
@@ -53,19 +53,19 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
|||||||
{
|
{
|
||||||
string[] split = data.Split(',');
|
string[] split = data.Split(',');
|
||||||
var target = new TargetData();
|
var target = new TargetData();
|
||||||
target.Ticks = int.Parse(split[0]);
|
target.Ticks = Convert.ToInt32(split[0], CultureInfo.InvariantCulture); //int.Parse(split[0]);
|
||||||
target._Power = double.Parse(split[1]);
|
target._Power = Convert.ToDouble(split[1], CultureInfo.InvariantCulture);
|
||||||
target._Speed = double.Parse(split[2]);
|
target._Speed = Convert.ToDouble(split[2], CultureInfo.InvariantCulture);// double.Parse(split[2]);
|
||||||
target._Distance = double.Parse(split[3]);
|
target._Distance = Convert.ToDouble(split[3], CultureInfo.InvariantCulture); //double.Parse(split[3]);
|
||||||
target._Cadence = double.Parse(split[4]);
|
target._Cadence = Convert.ToDouble(split[4], CultureInfo.InvariantCulture); //double.Parse(split[4]);
|
||||||
if (!string.IsNullOrWhiteSpace(split[5]) && split[5] != "null")
|
if (!string.IsNullOrWhiteSpace(split[5]) && split[5] != "null")
|
||||||
{
|
{
|
||||||
target._HeartRate = int.Parse(split[5]);
|
target._HeartRate = Convert.ToInt32(split[5], CultureInfo.InvariantCulture); //int.Parse(split[5]);
|
||||||
}
|
}
|
||||||
if (split.Length > 6)
|
if (split.Length > 6)
|
||||||
{
|
{
|
||||||
target._Lat = double.Parse(split[6]);
|
target._Lat = Convert.ToDouble(split[6], CultureInfo.InvariantCulture); //double.Parse(split[6]);
|
||||||
target._Lon = double.Parse(split[7]);
|
target._Lon = Convert.ToDouble(split[7], CultureInfo.InvariantCulture); //double.Parse(split[7]);
|
||||||
//target._Bearing = double.Parse(split[8]);
|
//target._Bearing = double.Parse(split[8]);
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
|
|||||||
@@ -14,15 +14,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
public PlayerController _playerController;
|
public PlayerController _playerController;
|
||||||
RawImage head;
|
RawImage head;
|
||||||
GameObject headPanel;
|
|
||||||
|
|
||||||
Image arrowImage;
|
Image arrowImage;
|
||||||
GameObject infoPanel;
|
GameObject infoPanel;
|
||||||
Transform uiObject;
|
Transform uiObject;
|
||||||
|
|
||||||
GraphChartBase graph;
|
|
||||||
ChartDataSourceScript chartDataSourceScript;
|
|
||||||
|
|
||||||
string nickName;
|
string nickName;
|
||||||
string weightKgStr;
|
string weightKgStr;
|
||||||
|
|
||||||
@@ -31,15 +26,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
base.Init();
|
base.Init();
|
||||||
currentlatlong = mainController.GetCenterCoordinate();
|
currentlatlong = mainController.GetCenterCoordinate();
|
||||||
_playerController = FindObjectOfType<PlayerController>();
|
_playerController = FindObjectOfType<PlayerController>();
|
||||||
graph = transform.parent.Find("SingleUI/Panel/GraphChart").GetComponent<GraphChartBase>();
|
|
||||||
chartDataSourceScript = transform.parent.Find("SingleUI/Panel/GraphChart").GetComponent<ChartDataSourceScript>();
|
|
||||||
|
|
||||||
//创建UI
|
//创建UI
|
||||||
uiObject = transform.parent.Find("SingleUI/Panel/ArrowList");
|
uiObject = transform.parent.Find("SingleUI/Panel/ArrowList");
|
||||||
arrowImage = Instantiate(Resources.Load<Image>("UI/Prefab/Ride/ReviewArrow"), uiObject);
|
arrowImage = Instantiate(Resources.Load<Image>("UI/Prefab/Ride/ReviewArrow"), uiObject);
|
||||||
arrowImage.color = new Color(0.1529412f, 0.8745098f, 0.8901961f);
|
arrowImage.color = new Color(0.1529412f, 0.8745098f, 0.8901961f);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public override bool GetStart()
|
public override bool GetStart()
|
||||||
{
|
{
|
||||||
@@ -50,80 +40,23 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
currentlatlong = mainController.Along(totalDistance);//下一个坐标
|
currentlatlong = mainController.Along(totalDistance);//下一个坐标
|
||||||
|
|
||||||
diff = Math.Round((totalDistance - _playerController.TotalDistance) * 1000, 0);
|
diff = Math.Round((totalDistance - _playerController.TotalDistance) * 1000, 0);
|
||||||
|
|
||||||
MoveHead(graph.transform);
|
|
||||||
}
|
}
|
||||||
double diff = 0;
|
double diff = 0;
|
||||||
public void SetDataSource(double _totalDistance, double _distance,string Name,double weightKg)
|
public void SetDataSource(double _totalDistance, double _distance,string Name,double weightKg,int index=0)
|
||||||
{
|
{
|
||||||
totalDistance = _totalDistance;
|
totalDistance = _totalDistance;
|
||||||
distance = _distance;
|
distance = _distance;
|
||||||
speed = distance*3600;
|
speed = distance*3600;
|
||||||
nickName = Name;
|
nickName = Name;
|
||||||
weightKgStr = weightKg.ToString("f2") + "W/KG";
|
weightKgStr = weightKg.ToString("f2") + "W/KG";
|
||||||
|
CurrentIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetCurrentIndex(double endistance,MapDataModel mapDataModel)
|
|
||||||
{
|
|
||||||
var pointList = mapDataModel.List;
|
|
||||||
int onIndex = 0;
|
|
||||||
var sumDistance = 0D;
|
|
||||||
for (int i = 0; i < pointList.Count; i++)
|
|
||||||
{
|
|
||||||
sumDistance += pointList[i].Distance;
|
|
||||||
if (endistance * 1000 <= sumDistance)
|
|
||||||
{
|
|
||||||
onIndex = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (endistance > mapDataModel.TotalDistance)
|
|
||||||
{
|
|
||||||
onIndex = pointList.Count-2;
|
|
||||||
}
|
|
||||||
return onIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string headUrl;
|
private string headUrl;
|
||||||
public void SetHead(string url )
|
public void SetHead(string url )
|
||||||
{
|
{
|
||||||
headUrl = url;
|
headUrl = url;
|
||||||
}
|
}
|
||||||
public void MoveHead(Transform parent)
|
|
||||||
{
|
|
||||||
var itemIndex = chartDataSourceScript.GetViewIndex(GetCurrentIndex(TotalDistance, mainController.GetMapData()))+1;
|
|
||||||
var m = graph.DataSource.GetPoint("Player 2", itemIndex);
|
|
||||||
Debug.Log(itemIndex.ToString() + "=" + TotalDistance.ToString());
|
|
||||||
graph.PointToWorldSpace(out Vector3 itemPosition, m.x, m.y, "Player 2");
|
|
||||||
itemPosition.x -= 12f;
|
|
||||||
itemPosition.y += 5f;
|
|
||||||
|
|
||||||
if (headPanel == null)
|
|
||||||
{
|
|
||||||
headPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineHeadPanel"));
|
|
||||||
headPanel.transform.SetParent(parent);
|
|
||||||
headPanel.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
|
|
||||||
headPanel.transform.position = itemPosition;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
headPanel.transform.DOMove(new Vector3(itemPosition.x, itemPosition.y, 0), 1);
|
|
||||||
}
|
|
||||||
if (head == null)
|
|
||||||
{
|
|
||||||
head = headPanel.GetComponentInChildren<RawImage>();
|
|
||||||
if (!string.IsNullOrEmpty(headUrl))
|
|
||||||
{
|
|
||||||
Utils.DisplayImage(head, headUrl, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
headPanel.transform.Find("DefaultHead").gameObject.SetActive(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ShowInfoPanel(Vector3 playerScreenPos)
|
public void ShowInfoPanel(Vector3 playerScreenPos)
|
||||||
{
|
{
|
||||||
@@ -157,13 +90,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
|
|
||||||
public void RemoveSelf()
|
public void RemoveSelf()
|
||||||
{
|
{
|
||||||
//headPanel?.SetActive(false);
|
|
||||||
arrowImage.gameObject?.Destroy();
|
arrowImage.gameObject?.Destroy();
|
||||||
headPanel?.Destroy();
|
headPanel?.Destroy();
|
||||||
infoPanel?.Destroy();
|
infoPanel?.Destroy();
|
||||||
transform.gameObject.Destroy();
|
transform.gameObject.Destroy();
|
||||||
//infoPanel?.SetActive(false);
|
|
||||||
//transform.DestroyChildren();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AfterExcute()
|
protected override void AfterExcute()
|
||||||
@@ -215,5 +145,40 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
lineRender.numCapVertices = 10;
|
lineRender.numCapVertices = 10;
|
||||||
lineRender.numCornerVertices = 10;
|
lineRender.numCornerVertices = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void MoveGraphHead()
|
||||||
|
{
|
||||||
|
var itemIndex = chartDataSourceScript.GetViewIndex(CurrentIndex);
|
||||||
|
var m = graph.DataSource.GetPoint("Player 2", itemIndex);
|
||||||
|
|
||||||
|
graph.PointToWorldSpace(out Vector3 itemPosition, m.x, m.y, "Player 2");
|
||||||
|
itemPosition.x -= 12f;
|
||||||
|
itemPosition.y += 5f;
|
||||||
|
|
||||||
|
if (headPanel == null)
|
||||||
|
{
|
||||||
|
headPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineHeadPanel"));
|
||||||
|
headPanel.transform.SetParent(graph.transform);
|
||||||
|
headPanel.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
|
||||||
|
headPanel.transform.position = itemPosition;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
headPanel.transform.DOMove(new Vector3(itemPosition.x, itemPosition.y, 0), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (head == null)
|
||||||
|
{
|
||||||
|
head = headPanel.GetComponentInChildren<RawImage>();
|
||||||
|
if (!string.IsNullOrEmpty(headUrl))
|
||||||
|
{
|
||||||
|
Utils.DisplayImage(head, headUrl, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
headPanel.transform.Find("DefaultHead").gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,24 +8,24 @@ using UnityEngine.UI;
|
|||||||
namespace Assets.Scenes.Ride.Scripts
|
namespace Assets.Scenes.Ride.Scripts
|
||||||
{
|
{
|
||||||
public class OtherPlayerController : AbstractPlayer
|
public class OtherPlayerController : AbstractPlayer
|
||||||
{
|
{
|
||||||
public string[] record { set; get; }
|
public string[] record { set; get; }
|
||||||
public ReviewItemScript _reviewItemScript;
|
public ReviewItemScript _reviewItemScript;
|
||||||
public PlayerController _playerController;
|
public PlayerController _playerController;
|
||||||
RawImage head;
|
|
||||||
GameObject headPanel;
|
|
||||||
GameObject infoPanel;
|
|
||||||
|
|
||||||
public int tickOffset = 0;
|
public int tickOffset = 0;
|
||||||
Image arrowImage;
|
|
||||||
GameObject reviewInfoPanel;
|
|
||||||
Transform uiObject;
|
|
||||||
|
|
||||||
string nickName;
|
string nickName;
|
||||||
string weightKgStr;
|
string weightKgStr;
|
||||||
|
|
||||||
public double Weight { get; set; }
|
public double Weight { get; set; }
|
||||||
public double BikeWeight { get; set; }
|
public double BikeWeight { get; set; }
|
||||||
|
|
||||||
|
//UI
|
||||||
|
RawImage head;
|
||||||
|
GameObject infoPanel;
|
||||||
|
Image arrowImage;
|
||||||
|
Transform uiObject;
|
||||||
|
|
||||||
protected override void Init()
|
protected override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -37,7 +37,6 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
|
|
||||||
double diff = 0;
|
double diff = 0;
|
||||||
|
|
||||||
protected override void Compute()
|
protected override void Compute()
|
||||||
{
|
{
|
||||||
if (tickOffset + ticks < record.Length)
|
if (tickOffset + ticks < record.Length)
|
||||||
@@ -45,7 +44,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
var data = TargetData.Read(record[tickOffset + ticks - 1]);
|
var data = TargetData.Read(record[tickOffset + ticks - 1]);
|
||||||
power = data._Power;
|
power = data._Power;
|
||||||
speed = data._Speed;
|
speed = data._Speed;
|
||||||
distance = data._Speed/3600;
|
distance = data._Speed / 3600;
|
||||||
totalDistance = data._Distance;
|
totalDistance = data._Distance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -57,30 +56,15 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
totalDistance = data._Distance;
|
totalDistance = data._Distance;
|
||||||
}
|
}
|
||||||
currentlatlong = mainController.Along(totalDistance);//下一个坐标
|
currentlatlong = mainController.Along(totalDistance);//下一个坐标
|
||||||
diff = Math.Round((totalDistance - _playerController.TotalDistance) *1000, 0);
|
diff = Math.Round((totalDistance - _playerController.TotalDistance) * 1000, 0);
|
||||||
_reviewItemScript.SetDistance(diff);
|
_reviewItemScript.SetDistance(diff);
|
||||||
|
|
||||||
}
|
}
|
||||||
public void SetController(ReviewItemScript reviewItemScript)
|
public void SetController(ReviewItemScript reviewItemScript)
|
||||||
{
|
{
|
||||||
_reviewItemScript = reviewItemScript;
|
_reviewItemScript = reviewItemScript;
|
||||||
nickName = _reviewItemScript.GetName();
|
nickName = _reviewItemScript.GetName();
|
||||||
}
|
}
|
||||||
public void MoveHead(Transform parent,Vector3 nextPosition)
|
|
||||||
{
|
|
||||||
if (headPanel == null)
|
|
||||||
{
|
|
||||||
headPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/HeadPanel"));
|
|
||||||
headPanel.transform.parent = parent;
|
|
||||||
headPanel.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
|
|
||||||
}
|
|
||||||
if (head == null)
|
|
||||||
{
|
|
||||||
head = headPanel.GetComponentInChildren<RawImage>();
|
|
||||||
head.texture = _reviewItemScript.GetHead();
|
|
||||||
}
|
|
||||||
headPanel.transform.DOMove(new Vector3(nextPosition.x, nextPosition.y, 0), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ShowInfoPanel(Vector3 playerScreenPos)
|
public void ShowInfoPanel(Vector3 playerScreenPos)
|
||||||
{
|
{
|
||||||
@@ -103,11 +87,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
var infoDistance = infoPanel.transform.Find("Distance").GetComponent<Text>();
|
var infoDistance = infoPanel.transform.Find("Distance").GetComponent<Text>();
|
||||||
if (_playerController != null)
|
if (_playerController != null)
|
||||||
{
|
{
|
||||||
infoDistance.text = diff >0? $"+{diff}M" : $"{diff}M";
|
infoDistance.text = diff > 0 ? $"+{diff}M" : $"{diff}M";
|
||||||
}
|
}
|
||||||
var infoWKG = infoPanel.transform.Find("WKG").GetComponent<Text>();
|
var infoWKG = infoPanel.transform.Find("WKG").GetComponent<Text>();
|
||||||
if (Weight + BikeWeight != 0) {
|
if (Weight + BikeWeight != 0) {
|
||||||
weightKgStr = (power / (Weight + BikeWeight)).ToString("f2")+"W/KG";
|
weightKgStr = (power / (Weight + BikeWeight)).ToString("f2") + "W/KG";
|
||||||
infoWKG.text = weightKgStr;
|
infoWKG.text = weightKgStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +146,29 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
IsShowInfo = false;
|
IsShowInfo = false;
|
||||||
infoPanel?.Destroy();
|
infoPanel?.Destroy();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void MoveGraphHead()
|
||||||
|
{
|
||||||
|
var itemIndex = chartDataSourceScript.GetViewIndex(CurrentIndex);
|
||||||
|
var m = graph.DataSource.GetPoint("Player 2", itemIndex);
|
||||||
|
graph.PointToWorldSpace(out Vector3 itemPosition, m.x, m.y, "Player 2");
|
||||||
|
itemPosition.x -= 12f;
|
||||||
|
itemPosition.y += 5f;
|
||||||
|
|
||||||
|
if (headPanel == null)
|
||||||
|
{
|
||||||
|
headPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/HeadPanel"));
|
||||||
|
headPanel.transform.SetParent(graph.transform);
|
||||||
|
headPanel.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
|
||||||
|
}
|
||||||
|
if (head == null)
|
||||||
|
{
|
||||||
|
head = headPanel.GetComponentInChildren<RawImage>();
|
||||||
|
head.texture = _reviewItemScript.GetHead();
|
||||||
|
}
|
||||||
|
headPanel.transform.DOMove(new Vector3(itemPosition.x, itemPosition.y, 0), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,8 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
|
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
|
||||||
using System;
|
using System;
|
||||||
|
using ChartAndGraph;
|
||||||
|
using DG.Tweening;
|
||||||
|
|
||||||
namespace Assets.Scenes.Ride.Scripts
|
namespace Assets.Scenes.Ride.Scripts
|
||||||
{
|
{
|
||||||
@@ -34,6 +36,8 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
trail.motionVectorGenerationMode = MotionVectorGenerationMode.ForceNoMotion;
|
trail.motionVectorGenerationMode = MotionVectorGenerationMode.ForceNoMotion;
|
||||||
trail.receiveShadows = false;
|
trail.receiveShadows = false;
|
||||||
trail.rayTracingMode = UnityEngine.Experimental.Rendering.RayTracingMode.Off;
|
trail.rayTracingMode = UnityEngine.Experimental.Rendering.RayTracingMode.Off;
|
||||||
|
|
||||||
|
headPanel = transform.parent.Find("SingleUI/Panel/GraphChart/HeadPanel").gameObject;
|
||||||
}
|
}
|
||||||
TargetData targetData;
|
TargetData targetData;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -50,14 +54,15 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
cadance = mainController.UpdateCadence();
|
cadance = mainController.UpdateCadence();
|
||||||
weight = App.CurrentUser.Weight;
|
weight = App.CurrentUser.Weight;
|
||||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||||
#if UNITY_EDITOR
|
//#if UNITY_EDITOR
|
||||||
System.Random rd = new System.Random();
|
System.Random rd = new System.Random();
|
||||||
power = rd.Next(150, 300);//测试功率
|
//power = 1000; //rd.Next(150, 300);//测试功率
|
||||||
#endif
|
//#endif
|
||||||
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity / 100);
|
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity / 100);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Debug.Log(ex.Message);
|
||||||
heartRate = 0;
|
heartRate = 0;
|
||||||
power = 0;
|
power = 0;
|
||||||
cadance = 0;
|
cadance = 0;
|
||||||
@@ -127,5 +132,36 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
mainController.Save(TotalDistance);
|
mainController.Save(TotalDistance);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public void InitGraph(int index)
|
||||||
|
{
|
||||||
|
chartDataSourceScript.InitHorizontalScrolling(index);
|
||||||
|
}
|
||||||
|
//移动海拔图头像
|
||||||
|
protected override void MoveGraphHead()
|
||||||
|
{
|
||||||
|
Vector3 oldPos = headPanel.transform.position;
|
||||||
|
int nextIndex = CurrentIndex;
|
||||||
|
var viewIndex = chartDataSourceScript.GetViewIndex(nextIndex);
|
||||||
|
|
||||||
|
var n = graph.DataSource.GetPoint("Player 2", viewIndex);
|
||||||
|
graph.PointToWorldSpace(out Vector3 nextPosition, n.x, n.y, "Player 2");
|
||||||
|
nextPosition.x -= 14f;
|
||||||
|
nextPosition.y += 5f;
|
||||||
|
//人物移动 停止条件 到中间且线未加载完
|
||||||
|
if ( GetStart() && chartDataSourceScript.ReachMid(viewIndex) && !chartDataSourceScript.ReachEnd())
|
||||||
|
{
|
||||||
|
var currentDistance = CurrentDistance;
|
||||||
|
var distance = Distance;
|
||||||
|
var offset = currentDistance > 0 ? distance * 1000 / currentDistance : 1;
|
||||||
|
graph.HorizontalScrolling += offset;
|
||||||
|
headPanel.transform.DOMove(new Vector3(oldPos.x, nextPosition.y, 0), 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
headPanel.transform.DOMove(new Vector3(nextPosition.x, nextPosition.y, 0), 1);
|
||||||
|
}
|
||||||
|
headPanel.transform.SetSiblingIndex(999);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,14 +90,6 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
|
|
||||||
private void Cancel(BaseEventData baseEventData)
|
private void Cancel(BaseEventData baseEventData)
|
||||||
{
|
{
|
||||||
if (App.MainSceneParam.ContainsKey("Name"))
|
|
||||||
{
|
|
||||||
App.MainSceneParam["Name"] = "MapListPanel";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
App.MainSceneParam.Add("Name", "MapListPanel");
|
|
||||||
}
|
|
||||||
SceneManager.LoadScene("MainScene");
|
SceneManager.LoadScene("MainScene");
|
||||||
}
|
}
|
||||||
public void SetDataSource(RecorderDataModel record)
|
public void SetDataSource(RecorderDataModel record)
|
||||||
|
|||||||
@@ -45,11 +45,13 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
MapApi mapApi;
|
MapApi mapApi;
|
||||||
Sprite down;
|
Sprite down;
|
||||||
Sprite up;
|
Sprite up;
|
||||||
|
Transform parent;
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
mapApi = new MapApi();
|
mapApi = new MapApi();
|
||||||
cyclingController = FindObjectOfType<CyclingController>();
|
cyclingController = FindObjectOfType<CyclingController>();
|
||||||
//分页查询当前路数排行榜选手成绩列表
|
//分页查询当前路数排行榜选手成绩列表
|
||||||
|
parent = transform.Find("Panel/PlayerList/Scroll View/Viewport/Content");
|
||||||
prefab = Resources.Load<GameObject>("UI/Prefab/Ride/SelectPlayerItem");
|
prefab = Resources.Load<GameObject>("UI/Prefab/Ride/SelectPlayerItem");
|
||||||
down = Resources.Load<Sprite>("Images/DOWN");
|
down = Resources.Load<Sprite>("Images/DOWN");
|
||||||
up = Resources.Load<Sprite>("Images/UP");
|
up = Resources.Load<Sprite>("Images/UP");
|
||||||
@@ -111,6 +113,14 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
OnEndDrag(null);
|
OnEndDrag(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Input.GetKeyDown(KeyCode.Return))
|
||||||
|
{
|
||||||
|
Search(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool enabled = gameObjects.Where(c => c.GetComponent<SeletedPlayerScript>().isUsed).Count() > 0;
|
||||||
|
rideButton.enabled = enabled;
|
||||||
|
rideButton.interactable = enabled;
|
||||||
}
|
}
|
||||||
private void StartvalueChanged(string input)
|
private void StartvalueChanged(string input)
|
||||||
{
|
{
|
||||||
@@ -190,14 +200,38 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
reviewPanel.SetActive(false);
|
reviewPanel.SetActive(false);
|
||||||
selectPanel.SetActive(true);
|
selectPanel.SetActive(true);
|
||||||
nearPanel.SetActive(false);
|
nearPanel.SetActive(false);
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Reset()
|
||||||
|
{
|
||||||
|
inputField.text = string.Empty;
|
||||||
|
startValue.text = string.Empty;
|
||||||
|
endValue.text = string.Empty;
|
||||||
|
|
||||||
|
pageIndex = 0;
|
||||||
|
pageSize = 8;
|
||||||
|
totalPages = 0;
|
||||||
|
seachName = string.Empty;
|
||||||
|
|
||||||
|
_startValue = 0;
|
||||||
|
_endValue = 0;
|
||||||
|
|
||||||
|
foreach (var item in gameObjects)
|
||||||
|
{
|
||||||
|
item.GetComponent<SeletedPlayerScript>().Reset();
|
||||||
|
}
|
||||||
|
parent.DestroyChildren();
|
||||||
|
sort = 0;
|
||||||
|
sortImage.sprite = down;
|
||||||
}
|
}
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
//CreateGameObject(cyclingController.mapRouteRankingList);
|
//CreateGameObject(cyclingController.mapRouteRankingList);
|
||||||
Refresh();
|
//Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Refresh()
|
public void Refresh()
|
||||||
{
|
{
|
||||||
var list = mapApi.GetShadowList(App.RouteIdParam, seachName, pageIndex, pageSize);
|
var list = mapApi.GetShadowList(App.RouteIdParam, seachName, pageIndex, pageSize);
|
||||||
totalPages = list.data.TotalPages;
|
totalPages = list.data.TotalPages;
|
||||||
@@ -222,7 +256,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
private void CreateGameObject(List<MapRouteRanking> list)
|
private void CreateGameObject(List<MapRouteRanking> list)
|
||||||
{
|
{
|
||||||
var parent = transform.Find("Panel/PlayerList/Scroll View/Viewport/Content");
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach (var item in list)
|
foreach (var item in list)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
Image currentSlopeProcess;
|
Image currentSlopeProcess;
|
||||||
Text miniMapProcessText;
|
Text miniMapProcessText;
|
||||||
|
|
||||||
|
Slider cameraSlider;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
#region 控件获取与事件绑定
|
#region 控件获取与事件绑定
|
||||||
@@ -245,7 +247,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
time -= Time.deltaTime;
|
time -= Time.deltaTime;
|
||||||
while (time < 0) {
|
while (time < 0) {
|
||||||
MoveChartMarkPoint();
|
MoveElevationImage();
|
||||||
BindDataSource();
|
BindDataSource();
|
||||||
fps.text = (1 / Time.deltaTime).ToString();
|
fps.text = (1 / Time.deltaTime).ToString();
|
||||||
time = 1;
|
time = 1;
|
||||||
@@ -266,7 +268,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
player = transform.parent.Find("Player");
|
player = transform.parent.Find("Player");
|
||||||
var route = mainController.GetRoute();
|
var route = mainController.GetRoute();
|
||||||
routeInstance = route.RouteInstance;
|
routeInstance = route.RouteInstance;
|
||||||
mapName.text = routeInstance.Name;
|
//初始化3d视角
|
||||||
var camera = routeInstance.Camera;
|
var camera = routeInstance.Camera;
|
||||||
if (!string.IsNullOrEmpty(camera))
|
if (!string.IsNullOrEmpty(camera))
|
||||||
{
|
{
|
||||||
@@ -275,9 +277,26 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
cameraY = float.Parse(cameraArr[1]);
|
cameraY = float.Parse(cameraArr[1]);
|
||||||
cameraZ = float.Parse(cameraArr[2]);
|
cameraZ = float.Parse(cameraArr[2]);
|
||||||
}
|
}
|
||||||
|
//开发者视角调整
|
||||||
|
cameraSlider = transform.Find("Panel/CameraSlider").GetComponent<Slider>();
|
||||||
|
Text CameraText = transform.Find("Panel/CameraSlider/Text").GetComponent<Text>();
|
||||||
|
string[] phoneList = new string[] { "18120141032", "15651831367", "18120141031", "15261826280", "18662240319" };
|
||||||
|
if (phoneList.Contains(App.CurrentUser.Phone))
|
||||||
|
{
|
||||||
|
cameraSlider.gameObject.SetActive(true);
|
||||||
|
cameraSlider.value = cameraY;
|
||||||
|
CameraText.text = cameraY.ToString("f0");
|
||||||
|
cameraSlider.onValueChanged.AddListener((f) =>
|
||||||
|
{
|
||||||
|
cameraY = f;
|
||||||
|
CameraText.text = f.ToString("f0");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//路书基本信息绑定
|
||||||
|
mapName.text = routeInstance.Name;
|
||||||
totalDistance.text = Math.Round(mainController.GetMapData().TotalDistance, 1).ToString() + "KM";//总里程
|
totalDistance.text = Math.Round(mainController.GetMapData().TotalDistance, 1).ToString() + "KM";//总里程
|
||||||
Utils.DisplayImage(altitudeGraph, route.RouteInstance.AltitudeGraph);//渲染海拔图
|
Utils.DisplayImage(altitudeGraph, route.RouteInstance.AltitudeGraph);//渲染海拔图
|
||||||
|
//影子骑行按钮控制
|
||||||
if (mainController.mapRouteRankingList == null || mainController.mapRouteRankingList.Count == 0)
|
if (mainController.mapRouteRankingList == null || mainController.mapRouteRankingList.Count == 0)
|
||||||
{
|
{
|
||||||
shadowButton.image.sprite = Resources.Load<Sprite>("Images/Ride/Shadow Mode_no");
|
shadowButton.image.sprite = Resources.Load<Sprite>("Images/Ride/Shadow Mode_no");
|
||||||
@@ -289,7 +308,6 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
shadowButton.enabled = true;
|
shadowButton.enabled = true;
|
||||||
shadowButton.interactable = true;
|
shadowButton.interactable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//标记3d的地图可以用
|
//标记3d的地图可以用
|
||||||
if (!route.RouteInstance.Enable3D)
|
if (!route.RouteInstance.Enable3D)
|
||||||
{
|
{
|
||||||
@@ -328,7 +346,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Vector3 m = new Vector3(0.1f, 0.1f, 0.1f);
|
Vector3 m = new Vector3(0.1f, 0.1f, 0.1f);
|
||||||
|
Vector3 CameraVector = Vector3.zero;
|
||||||
//移动摄像头和箭头位置
|
//移动摄像头和箭头位置
|
||||||
private void MoveCamera()
|
private void MoveCamera()
|
||||||
{
|
{
|
||||||
@@ -345,7 +363,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target.transform.eulerAngles = new Vector3(cameraX, cameraY, cameraZ);
|
CameraVector.x = cameraX;
|
||||||
|
CameraVector.y = cameraY;
|
||||||
|
CameraVector.z = cameraZ;
|
||||||
|
target.transform.eulerAngles = CameraVector;
|
||||||
}
|
}
|
||||||
//控制照片移动
|
//控制照片移动
|
||||||
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
|
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
|
||||||
@@ -371,7 +392,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
mainController.SetStart();
|
mainController.SetStart();
|
||||||
countDownTxt.gameObject.SetActive(false);
|
var canvasGroup = countDownTxt.transform.GetComponent<CanvasGroup>();
|
||||||
|
canvasGroup.DOFade(0, 1).onComplete+=()=> {
|
||||||
|
countDownTxt.gameObject.SetActive(false);
|
||||||
|
canvasGroup.alpha = 1;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (count == 1 && mainController.cyclingModel == CyclingModel.Single)
|
if (count == 1 && mainController.cyclingModel == CyclingModel.Single)
|
||||||
{
|
{
|
||||||
@@ -379,10 +404,12 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
//附近的人
|
//附近的人
|
||||||
// nearByPanel.GetComponent<CanvasGroup>().DOFade(0, 1);
|
// nearByPanel.GetComponent<CanvasGroup>().DOFade(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
countDownTxt.transform.DOPunchScale(new Vector3(1.2f, 1.2f, 1.2f),1,1,1);
|
||||||
timeRemaining = 1.0f;
|
timeRemaining = 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
countDownTxt.text = count.ToString();
|
countDownTxt.text = count==0?"GO!": count.ToString();
|
||||||
}
|
}
|
||||||
private void BindDataSource()
|
private void BindDataSource()
|
||||||
{
|
{
|
||||||
@@ -450,10 +477,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
private void ShadowRide(BaseEventData baseEventData)
|
private void ShadowRide(BaseEventData baseEventData)
|
||||||
{
|
{
|
||||||
//mainController.SetCyclingModel(CyclingModel.Review);
|
|
||||||
selectPanel.SetActive(false);
|
selectPanel.SetActive(false);
|
||||||
//显示影子选手骑行列表
|
//显示影子选手骑行列表
|
||||||
selectPlayer.SetActive(true);
|
selectPlayer.SetActive(true);
|
||||||
|
selectPlayer.GetComponent<SelectPlayerFactory>().Refresh();
|
||||||
//显示附近的人列表
|
//显示附近的人列表
|
||||||
nearByPanel.SetActive(true);
|
nearByPanel.SetActive(true);
|
||||||
}
|
}
|
||||||
@@ -581,11 +608,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
var one = mapData.List.Where(c => c.Distance == 0).Count();
|
var one = mapData.List.Where(c => c.Distance == 0).Count();
|
||||||
foreach (var item in mapData.List)
|
foreach (var item in mapData.List)
|
||||||
{
|
{
|
||||||
x += item.Distance;
|
|
||||||
if (!dataSource.ContainsKey(x))
|
if (!dataSource.ContainsKey(x))
|
||||||
{
|
{
|
||||||
dataSource.Add(x, item.Elevation);
|
dataSource.Add(x, item.Elevation);
|
||||||
}
|
}
|
||||||
|
x += item.Distance;
|
||||||
dd.Add(item.Elevation);
|
dd.Add(item.Elevation);
|
||||||
}
|
}
|
||||||
chartDataSourceScript = transform.Find("Panel/GraphChart").GetComponent<ChartDataSourceScript>();
|
chartDataSourceScript = transform.Find("Panel/GraphChart").GetComponent<ChartDataSourceScript>();
|
||||||
@@ -598,64 +625,6 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveChartMarkPoint()
|
|
||||||
{
|
|
||||||
//if (mainController.isStart)
|
|
||||||
{
|
|
||||||
MoverCurrentUserHead();
|
|
||||||
MoveOtherHeads();
|
|
||||||
MoveElevationImage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//移动当前用户头像
|
|
||||||
private void MoverCurrentUserHead()
|
|
||||||
{
|
|
||||||
Vector3 prePos = headPanel.transform.position;
|
|
||||||
int nextIndex = playerController.CurrentIndex + 1;
|
|
||||||
var viewIndex = chartDataSourceScript.GetViewIndex(nextIndex);
|
|
||||||
if (!mainController.isStart && !mainController.isPause && !mainController.isQuit ||(mainController.isStart && playerController.TotalDistance == 0))//未开始未暂停未结束
|
|
||||||
{
|
|
||||||
viewIndex = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
var n = graph.DataSource.GetPoint("Player 2", viewIndex);
|
|
||||||
graph.PointToWorldSpace(out Vector3 nextPosition, n.x, n.y, "Player 2");
|
|
||||||
nextPosition.x -= 14f;
|
|
||||||
nextPosition.y += 5f;
|
|
||||||
//人物移动 停止条件 到中间且线未加载完
|
|
||||||
if (chartDataSourceScript.ReachMid(viewIndex) && !chartDataSourceScript.ReachEnd())
|
|
||||||
{
|
|
||||||
var currentDistance = playerController.CurrentDistance;
|
|
||||||
var distance = playerController.Distance;
|
|
||||||
var offset = currentDistance > 0 ? distance * 1000 / currentDistance : 1;
|
|
||||||
graph.HorizontalScrolling += offset;
|
|
||||||
headPanel.transform.DOMove(new Vector3(prePos.x, nextPosition.y, 0), 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
headPanel.transform.DOMove(new Vector3(nextPosition.x , nextPosition.y, 0), 1);
|
|
||||||
}
|
|
||||||
headPanel.transform.SetSiblingIndex(999);
|
|
||||||
}
|
|
||||||
//移动其他骑手头像
|
|
||||||
private void MoveOtherHeads()
|
|
||||||
{
|
|
||||||
var others = FindObjectsOfType<OtherPlayerController>();
|
|
||||||
foreach (var item in others)
|
|
||||||
{
|
|
||||||
var itemIndex = chartDataSourceScript.GetViewIndex(item.CurrentIndex) + 1;
|
|
||||||
if (!mainController.isStart && !mainController.isPause && !mainController.isQuit || (mainController.isStart && item.TotalDistance == 0))//未开始未暂停未结束
|
|
||||||
{
|
|
||||||
itemIndex = 0;
|
|
||||||
}
|
|
||||||
var m = graph.DataSource.GetPoint("Player 2", itemIndex);
|
|
||||||
graph.PointToWorldSpace(out Vector3 itemPosition, m.x, m.y, "Player 2");
|
|
||||||
itemPosition.x -= 12f;
|
|
||||||
itemPosition.y += 5f;
|
|
||||||
item.MoveHead(graph.transform, itemPosition);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//移动总海拔图范围
|
//移动总海拔图范围
|
||||||
private void MoveElevationImage()
|
private void MoveElevationImage()
|
||||||
{
|
{
|
||||||
@@ -668,7 +637,6 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//var m = Screen.width / 1600D;
|
|
||||||
var start = chartDataSourceScript.GetRealTimeStart();
|
var start = chartDataSourceScript.GetRealTimeStart();
|
||||||
var end = chartDataSourceScript.GetRealTimeEnd();
|
var end = chartDataSourceScript.GetRealTimeEnd();
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Assets.Scenes.Ride.Scripts.Model;
|
|||||||
using Assets.Scripts.Apis.Models;
|
using Assets.Scripts.Apis.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -91,7 +92,7 @@ namespace Assets.Scripts.Apis
|
|||||||
|
|
||||||
public async Task<JsonResult<List<NearRouteModel>>> GetNearRouteAsync(float lat, float lng, float zoom, string bounds)
|
public async Task<JsonResult<List<NearRouteModel>>> GetNearRouteAsync(float lat, float lng, float zoom, string bounds)
|
||||||
{
|
{
|
||||||
var res = await GetAsync<JsonResult<List<NearRouteModel>>>($"/Map/GetNearRoute?lat={ lat }&lng={ lng }&zoom={zoom}&bounds={ bounds }");
|
var res = await GetAsync<JsonResult<List<NearRouteModel>>>($"/Map/GetNearRoute?lat={ lat.ToString(CultureInfo.InvariantCulture) }&lng={ lng.ToString(CultureInfo.InvariantCulture) }&zoom={zoom.ToString(CultureInfo.InvariantCulture)}&bounds={ bounds }");
|
||||||
|
|
||||||
//var result = System.Text.Encoding.UTF8.GetString(res);
|
//var result = System.Text.Encoding.UTF8.GetString(res);
|
||||||
return res;
|
return res;
|
||||||
@@ -141,7 +142,8 @@ namespace Assets.Scripts.Apis
|
|||||||
|
|
||||||
public async Task<JsonResult<object>> GetEarthData(double lat, double lon)
|
public async Task<JsonResult<object>> GetEarthData(double lat, double lon)
|
||||||
{
|
{
|
||||||
var result = await GetAsync<JsonResult<object>>($"Map/GetEarthData?lat={ lat }&lon={ lon }");
|
//CultureInfo.InvariantCulture
|
||||||
|
var result = await GetAsync<JsonResult<object>>($"Map/GetEarthData?lat={ lat.ToString(CultureInfo.InvariantCulture) }&lon={ lon.ToString(CultureInfo.InvariantCulture) }");
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -11,14 +12,6 @@ namespace Assets.Scripts.Apis
|
|||||||
{
|
{
|
||||||
public class ThirdPartApi : ApiBase
|
public class ThirdPartApi : ApiBase
|
||||||
{
|
{
|
||||||
public async Task<JObject> GetWxAccessToken(string code)
|
|
||||||
{
|
|
||||||
return await GetThirdPartAsync<JObject>($"https://api.weixin.qq.com/sns/oauth2/access_token?appid={App.WxAppId}&secret={App.WxAppSecret}&code={code}&grant_type=authorization_code");
|
|
||||||
}
|
|
||||||
public async Task<JObject> GetWxUserInfo(string accessToken, string openId)
|
|
||||||
{
|
|
||||||
return await GetThirdPartAsync<JObject>($"https://api.weixin.qq.com/sns/userinfo?access_token=" + accessToken + "&openid=" + openId);
|
|
||||||
}
|
|
||||||
public async Task<IpToGeoModel> GetLocationInfo()
|
public async Task<IpToGeoModel> GetLocationInfo()
|
||||||
{
|
{
|
||||||
return await GetThirdPartAsync<IpToGeoModel>("https://ip.seeip.org/geoip");
|
return await GetThirdPartAsync<IpToGeoModel>("https://ip.seeip.org/geoip");
|
||||||
@@ -26,7 +19,7 @@ namespace Assets.Scripts.Apis
|
|||||||
}
|
}
|
||||||
public async Task<Stream> GetMapImage(IpToGeoModel locationInfo)
|
public async Task<Stream> GetMapImage(IpToGeoModel locationInfo)
|
||||||
{
|
{
|
||||||
return await GetThirdPartStreamAsync($"https://api.mapbox.com/styles/v1/juzetest/ckmkdjwsa1nvt17nr1ps4fqgs/static/{locationInfo.longitude},{locationInfo.latitude},12,0/1280x1280?access_token=pk.eyJ1IjoianV6ZXRlc3QiLCJhIjoiY2ttazhsbnpiMGVrdjJucGhyNnh6eXcxYSJ9.6zj2U9eFCNJRMljNlMxjVg");
|
return await GetThirdPartStreamAsync($"https://api.mapbox.com/styles/v1/juzetest/ckmkdjwsa1nvt17nr1ps4fqgs/static/{locationInfo.longitude.ToString(CultureInfo.InvariantCulture)},{locationInfo.latitude.ToString(CultureInfo.InvariantCulture)},12,0/1280x1280?access_token=pk.eyJ1IjoianV6ZXRlc3QiLCJhIjoiY2ttazhsbnpiMGVrdjJucGhyNnh6eXcxYSJ9.6zj2U9eFCNJRMljNlMxjVg");
|
||||||
//pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA
|
//pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA
|
||||||
//pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA
|
//pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,25 @@ namespace Assets.Scripts.Apis
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
public async Task<JsonResult<object>> OnWebWxLoginCheckUnionIdByCode(string code,string state)
|
||||||
|
{
|
||||||
|
var r = await GetAsync<JsonResult<object>>($"NoAuth/v1/OnWebWxLogin?code={code}&state={state}");
|
||||||
|
if (r.result)
|
||||||
|
{
|
||||||
|
var data = JObject.FromObject(r.data);
|
||||||
|
if (data.Value<string>("success") != null && data.Value<string>("success") == "False")
|
||||||
|
{
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var user = data.ToObject<UserResultModel>();
|
||||||
|
user.cookie = cookies[0].Value;
|
||||||
|
r.data = user;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
public async Task<JsonResult<object>> OnWebWxLoginCheckUnionId(string unionId, string openId)
|
public async Task<JsonResult<object>> OnWebWxLoginCheckUnionId(string unionId, string openId)
|
||||||
{
|
{
|
||||||
var r = await PostAsync<JsonResult<object>>("NoAuth/OnWebWxLoginCheckUnionId", new { unionId, openId });
|
var r = await PostAsync<JsonResult<object>>("NoAuth/OnWebWxLoginCheckUnionId", new { unionId, openId });
|
||||||
@@ -205,11 +223,11 @@ namespace Assets.Scripts.Apis
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
public async Task<JsonResult<object>> OnWebWxLogin(string Phone, string Captcha
|
public async Task<JsonResult<object>> OnWebWxLogin(string Phone, string Captcha,
|
||||||
, string UnionId, string WxWebOpenId, string WxHeadImg, string NickName, int? Sex, string Password)
|
string Password, string UnionId, string WxWebOpenId)
|
||||||
{
|
{
|
||||||
var r = await PostAsync<JsonResult<object>>("NoAuth/OnWebWxLogin",
|
var r = await PostAsync<JsonResult<object>>("NoAuth/v1/OnWebWxLogin",
|
||||||
new { Phone, Captcha, UnionId, WxWebOpenId, WxHeadImg, NickName, Sex, Pwd = Password });
|
new { Phone, Captcha, UnionId, openId = WxWebOpenId, Pwd = Password });
|
||||||
if (r.result)
|
if (r.result)
|
||||||
{
|
{
|
||||||
var u = JObject.FromObject(r.data);
|
var u = JObject.FromObject(r.data);
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Threading;
|
||||||
|
using Assets.Scripts.Devices;
|
||||||
|
|
||||||
public static class App
|
public static class App
|
||||||
{
|
{
|
||||||
@@ -15,8 +18,7 @@ public static class App
|
|||||||
public static int RouteIdParam = 0;
|
public static int RouteIdParam = 0;
|
||||||
public static UserResultModel CurrentUser { get; set; }
|
public static UserResultModel CurrentUser { get; set; }
|
||||||
public static string WxAppId = "wx9e8ca734e024f084";
|
public static string WxAppId = "wx9e8ca734e024f084";
|
||||||
public static string WxAppSecret = "906abafb2a18bc7a66ccfa5550f859b6";
|
|
||||||
|
|
||||||
public static string MapBoxAccessToken => "pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA";
|
public static string MapBoxAccessToken => "pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA";
|
||||||
|
|
||||||
public static double latitude { get; internal set; }
|
public static double latitude { get; internal set; }
|
||||||
@@ -48,8 +50,25 @@ public static class App
|
|||||||
//public static string AppDownloadUrl { get; internal set; }
|
//public static string AppDownloadUrl { get; internal set; }
|
||||||
//public static string AppVersionCode { get; internal set; }
|
//public static string AppVersionCode { get; internal set; }
|
||||||
|
|
||||||
|
private static MainDeviceAdapter mainDeviceAdapter;
|
||||||
|
public static MainDeviceAdapter MainDeviceAdapter
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if(mainDeviceAdapter == null)
|
||||||
|
{
|
||||||
|
mainDeviceAdapter = new MainDeviceAdapter();
|
||||||
|
}
|
||||||
|
return mainDeviceAdapter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static App()
|
static App()
|
||||||
{
|
{
|
||||||
|
//CultureInfo currentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
|
||||||
|
//currentCulture.NumberFormat.NumberDecimalSeparator = ".";
|
||||||
|
//Thread.CurrentThread.CurrentCulture = currentCulture;
|
||||||
|
//System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
|
||||||
#if !UNITY_EDITOR
|
#if !UNITY_EDITOR
|
||||||
// Host = "http://pf.juze.pro/";
|
// Host = "http://pf.juze.pro/";
|
||||||
// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using Assets.Scripts.Devices.Ant;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices
|
||||||
|
{
|
||||||
|
public abstract class AbstractDevice
|
||||||
|
{
|
||||||
|
public virtual DeviceState State { get; set; } = DeviceState.Disconnected;
|
||||||
|
|
||||||
|
public SensorType Sensor { get; protected set; }
|
||||||
|
|
||||||
|
public string Id
|
||||||
|
{
|
||||||
|
get; protected set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual string Name
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
protected set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual ushort DeviceNumber { get; set; }
|
||||||
|
|
||||||
|
public virtual int Priority
|
||||||
|
{
|
||||||
|
get; protected set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NetworkType Network { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 信号强度
|
||||||
|
/// 信号从0dbm~97dbm,个人建议是0~30是强,30~70是中,70~97是弱。
|
||||||
|
/// </summary>
|
||||||
|
public int SignalStrength { get; internal set; }
|
||||||
|
|
||||||
|
protected AbstractDevice(string id, NetworkType networkType)
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Network = networkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public abstract void Connect();
|
||||||
|
|
||||||
|
public abstract void Disconnect(bool save = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6adf1f0c1d929374aac00f3a6a2445bf
|
guid: c92a5d01ab0176b46bb79faf3ffa2fc0
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -12,16 +12,12 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
{
|
{
|
||||||
public abstract class AbstractAntDevice : DataSourceBase
|
public abstract class AbstractAntDevice : DataSourceBase
|
||||||
{
|
{
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
protected set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AntChannelProfile searchProfile;
|
public AntChannelProfile searchProfile;
|
||||||
public bool isInitialized = false;
|
public bool isInitialized = false;
|
||||||
private DeviceState state;
|
private DeviceState state;
|
||||||
public DeviceState State
|
public override DeviceState State
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -37,7 +33,7 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
StateChange?.Invoke(state);
|
StateChange?.Invoke(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public SensorType Sensor { get; private set; }
|
|
||||||
|
|
||||||
private int _ManufacturerId;
|
private int _ManufacturerId;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -56,7 +52,7 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ushort _DeviceNumber;
|
private ushort _DeviceNumber;
|
||||||
public ushort DeviceNumber
|
public override ushort DeviceNumber
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -92,17 +88,13 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
public bool pairingEnabled;
|
public bool pairingEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual int Priority
|
|
||||||
{
|
|
||||||
get; protected set;
|
|
||||||
}
|
|
||||||
|
|
||||||
//private readonly Rhino.PowerFun.Services.DeviceService deviceService;
|
//private readonly Rhino.PowerFun.Services.DeviceService deviceService;
|
||||||
//private readonly DeviceDetailService _deviceDetailService;
|
//private readonly DeviceDetailService _deviceDetailService;
|
||||||
//private readonly AntManufacturerService antManufacturerService;
|
//private readonly AntManufacturerService antManufacturerService;
|
||||||
protected List<IPageHandler> pageHandlers = new List<IPageHandler>();
|
protected List<IPageHandler> pageHandlers = new List<IPageHandler>();
|
||||||
public AbstractAntDevice(String defaultSourceName, racerSportType sportType, SensorType sensor)
|
public AbstractAntDevice(string id, String defaultSourceName, racerSportType sportType, SensorType sensor)
|
||||||
: base(sportType, true)
|
: base(id, sportType, true)
|
||||||
{
|
{
|
||||||
State = DeviceState.Disconnected;
|
State = DeviceState.Disconnected;
|
||||||
this.Name = defaultSourceName;
|
this.Name = defaultSourceName;
|
||||||
@@ -174,7 +166,7 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
// base.reset();
|
// base.reset();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
public void Connect()
|
public override void Connect()
|
||||||
{
|
{
|
||||||
if (State == DeviceState.Connected || State == DeviceState.Connecting)
|
if (State == DeviceState.Connected || State == DeviceState.Connecting)
|
||||||
return;
|
return;
|
||||||
@@ -182,7 +174,7 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
AntConnector.Instance().ConnectDevice(this);
|
AntConnector.Instance().ConnectDevice(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disconnect(bool save = true)
|
public override void Disconnect(bool save = true)
|
||||||
{
|
{
|
||||||
if (State == DeviceState.Disconnected || State == DeviceState.Disconnecting)
|
if (State == DeviceState.Disconnected || State == DeviceState.Disconnecting)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
}
|
}
|
||||||
//CheckStatus();
|
//CheckStatus();
|
||||||
|
|
||||||
deviceList.Add(new FitDevice());
|
deviceList.Add(new FitDevice(""));
|
||||||
deviceList.Add(new PowerDevice());
|
deviceList.Add(new PowerDevice(""));
|
||||||
deviceList.Add(new CadenceDevice());
|
deviceList.Add(new CadenceDevice(""));
|
||||||
deviceList.Add(new HeartRateDevice());
|
deviceList.Add(new HeartRateDevice(""));
|
||||||
deviceList.Add(new BikeSpdCadDevice());
|
deviceList.Add(new BikeSpdCadDevice(""));
|
||||||
|
|
||||||
var timer = new System.Timers.Timer(1000);
|
var timer = new System.Timers.Timer(1000);
|
||||||
timer.AutoReset = true;
|
timer.AutoReset = true;
|
||||||
@@ -336,27 +336,28 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
var device1 = deviceList.SingleOrDefault(d => d.searchProfile.deviceType == deviceTypeId);
|
var device1 = deviceList.SingleOrDefault(d => d.searchProfile.deviceType == deviceTypeId);
|
||||||
if (device1 != null)
|
if (device1 != null)
|
||||||
{
|
{
|
||||||
|
var id = $"{ deviceNumber }:{ deviceTypeId}:{ transmissionTypeId }";
|
||||||
AbstractAntDevice device = null;
|
AbstractAntDevice device = null;
|
||||||
switch (device1.Sensor)
|
switch (device1.Sensor)
|
||||||
{
|
{
|
||||||
case SensorType.None:
|
case SensorType.None:
|
||||||
break;
|
break;
|
||||||
case SensorType.Cadence:
|
case SensorType.Cadence:
|
||||||
device = new CadenceDevice();
|
device = new CadenceDevice(id);
|
||||||
break;
|
break;
|
||||||
case SensorType.HeartRate:
|
case SensorType.HeartRate:
|
||||||
device = new HeartRateDevice();
|
device = new HeartRateDevice(id);
|
||||||
break;
|
break;
|
||||||
case SensorType.Power:
|
case SensorType.Power:
|
||||||
device = new PowerDevice();
|
device = new PowerDevice(id);
|
||||||
break;
|
break;
|
||||||
case SensorType.Speed:
|
case SensorType.Speed:
|
||||||
break;
|
break;
|
||||||
case SensorType.SpeedCadence:
|
case SensorType.SpeedCadence:
|
||||||
device = new BikeSpdCadDevice();
|
device = new BikeSpdCadDevice(id);
|
||||||
break;
|
break;
|
||||||
case SensorType.Trainer:
|
case SensorType.Trainer:
|
||||||
device = new FitDevice();
|
device = new FitDevice(id);
|
||||||
break;
|
break;
|
||||||
case SensorType.VirtualPower:
|
case SensorType.VirtualPower:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
using Assets.Scripts.UI.Prefab.Device;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices.Ant
|
||||||
|
{
|
||||||
|
public class AntDeviceAdapter : DeviceAdapter
|
||||||
|
{
|
||||||
|
public override ConnectionInterface Interface => ConnectionInterface.ANT;
|
||||||
|
|
||||||
|
public AntDeviceAdapter()
|
||||||
|
{
|
||||||
|
AntConnector.Instance((device2) => {
|
||||||
|
if (device2.State == DeviceState.Disconnected)
|
||||||
|
{
|
||||||
|
//Debug.Log($"探索到新的设备{ device2.DeviceNumber }");
|
||||||
|
//自动连接
|
||||||
|
if (DeviceCache.Exist(device2))
|
||||||
|
{
|
||||||
|
//Debug.Log("自动连接" + device2.DeviceNumber);
|
||||||
|
device2.Connect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, Debug.Log);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override DeviceAdapterState GetState()
|
||||||
|
{
|
||||||
|
if (AntConnector.Instance().IsAvailable)
|
||||||
|
{
|
||||||
|
return DeviceAdapterState.On;
|
||||||
|
}
|
||||||
|
return DeviceAdapterState.Unavailable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<AbstractDevice> GetDevices()
|
||||||
|
{
|
||||||
|
return AntConnector.Instance().discoveredDevices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void StartScan()
|
||||||
|
{
|
||||||
|
//throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void StopScan()
|
||||||
|
{
|
||||||
|
//throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
AntConnector.Instance().Dispose();
|
||||||
|
base.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ae92e0e9dabf0114abd73458f7733f36
|
guid: aa2b23675a0486a40881d44a57de8d73
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -18,8 +18,8 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
private RotationData _speedData = new RotationData();
|
private RotationData _speedData = new RotationData();
|
||||||
private RotationData _cadenceData = new RotationData();
|
private RotationData _cadenceData = new RotationData();
|
||||||
|
|
||||||
public BikeSpdCadDevice(double wheelCircumfrence_m = DEFAULT_WHEEL_CIRCUMFERENCE_m)
|
public BikeSpdCadDevice(string id, double wheelCircumfrence_m = DEFAULT_WHEEL_CIRCUMFERENCE_m)
|
||||||
: base("Ant+ Speed&Cadence", racerSportType.Biking, SensorType.SpeedCadence)
|
: base(id, "Ant+ Speed&Cadence", racerSportType.Biking, SensorType.SpeedCadence)
|
||||||
{
|
{
|
||||||
Priority = 1;
|
Priority = 1;
|
||||||
this.wheelCircumfrence_m = wheelCircumfrence_m;
|
this.wheelCircumfrence_m = wheelCircumfrence_m;
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
private DateTime _now = DateTime.Now;
|
private DateTime _now = DateTime.Now;
|
||||||
private RotationData _rotationData = new RotationData();
|
private RotationData _rotationData = new RotationData();
|
||||||
|
|
||||||
public CadenceDevice()
|
public CadenceDevice(string id)
|
||||||
: base("Ant+ Cadence", racerSportType.Biking, SensorType.Cadence)
|
: base(id, "Ant+ Cadence", racerSportType.Biking, SensorType.Cadence)
|
||||||
{
|
{
|
||||||
Priority = 2;
|
Priority = 2;
|
||||||
//if (speedSensor.isInUse)
|
//if (speedSensor.isInUse)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Assets.Scripts.Devices.Ant
|
namespace Assets.Scripts.Devices.Ant
|
||||||
{
|
{
|
||||||
public abstract class DataSourceBase
|
public abstract class DataSourceBase : AbstractDevice
|
||||||
{
|
{
|
||||||
//double distanceTravelled = 0;
|
//double distanceTravelled = 0;
|
||||||
//DataSourcePacket lastPacketRcvd = null;
|
//DataSourcePacket lastPacketRcvd = null;
|
||||||
@@ -26,7 +26,7 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
public readonly byte uid;
|
public readonly byte uid;
|
||||||
|
|
||||||
|
|
||||||
public DataSourceBase(racerSportType sportType, bool isHuman)
|
public DataSourceBase(string id, racerSportType sportType, bool isHuman):base(id, NetworkType.ANT)
|
||||||
{
|
{
|
||||||
this.sportType = sportType;
|
this.sportType = sportType;
|
||||||
this.isHuman = isHuman;
|
this.isHuman = isHuman;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace Assets.Scripts.Devices.Ant
|
namespace Assets.Scripts.Devices.Ant
|
||||||
{
|
{
|
||||||
public class FitDevice : AbstractAntDevice, ISpeedDevice, IPowerDevice, ICadenceDevice, IRequiresRiderWeight
|
public class FitDevice : AbstractAntDevice, ISpeedDevice, IPowerDevice, ICadenceDevice, IRequiresRiderWeight, ITrainerDevice
|
||||||
{
|
{
|
||||||
public const int MAX_NO_EVENT_STOP_COUNT = 12;
|
public const int MAX_NO_EVENT_STOP_COUNT = 12;
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private double _grade = 0;
|
private double _grade = 0;
|
||||||
private bool IsCalibrating { get; set; }
|
private bool IsCalibrating { get; set; }
|
||||||
public FitDevice()
|
public FitDevice(string id)
|
||||||
: base("Ant+ Trainer", racerSportType.Unknown, SensorType.Trainer)
|
: base(id, "Ant+ Trainer", racerSportType.Unknown, SensorType.Trainer)
|
||||||
{
|
{
|
||||||
Priority = 0;
|
Priority = 0;
|
||||||
this.StateChange = (state) =>
|
this.StateChange = (state) =>
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
|
|
||||||
//ds_AntPlus_BikeSpd speedSensor;
|
//ds_AntPlus_BikeSpd speedSensor;
|
||||||
|
|
||||||
public HeartRateDevice()
|
public HeartRateDevice(string id)
|
||||||
: base("Ant+ HeartRate", racerSportType.Unknown, SensorType.HeartRate)
|
: base(id, "Ant+ HeartRate", racerSportType.Unknown, SensorType.HeartRate)
|
||||||
{
|
{
|
||||||
Priority = 2;
|
Priority = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices.Ant.Interfaces
|
||||||
|
{
|
||||||
|
public interface ITrainerDevice
|
||||||
|
{
|
||||||
|
void SetErgMode(int targetPower);
|
||||||
|
|
||||||
|
void SetResistanceMode(double value);
|
||||||
|
|
||||||
|
void SetWindResistance(double? height = null);
|
||||||
|
|
||||||
|
void SetTrackResistance(double grade);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 362cacfc69d803d478112e7c293cfa17
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -23,8 +23,8 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
|
|
||||||
//List<IPageHandler> pageHandlers;
|
//List<IPageHandler> pageHandlers;
|
||||||
|
|
||||||
public PowerDevice()
|
public PowerDevice(string id)
|
||||||
: base("Ant+ Power", racerSportType.Biking, SensorType.Power)
|
: base(id, "Ant+ Power", racerSportType.Biking, SensorType.Power)
|
||||||
{
|
{
|
||||||
Priority = 2;
|
Priority = 2;
|
||||||
//pageHandlers = new List<IPageHandler>();
|
//pageHandlers = new List<IPageHandler>();
|
||||||
|
|||||||
@@ -39,4 +39,10 @@ namespace Assets.Scripts.Devices.Ant
|
|||||||
Trainer,
|
Trainer,
|
||||||
VirtualPower,
|
VirtualPower,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum NetworkType
|
||||||
|
{
|
||||||
|
BLE,
|
||||||
|
ANT
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 9c10d8a67a9a13f46bb4f2111feb60ff
|
guid: 157803f0c8b4ed542a209a947896097b
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts
|
||||||
|
{
|
||||||
|
public static class BitConvertHelper
|
||||||
|
{
|
||||||
|
public static byte Lsn(byte b)
|
||||||
|
{
|
||||||
|
return (byte)(b & 15);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x060032F7 RID: 13047 RVA: 0x000C22C3 File Offset: 0x000C04C3
|
||||||
|
public static byte Lsn(byte[] bytes, int index)
|
||||||
|
{
|
||||||
|
return BitConvertHelper.Lsn(bytes[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte ToUInt8(byte[] bytes, int index)
|
||||||
|
{
|
||||||
|
return bytes[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x060032FB RID: 13051 RVA: 0x000C22E8 File Offset: 0x000C04E8
|
||||||
|
public static ushort ToUInt12(byte[] bytes, int index)
|
||||||
|
{
|
||||||
|
return (ushort)((int)bytes[index] + ((int)BitConvertHelper.Lsn(bytes[index + 1]) << 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ushort ToUInt16(byte[] bytes, int startIndex)
|
||||||
|
{
|
||||||
|
return BitConverter.ToUInt16(bytes, startIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static short ToInt16(byte[] bytes, int startIndex)
|
||||||
|
{
|
||||||
|
return BitConverter.ToInt16(bytes, startIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint ToUInt32(byte[] bytes, int startIndex)
|
||||||
|
{
|
||||||
|
return BitConverter.ToUInt32(bytes, startIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 26dac648c68553d4bb2bccf4e54c4dfc
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
using Assets.Scripts.Devices.Ble;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Ble
|
||||||
|
{
|
||||||
|
public abstract class BleCharacteristicInfo
|
||||||
|
{
|
||||||
|
// Token: 0x170005BF RID: 1471
|
||||||
|
// (get) Token: 0x06001FE3 RID: 8163 RVA: 0x00085CF7 File Offset: 0x00083EF7
|
||||||
|
public BlePeripheralInfo Peripheral
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.Service.Peripheral;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x170005C0 RID: 1472
|
||||||
|
// (get) Token: 0x06001FE4 RID: 8164 RVA: 0x00085D04 File Offset: 0x00083F04
|
||||||
|
public BleServiceInfo Service { get; }
|
||||||
|
|
||||||
|
// Token: 0x170005C1 RID: 1473
|
||||||
|
// (get) Token: 0x06001FE5 RID: 8165 RVA: 0x00085D0C File Offset: 0x00083F0C
|
||||||
|
public Guid Id { get; }
|
||||||
|
|
||||||
|
// Token: 0x170005C2 RID: 1474
|
||||||
|
// (get) Token: 0x06001FE6 RID: 8166 RVA: 0x00085D14 File Offset: 0x00083F14
|
||||||
|
public BleCharacteristicProperties Properties { get; }
|
||||||
|
|
||||||
|
// Token: 0x06001FE7 RID: 8167 RVA: 0x00085D1C File Offset: 0x00083F1C
|
||||||
|
protected BleCharacteristicInfo(Guid id, BleServiceInfo service, BleCharacteristicProperties properties)
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Service = service;
|
||||||
|
this.Properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FE8 RID: 8168 RVA: 0x00085D3C File Offset: 0x00083F3C
|
||||||
|
public bool MatchGuid(Guid guid)
|
||||||
|
{
|
||||||
|
return this.Id.Equals(guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FE9 RID: 8169 RVA: 0x00085D58 File Offset: 0x00083F58
|
||||||
|
public bool MatchAddress(string address)
|
||||||
|
{
|
||||||
|
return this.Peripheral.MatchAddress(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FEA RID: 8170 RVA: 0x00085D68 File Offset: 0x00083F68
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
if (obj == null || !(base.GetType() == obj.GetType()))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
BleCharacteristicInfo bleCharacteristicInfo = (BleCharacteristicInfo)obj;
|
||||||
|
return this.Id.Equals(bleCharacteristicInfo.Id) && this.Service.Equals(bleCharacteristicInfo.Service);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FEB RID: 8171 RVA: 0x00085DC0 File Offset: 0x00083FC0
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return (17 * 23 + this.Id.GetHashCode()) * 23 + this.Peripheral.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FEC RID: 8172 RVA: 0x00085DF6 File Offset: 0x00083FF6
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return this.Id.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f417f704e04e35e4aaef2dcd366551ab
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Ble
|
||||||
|
{
|
||||||
|
[Flags]
|
||||||
|
public enum BleCharacteristicProperties
|
||||||
|
{
|
||||||
|
// Token: 0x0400115A RID: 4442
|
||||||
|
Broadcast = 1,
|
||||||
|
// Token: 0x0400115B RID: 4443
|
||||||
|
Read = 2,
|
||||||
|
// Token: 0x0400115C RID: 4444
|
||||||
|
WriteWithoutResponse = 4,
|
||||||
|
// Token: 0x0400115D RID: 4445
|
||||||
|
Write = 8,
|
||||||
|
// Token: 0x0400115E RID: 4446
|
||||||
|
Notify = 16,
|
||||||
|
// Token: 0x0400115F RID: 4447
|
||||||
|
Indicate = 32,
|
||||||
|
// Token: 0x04001160 RID: 4448
|
||||||
|
SignedWrites = 64,
|
||||||
|
// Token: 0x04001161 RID: 4449
|
||||||
|
ExtendedProperties = 128
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 44ea993e814c6f8408d93324b7cf4232
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Ble
|
||||||
|
{
|
||||||
|
public enum BleCharacteristicWriteType
|
||||||
|
{
|
||||||
|
// Token: 0x04001163 RID: 4451
|
||||||
|
WriteWithResponse,
|
||||||
|
// Token: 0x04001164 RID: 4452
|
||||||
|
WriteWithoutResponse
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 849439c6d534a5f4c9fd3ae52018478f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,262 @@
|
|||||||
|
using Assets.Scripts.Ble;
|
||||||
|
using Assets.Scripts.Ble.HeartRate;
|
||||||
|
using Assets.Scripts.Ble.Service;
|
||||||
|
using Assets.Scripts.Ble.Win;
|
||||||
|
using Assets.Scripts.Devices.Ant;
|
||||||
|
using Assets.Scripts.Devices.Ble.Characteristic;
|
||||||
|
using Assets.Scripts.Devices.Ble.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices.Ble
|
||||||
|
{
|
||||||
|
|
||||||
|
public abstract class BleDevice : AbstractDevice
|
||||||
|
{
|
||||||
|
protected BleWinHwInterface hwInterface;
|
||||||
|
protected BlePeripheralInfo peripheralInfo;
|
||||||
|
private readonly HashSet<BleService> services = new HashSet<BleService>();
|
||||||
|
|
||||||
|
private readonly HashSet<BleServiceInfo> pendingServices = new HashSet<BleServiceInfo>();
|
||||||
|
|
||||||
|
public override string Name { get => peripheralInfo.Name; protected set => base.Name = value; }
|
||||||
|
public string Address {
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return peripheralInfo.Address;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public List<ICharacteristic> Characteristics { get; protected set; } = new List<ICharacteristic>();
|
||||||
|
|
||||||
|
public BleDevice(BlePeripheralInfo peripheralInfo, BleWinHwInterface bleWinHwInterface, SensorType sensor) : base(peripheralInfo.Address, NetworkType.BLE)
|
||||||
|
{
|
||||||
|
this.hwInterface = bleWinHwInterface;
|
||||||
|
this.hwInterface.BluetoothStateChangedEvent += BluetoothStateChangedEvent;
|
||||||
|
this.hwInterface.PeripheralDisconnectedEvent += HwInterface_PeripheralDisconnectedEvent;
|
||||||
|
this.peripheralInfo = peripheralInfo;
|
||||||
|
|
||||||
|
base.Sensor = sensor;
|
||||||
|
|
||||||
|
//base.Name = this.peripheralInfo.Name;
|
||||||
|
|
||||||
|
Debug.Log(base.Name + "," + sensor.ToString() + "," + this.Address);
|
||||||
|
|
||||||
|
Characteristics.Add(new BatteryLevel());
|
||||||
|
Characteristics.Add(new ManufacturerNameCharacteristic());
|
||||||
|
Characteristics.Add(new ModelNumberCharacteristic());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HwInterface_PeripheralDisconnectedEvent(BleWinHwInterface hwInterface, BlePeripheralInfo peripheral, BleResponse response, bool manualDisconnect)
|
||||||
|
{
|
||||||
|
if (!peripheral.MatchAddress(this.peripheralInfo.Address))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Debug.Log("disconnected event");
|
||||||
|
if (this.State != DeviceState.Disconnected)
|
||||||
|
{
|
||||||
|
this.State = DeviceState.Disconnected;
|
||||||
|
|
||||||
|
if (!manualDisconnect)
|
||||||
|
{
|
||||||
|
this.ConnectToPeripheralIfPossible();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConnectToPeripheralIfPossible()
|
||||||
|
{
|
||||||
|
if(this.peripheralInfo == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!this.hwInterface.BleState.Equals(BleState.On) || this.State != DeviceState.Disconnected)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.State = DeviceState.Connecting;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.Log("连接设备");
|
||||||
|
this.hwInterface.ConnectPeripheral(this.peripheralInfo, PeripheralConnectedAction);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogError(ex);
|
||||||
|
this.State = DeviceState.Disconnected;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PeripheralConnectedAction(BleWinHwInterface hwInterface, BlePeripheralInfo sender, BleResponse response)
|
||||||
|
{
|
||||||
|
Debug.Log($"连接{ this.Name }"+response.IsSuccess);
|
||||||
|
if (response.IsSuccess)
|
||||||
|
{
|
||||||
|
State = DeviceState.Connected;
|
||||||
|
//Debug.Log("连接成功"+this.Name);
|
||||||
|
hwInterface.DiscoverServices(this.peripheralInfo, ServicesDiscoveredAction);//, this.ServicesDiscoveredAction);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.State = DeviceState.Disconnected;
|
||||||
|
|
||||||
|
if (response.Error != null)
|
||||||
|
{
|
||||||
|
if (response.Error.Code == WclBleErrors.WCL_E_BLUETOOTH_LE_DEVICE_NOT_FOUND)
|
||||||
|
{
|
||||||
|
Debug.Log("未找到设备");
|
||||||
|
App.MainDeviceAdapter.ClearDevice(this.peripheralInfo.Address);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Disconnect()
|
||||||
|
{
|
||||||
|
if (this.State != DeviceState.Disconnected)
|
||||||
|
{
|
||||||
|
Debug.Log("断开设备" + this.Name);
|
||||||
|
|
||||||
|
//App.MainDeviceAdapter.PrintStatus();
|
||||||
|
|
||||||
|
|
||||||
|
this.hwInterface.DisconnectPeripheral(this.peripheralInfo, () => {
|
||||||
|
//App.MainDeviceAdapter.PrintStatus();
|
||||||
|
|
||||||
|
this.State = DeviceState.Disconnected;
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void ServicesDiscoveredAction(BleWinHwInterface hwInterface, BlePeripheralInfo sender, BleResponse<List<BleServiceInfo>> response)
|
||||||
|
{
|
||||||
|
//Debug.Log("搜索service");
|
||||||
|
if(!response.IsSuccess || !response.Data.Any())
|
||||||
|
{
|
||||||
|
this.Disconnect();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.CreateServices(response.Data);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void CreateServices(List<BleServiceInfo> discoveredServices);
|
||||||
|
//private void CreateServices(List<BleServiceInfo> discoveredServices)
|
||||||
|
//{
|
||||||
|
// foreach (var item in discoveredServices)
|
||||||
|
// {
|
||||||
|
//BleService service = null;
|
||||||
|
//if (item.MatchGuid(ServiceUuids.Services.Single(s => s.IdByteArray == ServiceUuids.DeviceInformation).IdGuid))
|
||||||
|
//{
|
||||||
|
// Debug.Log("device infomation");
|
||||||
|
//}
|
||||||
|
//else if (item.MatchGuid(ServiceUuids.Services.Single(s => s.IdByteArray == ServiceUuids.Battery).IdGuid))
|
||||||
|
//{
|
||||||
|
// Debug.Log("battery");
|
||||||
|
// //service = new BatteryService(item, this.hwInterface);
|
||||||
|
//}
|
||||||
|
//else if (item.MatchGuid(ServiceUuids.Get(ServiceUuids.HeartRate).IdGuid))
|
||||||
|
//{
|
||||||
|
// Debug.Log("发现 heartRate 服务");
|
||||||
|
// service = new HeartRateService(item, this.hwInterface);
|
||||||
|
//}
|
||||||
|
//else if (item.MatchGuid(ServiceUuids.Get(ServiceUuids.CyclingSpeedCadence).IdGuid))
|
||||||
|
//{
|
||||||
|
// //service = new CyclingSpeedCadence.CyclingSpeedCadenceService(item, this.hwInterface);
|
||||||
|
//}
|
||||||
|
//else if (item.MatchGuid(ServiceUuids.Get(ServiceUuids.CyclingPower).IdGuid))
|
||||||
|
//{
|
||||||
|
// Debug.Log("cycling power");
|
||||||
|
// this.CreateCyclingPowerService(item);
|
||||||
|
//}
|
||||||
|
//else if (item.MatchGuid(ServiceUuids.Services.Single(s => s.IdByteArray == ServiceUuids.Ftms).IdGuid))
|
||||||
|
//{
|
||||||
|
// Debug.Log("ftms");
|
||||||
|
// this.CreateFtmsService(item);
|
||||||
|
//}
|
||||||
|
//else if (item.MatchGuid(ServiceUuids.Services.Single(s => s.IdByteArray == ServiceUuids.TacxBle).IdGuid))
|
||||||
|
//{
|
||||||
|
// Debug.Log("tacx ble");
|
||||||
|
// //service = new TacxFecService(item, this.hwInterface);
|
||||||
|
//}
|
||||||
|
//this.AddService(service, null);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
protected bool CheckPendingServiceCharacteristicsResponse(BleServiceInfo serviceInfo, BleResponse bleResponse)
|
||||||
|
{
|
||||||
|
if (bleResponse.IsSuccess)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//this.pendingServices.Remove(serviceInfo);
|
||||||
|
this.CheckAndSetConnectionStatus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendCommand()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckAndSetConnectionStatus()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BluetoothStateChangedEvent(BleWinHwInterface hwInterface, BleState state)
|
||||||
|
{
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case BleState.Unknown:
|
||||||
|
break;
|
||||||
|
case BleState.Unavailable:
|
||||||
|
break;
|
||||||
|
case BleState.Unauthorize:
|
||||||
|
break;
|
||||||
|
case BleState.Reseting:
|
||||||
|
break;
|
||||||
|
case BleState.Off:
|
||||||
|
this.Disconnect();
|
||||||
|
break;
|
||||||
|
case BleState.On:
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Connect()
|
||||||
|
{
|
||||||
|
this.ConnectToPeripheralIfPossible();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Disconnect(bool save = true)
|
||||||
|
{
|
||||||
|
//throw new NotImplementedException();
|
||||||
|
//this.hwInterface.DisconnectPeripheral(this.peripheralInfo, null);
|
||||||
|
this.Disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if(this.State == DeviceState.Connected)
|
||||||
|
{
|
||||||
|
this.Disconnect();
|
||||||
|
}
|
||||||
|
this.services.Clear();
|
||||||
|
this.pendingServices.Clear();
|
||||||
|
this.Characteristics.Clear();
|
||||||
|
|
||||||
|
this.hwInterface.BluetoothStateChangedEvent -= BluetoothStateChangedEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b14e74cc46a1e184ea96a01f17bb4e3a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
using Assets.Scripts.Ble;
|
||||||
|
using Assets.Scripts.Ble.Service;
|
||||||
|
using Assets.Scripts.Devices.Ble.Devices;
|
||||||
|
using Assets.Scripts.UI.Prefab.Device;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices.Ble
|
||||||
|
{
|
||||||
|
public class BleDeviceAdapter : DeviceAdapter
|
||||||
|
{
|
||||||
|
public override ConnectionInterface Interface => ConnectionInterface.BLE;
|
||||||
|
|
||||||
|
private IDictionary<string, BleDevice> discoveredDevices = new Dictionary<string, BleDevice>();
|
||||||
|
|
||||||
|
private BleWinHwInterface hwInterface;
|
||||||
|
public BleDeviceAdapter()
|
||||||
|
{
|
||||||
|
hwInterface = BleWinHwInterface.GetInterface();
|
||||||
|
|
||||||
|
hwInterface.BluetoothStateChangedEvent += HwInterface_BluetoothStateChangedEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HwInterface_BluetoothStateChangedEvent(BleWinHwInterface hwInterface, BleState bleState)
|
||||||
|
{
|
||||||
|
//Debug.Log("22222222222222" + bleState);
|
||||||
|
if(bleState == BleState.Off)
|
||||||
|
{
|
||||||
|
discoveredDevices.Clear();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.StartScan();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<AbstractDevice> GetDevices()
|
||||||
|
{
|
||||||
|
//throw new NotImplementedException();
|
||||||
|
return discoveredDevices.Select(d => d.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override DeviceAdapterState GetState()
|
||||||
|
{
|
||||||
|
if(hwInterface.BleState == BleState.On)
|
||||||
|
{
|
||||||
|
return DeviceAdapterState.On;
|
||||||
|
}
|
||||||
|
return DeviceAdapterState.Unavailable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void StartScan()
|
||||||
|
{
|
||||||
|
hwInterface.StartScan((device) =>
|
||||||
|
{
|
||||||
|
if (!discoveredDevices.ContainsKey(device.Peripheral.Address))
|
||||||
|
{
|
||||||
|
Debug.Log($"发现设备{ device.Peripheral.Address }, \t\tName:{ device.Peripheral.Name }, type:{ device.SensorType }");
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(device.Peripheral.Name))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(device.SensorType == Ant.SensorType.Trainer)
|
||||||
|
{
|
||||||
|
//var device1 = new Ftms(device.Peripheral, hwInterface);
|
||||||
|
//discoveredDevices.Add(device.Peripheral.Address, device1);
|
||||||
|
|
||||||
|
var device1 = new Tacx(device.Peripheral, hwInterface);
|
||||||
|
discoveredDevices.Add(device.Peripheral.Address, device1);
|
||||||
|
}
|
||||||
|
else if(device.SensorType == Ant.SensorType.HeartRate)
|
||||||
|
{
|
||||||
|
var device1 = new HeartRate(device.Peripheral, hwInterface);
|
||||||
|
discoveredDevices.Add(device.Peripheral.Address, device1);
|
||||||
|
}
|
||||||
|
else if(device.SensorType == Ant.SensorType.Power)
|
||||||
|
{
|
||||||
|
var device1 = new CyclingPower(device.Peripheral, hwInterface);
|
||||||
|
discoveredDevices.Add(device.Peripheral.Address, device1);
|
||||||
|
}
|
||||||
|
else if(device.SensorType == Ant.SensorType.SpeedCadence)
|
||||||
|
{
|
||||||
|
var device1 = new SpeedCadence(device.Peripheral, hwInterface);
|
||||||
|
discoveredDevices.Add(device.Peripheral.Address, device1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var device111 = discoveredDevices.Last().Value;
|
||||||
|
if (device111 != null && device111.State == Ant.DeviceState.Disconnected)
|
||||||
|
{
|
||||||
|
if (DeviceCache.Exist(device111))
|
||||||
|
{
|
||||||
|
//TODO:取消注释,自动连接设备
|
||||||
|
//Debug.Log("自动连接" + device111.Id);
|
||||||
|
device111.Connect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//discoveredDevices.Add(device.Peripheral.Address, new BleDevice(device.Peripheral, hwInterface, device.SensorType));
|
||||||
|
|
||||||
|
}
|
||||||
|
if (discoveredDevices.ContainsKey(device.Peripheral.Address))
|
||||||
|
{
|
||||||
|
discoveredDevices[device.Peripheral.Address].SignalStrength = device.Rssi;
|
||||||
|
//Debug.Log($"设备{ device.Peripheral.Name }信号量:{ device.Rssi }");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void StopScan()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
this.ReleaseDevices();
|
||||||
|
hwInterface.Dispose();
|
||||||
|
base.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReleaseDevices()
|
||||||
|
{
|
||||||
|
foreach (var item in discoveredDevices)
|
||||||
|
{
|
||||||
|
item.Value.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清除未连接的设备
|
||||||
|
/// </summary>
|
||||||
|
public void ClearDevice(string address)
|
||||||
|
{
|
||||||
|
var list = discoveredDevices.ToList();
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
if(item.Value.State == Ant.DeviceState.Disconnected)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(address) && item.Key != address)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
hwInterface.pCache.Remove(item.Key);
|
||||||
|
item.Value.Dispose();
|
||||||
|
discoveredDevices.Remove(item.Key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 21c2c84c243633f4ba4403b51c0272c9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices.Ble
|
||||||
|
{
|
||||||
|
public class BleHwInterfaceError
|
||||||
|
{
|
||||||
|
public int? Code { get; }
|
||||||
|
|
||||||
|
// Token: 0x170005C4 RID: 1476
|
||||||
|
// (get) Token: 0x06001FEE RID: 8174 RVA: 0x00085E0B File Offset: 0x0008400B
|
||||||
|
public string Domain { get; }
|
||||||
|
|
||||||
|
// Token: 0x170005C5 RID: 1477
|
||||||
|
// (get) Token: 0x06001FEF RID: 8175 RVA: 0x00085E13 File Offset: 0x00084013
|
||||||
|
public string Description { get; }
|
||||||
|
|
||||||
|
// Token: 0x06001FF0 RID: 8176 RVA: 0x00085E1B File Offset: 0x0008401B
|
||||||
|
public BleHwInterfaceError(int? code, string domain, string description)
|
||||||
|
{
|
||||||
|
this.Code = code;
|
||||||
|
this.Domain = domain;
|
||||||
|
this.Description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FF1 RID: 8177 RVA: 0x00085E38 File Offset: 0x00084038
|
||||||
|
public BleHwInterfaceError(string description) : this(null, null, description)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FF2 RID: 8178 RVA: 0x00085E58 File Offset: 0x00084058
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
int? code = this.Code;
|
||||||
|
if (code != null && this.Domain == "WclBleGattClientErrorDomain")
|
||||||
|
{
|
||||||
|
string str = "BleHWPluginError:\n";
|
||||||
|
code = this.Code;
|
||||||
|
return str + ((code != null) ? code.GetValueOrDefault().ToString() : null) + "\n-Description: " + this.Description;
|
||||||
|
}
|
||||||
|
code = this.Code;
|
||||||
|
if (code != null && this.Domain != null)
|
||||||
|
{
|
||||||
|
return string.Format("BleHWPluginError:\n-Domain: {0}\n-Code: {1}\n-Description: {2}", this.Domain, this.Code, this.Description);
|
||||||
|
}
|
||||||
|
return "BleHWPluginError:-Description: " + this.Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FF3 RID: 8179 RVA: 0x00085F08 File Offset: 0x00084108
|
||||||
|
public static BleHwInterfaceError ParseFromString(string message)
|
||||||
|
{
|
||||||
|
string[] array = (message != null) ? message.Split(new char[]
|
||||||
|
{
|
||||||
|
'|'
|
||||||
|
}, 3, StringSplitOptions.RemoveEmptyEntries) : null;
|
||||||
|
if (array == null || array.Length == 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int value;
|
||||||
|
if (array.Length == 3 && int.TryParse(array[1], out value))
|
||||||
|
{
|
||||||
|
return new BleHwInterfaceError(new int?(value), array[0], array[2]);
|
||||||
|
}
|
||||||
|
return new BleHwInterfaceError(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FF4 RID: 8180 RVA: 0x00085F64 File Offset: 0x00084164
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return (this.Code.GetHashCode() * 397 ^ ((this.Domain != null) ? this.Domain.GetHashCode() : 0)) * 397 ^ ((this.Description != null) ? this.Description.GetHashCode() : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 58ab8c2cfa7e96e43b69bb7e0e7e10c3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices.Ble
|
||||||
|
{
|
||||||
|
public abstract class BlePeripheralInfo
|
||||||
|
{
|
||||||
|
// Token: 0x170005C6 RID: 1478
|
||||||
|
// (get) Token: 0x06001FF5 RID: 8181 RVA: 0x00085FBF File Offset: 0x000841BF
|
||||||
|
// (set) Token: 0x06001FF6 RID: 8182 RVA: 0x00085FC7 File Offset: 0x000841C7
|
||||||
|
public string Name { get; protected set; }
|
||||||
|
|
||||||
|
// Token: 0x170005C7 RID: 1479
|
||||||
|
// (get) Token: 0x06001FF7 RID: 8183 RVA: 0x00085FD0 File Offset: 0x000841D0
|
||||||
|
public string Address { get; }
|
||||||
|
|
||||||
|
// Token: 0x06001FF8 RID: 8184 RVA: 0x00085FD8 File Offset: 0x000841D8
|
||||||
|
protected BlePeripheralInfo(string address, string name)
|
||||||
|
{
|
||||||
|
this.Address = address;
|
||||||
|
this.Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FF9 RID: 8185 RVA: 0x00085FEE File Offset: 0x000841EE
|
||||||
|
public bool MatchAddress(string address)
|
||||||
|
{
|
||||||
|
return address != null && address.Equals(this.Address);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FFA RID: 8186 RVA: 0x00086001 File Offset: 0x00084201
|
||||||
|
public override bool Equals(object other)
|
||||||
|
{
|
||||||
|
return other != null && base.GetType() == other.GetType() && this.Address.Equals(((BlePeripheralInfo)other).Address);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FFB RID: 8187 RVA: 0x00086031 File Offset: 0x00084231
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return this.Address.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06001FFC RID: 8188 RVA: 0x00086040 File Offset: 0x00084240
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Concat(new string[]
|
||||||
|
{
|
||||||
|
base.GetType().Name,
|
||||||
|
": ",
|
||||||
|
string.IsNullOrEmpty(this.Name) ? "" : (this.Name + " "),
|
||||||
|
"[",
|
||||||
|
this.Address,
|
||||||
|
"]"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 006773ea103cc3042a0b5e2f815a24eb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Devices.Ble
|
||||||
|
{
|
||||||
|
public class BleResponse
|
||||||
|
{
|
||||||
|
// Token: 0x170005C8 RID: 1480
|
||||||
|
// (get) Token: 0x06001FFD RID: 8189 RVA: 0x000860AE File Offset: 0x000842AE
|
||||||
|
// (set) Token: 0x06001FFE RID: 8190 RVA: 0x000860B6 File Offset: 0x000842B6
|
||||||
|
public bool IsSuccess { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x170005C9 RID: 1481
|
||||||
|
// (get) Token: 0x06001FFF RID: 8191 RVA: 0x000860BF File Offset: 0x000842BF
|
||||||
|
// (set) Token: 0x06002000 RID: 8192 RVA: 0x000860C7 File Offset: 0x000842C7
|
||||||
|
public BleHwInterfaceError Error { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x06002001 RID: 8193 RVA: 0x000860D0 File Offset: 0x000842D0
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return (this.IsSuccess ? "Success" : "Fail") + "\n" + ((this.Error == null) ? "" : this.Error.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BleResponse<T> : BleResponse
|
||||||
|
{
|
||||||
|
// Token: 0x170005CA RID: 1482
|
||||||
|
// (get) Token: 0x06002003 RID: 8195 RVA: 0x00086112 File Offset: 0x00084312
|
||||||
|
// (set) Token: 0x06002004 RID: 8196 RVA: 0x0008611A File Offset: 0x0008431A
|
||||||
|
public T Data { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x06002005 RID: 8197 RVA: 0x00086123 File Offset: 0x00084323
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return base.ToString() + "\n" + this.Data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||