视角切换&小地图模糊问题解决
This commit is contained in:
parent
9bc3864790
commit
e4d4333357
3
.gitignore
vendored
3
.gitignore
vendored
@ -86,3 +86,6 @@ Assets/Devices.txt
|
||||
Assets/Devices.txt.meta
|
||||
Assets/StreamingAssets.meta
|
||||
Assets/Resources/Sound.meta
|
||||
Assets/MapWorkoutRecords
|
||||
Assets/Mapbox/User
|
||||
Assets/Mapbox/User.meta
|
||||
|
||||
@ -9,8 +9,8 @@ Material:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: 3dGraph1
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
m_ShaderKeywords: _EMISSION
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@ -68,7 +68,9 @@ Material:
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.402
|
||||
- _GlossyReflections: 1
|
||||
- _InvFade: 1.98
|
||||
- _Metallic: 0.55
|
||||
- _Mode: 0
|
||||
@ -76,6 +78,8 @@ Material:
|
||||
- _OcclusionStrength: 1
|
||||
- _Outline: 4
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SquashAmount: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
|
||||
@ -13,7 +13,7 @@ Material:
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
|
||||
@ -56,10 +56,10 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _Angle: 180
|
||||
- _Angle: 90
|
||||
- _BumpScale: 1
|
||||
- _ChartTiling: 1
|
||||
- _ColorMask: 15
|
||||
- _ChartTiling: 2
|
||||
- _ColorMask: 122
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
@ -83,6 +83,6 @@ Material:
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
- _ColorFrom: {r: 0.40101328, g: 0.33304498, b: 0.8088235, a: 1}
|
||||
- _ColorTo: {r: 0.6039216, g: 0.5882353, b: 0.7137255, a: 1}
|
||||
- _Combine: {r: 1, g: 1, b: 1, a: 0}
|
||||
- _ColorTo: {r: 0.4, g: 0.33333334, b: 0.80784315, a: 1}
|
||||
- _Combine: {r: 0.4, g: 0.33333334, b: 0.80784315, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
||||
@ -144,7 +144,8 @@
|
||||
#if !ENABLE_WINMD_SUPPORT
|
||||
[Description("Turn off image rendering.")]
|
||||
#endif
|
||||
None
|
||||
None,
|
||||
JuzeTest,
|
||||
}
|
||||
|
||||
public enum ElevationSourceType
|
||||
|
||||
@ -155,16 +155,15 @@ namespace Mapbox.Unity.Map
|
||||
public virtual void SetLayerSource(ImagerySourceType imageSource)
|
||||
{
|
||||
//if (imageSource != ImagerySourceType.Custom && imageSource != ImagerySourceType.None)
|
||||
if (imageSource != ImagerySourceType.None)
|
||||
{
|
||||
_layerProperty.sourceType = imageSource;
|
||||
_layerProperty.sourceOptions.layerSource = MapboxDefaultImagery.GetParameters(imageSource);
|
||||
_layerProperty.HasChanged = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Invalid style - trying to set " + imageSource.ToString() + " as default style!");
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// Debug.LogWarning("Invalid style - trying to set " + imageSource.ToString() + " as default style!");
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -73,6 +73,14 @@
|
||||
Name = "juzetest"
|
||||
};
|
||||
break;
|
||||
case ImagerySourceType.JuzeTest:
|
||||
//throw new Exception("Invalid type : None");
|
||||
defaultStyle = new Style
|
||||
{
|
||||
Id = "mapbox://styles/juzetest/ckmkdjwsa1nvt17nr1ps4fqgs",
|
||||
Name = "juzetest"
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
BIN
Assets/Resources/Images/Ride/p-180.png
Normal file
BIN
Assets/Resources/Images/Ride/p-180.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
104
Assets/Resources/Images/Ride/p-180.png.meta
Normal file
104
Assets/Resources/Images/Ride/p-180.png.meta
Normal file
@ -0,0 +1,104 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f05d75ce4fddbb4785a5a8fa4f14a8e
|
||||
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:
|
||||
100
Assets/Resources/UI/Material/1.mat
Normal file
100
Assets/Resources/UI/Material/1.mat
Normal file
@ -0,0 +1,100 @@
|
||||
%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: 1
|
||||
m_Shader: {fileID: 4800000, guid: 818b0e872599e3948b6cceff71a30540, type: 3}
|
||||
m_ShaderKeywords: _EMISSION
|
||||
m_LightmapFlags: 1
|
||||
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: 2800000, guid: 9959c8d64e68c9b49a96dd9de08c4315, 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}
|
||||
- _Ramp:
|
||||
m_Texture: {fileID: 2800000, guid: a4cdca73d61814d33ac1587f6c163bca, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ToonShade:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _Angle: 180
|
||||
- _BumpScale: 1
|
||||
- _ChartTiling: 1
|
||||
- _ColorMask: 15
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Outline: 0.005
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 0
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _Tiling: 1
|
||||
- _UVSec: 0
|
||||
- _UseUIAlphaClip: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
- _ColorFrom: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _ColorTo: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Combine: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
8
Assets/Resources/UI/Material/1.mat.meta
Normal file
8
Assets/Resources/UI/Material/1.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b2c3ec79f30fdd4e9e9ac4481857217
|
||||
timeCreated: 1500387811
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -9,8 +9,8 @@ Material:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: 3dGraph2
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
m_ShaderKeywords: _EMISSION _SPECULARHIGHLIGHTS_OFF
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
@ -68,24 +68,28 @@ Material:
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _Glossiness: 0.318
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 1
|
||||
- _GlossyReflections: 1
|
||||
- _InvFade: 1.98
|
||||
- _Metallic: 0.638
|
||||
- _Metallic: 1
|
||||
- _Mode: 0
|
||||
- _Occlusion: 7.5
|
||||
- _OcclusionStrength: 1
|
||||
- _Outline: 4
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 0
|
||||
- _SquashAmount: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 0.96862745, b: 0, a: 1}
|
||||
- _Color: {r: 0.9764706, g: 0.1882353, b: 0.5254902, a: 0.6509804}
|
||||
- _ColorFrom: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _ColorTo: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Combine: {r: 1, g: 1, b: 1, a: 0}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0.8392157, g: 0.14117648, b: 0.35686275, a: 1}
|
||||
- _TintColor: {r: 1, g: 0.93103445, b: 0, a: 0.5}
|
||||
- _TreeInstanceColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _TreeInstanceScale: {r: 1, g: 1, b: 1, a: 1}
|
||||
75
Assets/Resources/UI/Material/MarkerLine.mat
Normal file
75
Assets/Resources/UI/Material/MarkerLine.mat
Normal file
@ -0,0 +1,75 @@
|
||||
%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: MarkerLine
|
||||
m_Shader: {fileID: 4800000, guid: f5ca8a076e12c48748baa7e9f234a942, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
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}
|
||||
- _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
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _Glossiness: 0.5
|
||||
- _InvFade: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 0.9764706, g: 0.1882353, b: 0.5254902, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||
8
Assets/Resources/UI/Material/MarkerLine.mat.meta
Normal file
8
Assets/Resources/UI/Material/MarkerLine.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1fe5e21d64c6f349bd8c8c4d928b247
|
||||
timeCreated: 1442434459
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
79
Assets/Resources/UI/Material/color7.mat
Normal file
79
Assets/Resources/UI/Material/color7.mat
Normal file
@ -0,0 +1,79 @@
|
||||
%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: color7
|
||||
m_Shader: {fileID: 4800000, guid: 0a799adfcb28a1847873696ef5d3c504, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
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}
|
||||
- _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
|
||||
- _Glossiness: 0.5
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SrcBlend: 1
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 8
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 0.97647065, g: 0.18823531, b: 0.5254902, a: 0.6509804}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
8
Assets/Resources/UI/Material/color7.mat.meta
Normal file
8
Assets/Resources/UI/Material/color7.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87d787edd0ab7fe4dbeb26e9db2f49cc
|
||||
timeCreated: 1560624561
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
79
Assets/Resources/UI/Material/color8.mat
Normal file
79
Assets/Resources/UI/Material/color8.mat
Normal file
@ -0,0 +1,79 @@
|
||||
%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: color8
|
||||
m_Shader: {fileID: 4800000, guid: 0a799adfcb28a1847873696ef5d3c504, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
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}
|
||||
- _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
|
||||
- _Glossiness: 0.5
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SrcBlend: 1
|
||||
- _Stencil: 0
|
||||
- _StencilComp: 8
|
||||
- _StencilOp: 0
|
||||
- _StencilReadMask: 255
|
||||
- _StencilWriteMask: 255
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 0.6509804}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
8
Assets/Resources/UI/Material/color8.mat.meta
Normal file
8
Assets/Resources/UI/Material/color8.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 719765d92bad0da418f4726c84048dab
|
||||
timeCreated: 1560624561
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -30,7 +30,7 @@ Transform:
|
||||
m_GameObject: {fileID: 3777003654129381334}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 35, y: 25, z: 22}
|
||||
m_LocalScale: {x: 15, y: 15, z: 15}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
|
||||
37
Assets/Scenes/Ride/New Render Texture.renderTexture
Normal file
37
Assets/Scenes/Ride/New Render Texture.renderTexture
Normal file
@ -0,0 +1,37 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!84 &8400000
|
||||
RenderTexture:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: New Render Texture
|
||||
m_ImageContentsHash:
|
||||
serializedVersion: 2
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_ForcedFallbackFormat: 4
|
||||
m_DownscaleFallback: 0
|
||||
serializedVersion: 3
|
||||
m_Width: 256
|
||||
m_Height: 256
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthFormat: 2
|
||||
m_ColorFormat: 8
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
m_SRGB: 0
|
||||
m_UseDynamicScale: 0
|
||||
m_BindMS: 0
|
||||
m_EnableCompatibleFormat: 1
|
||||
m_TextureSettings:
|
||||
serializedVersion: 2
|
||||
m_FilterMode: 1
|
||||
m_Aniso: 0
|
||||
m_MipBias: 0
|
||||
m_WrapU: 1
|
||||
m_WrapV: 1
|
||||
m_WrapW: 1
|
||||
m_Dimension: 2
|
||||
m_VolumeDepth: 1
|
||||
8
Assets/Scenes/Ride/New Render Texture.renderTexture.meta
Normal file
8
Assets/Scenes/Ride/New Render Texture.renderTexture.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83f968668355a044584843a4bf7d592d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 8400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@ -26,7 +26,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//AbstractMap map;
|
||||
|
||||
#region 动画控制参数
|
||||
Vector3 nextPos;
|
||||
public Vector3 nextPos;
|
||||
Vector3 prePos = Vector3.zero;
|
||||
float timer = 1.0f;//计时器
|
||||
#endregion
|
||||
@ -124,6 +124,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
characterAnimator.SetBool("ReachEnd", true);//到达终点
|
||||
}
|
||||
}
|
||||
|
||||
//开始骑行
|
||||
if (mainController.isStart)
|
||||
{
|
||||
@ -154,7 +155,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//数据处理
|
||||
|
||||
nextPos = map.GeoToWorldPosition(currentlatlong);//下一个点
|
||||
nextPos.y += 1f;//提高y轴让人物站在地图上面
|
||||
nextPos.y += 1.15f;//提高y轴让人物站在地图上面
|
||||
prePos = transform.localPosition;//当前点
|
||||
thisRotation = transform.localRotation;
|
||||
//移动动画控制
|
||||
@ -224,6 +225,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
nextSlopeDistance = sumDistance - totalDistance * 1000;
|
||||
NextSlopeTotalDistance = pointList[nextIndex].Distance;
|
||||
currentSlopeDistance = CurrentDistance-( totalDistance * 1000 - (sumDistance - pointList[index].Distance));
|
||||
//人物初始化角度控制
|
||||
|
||||
}
|
||||
public double PreElevation;
|
||||
@ -234,6 +236,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#region 人物移动与转向控制
|
||||
|
||||
Quaternion thisRotation;
|
||||
public Quaternion currentRotation;
|
||||
IEnumerator LookAtNextPos()
|
||||
{
|
||||
Quaternion neededRotation = Quaternion.LookRotation(prePos - nextPos);
|
||||
@ -243,8 +246,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
while (t < 1.0f)
|
||||
{
|
||||
t += Time.deltaTime / 0.5f;
|
||||
var rotationValue = Quaternion.Slerp(thisRotation, neededRotation, t);
|
||||
character.transform.rotation = Quaternion.Euler(0, rotationValue.eulerAngles.y, 0);
|
||||
currentRotation = Quaternion.Slerp(thisRotation, neededRotation, t);
|
||||
character.transform.rotation = Quaternion.Euler(0, currentRotation.eulerAngles.y, 0);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
@ -257,6 +260,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Camera.main.transform.position = Vector3.Lerp(Camera.main.transform.position, Camera.main.transform.position + deltaPos, Time.time);
|
||||
previousPos = transform.position;
|
||||
}
|
||||
public Vector3 currentPos = new Vector3(0,0,0);
|
||||
//人物移动控制
|
||||
IEnumerator MoveTo()
|
||||
{
|
||||
@ -271,6 +275,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Vector3 nextPosition = new Vector3((float)Math.Round(v.x, 2), (float)Math.Round(v.y, 2), (float)Math.Round(v.z, 2));
|
||||
if (!nextPosition.Equals(transform.localPosition))
|
||||
{
|
||||
currentPos = nextPosition;
|
||||
transform.localPosition = nextPosition;
|
||||
//Camera.main.transform.localPosition = nextPosition;
|
||||
}
|
||||
|
||||
@ -71,10 +71,13 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
resultPanel = transform.Find("SingleUI/Panel/ResultPanel").gameObject;
|
||||
}
|
||||
|
||||
Transform target;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
UIManager.Instance.MainPanel = this.transform.Find("SingleUI/Panel").GetComponent<PFUIPanel>();
|
||||
UIManager.Instance.ModalsPanel = this.transform.Find("SingleUI/ModalPanel").GetComponent<PFUIPanel>();
|
||||
target = transform.Find("Target");
|
||||
//进入倒计时
|
||||
singleUIManager = UIObject.GetComponent<SingleUIManager>();
|
||||
loadingController = FindObjectOfType<LoadingController>();
|
||||
@ -203,18 +206,28 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
break;
|
||||
}
|
||||
AutoStart();
|
||||
|
||||
InitPlayer();
|
||||
}
|
||||
//初始化人物位置角度
|
||||
private void InitPlayer()
|
||||
{
|
||||
lockView = true;
|
||||
if (recorderData != null)
|
||||
{
|
||||
var lastLatLon = Along(recorderData.EndDistance);
|
||||
player.transform.position = map.GeoToWorldPosition(lastLatLon);
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastLatLon = Along(0);
|
||||
player.transform.position = map.GeoToWorldPosition(lastLatLon);
|
||||
}
|
||||
TrailRenderer trail = player.GetComponent<TrailRenderer>();
|
||||
PlayerController playerController = player.GetComponent<PlayerController>();
|
||||
Vector2d lastLatLon = Along(recorderData.EndDistance);
|
||||
Vector3 currentPos = map.GeoToWorldPosition(lastLatLon);
|
||||
currentPos.y += 1f;
|
||||
player.transform.position = currentPos;
|
||||
playerController.currentPos = currentPos;
|
||||
|
||||
trail.Clear();
|
||||
Vector2d nextLatLon = Along(recorderData.EndDistance + 0.1);
|
||||
//设定人物方向
|
||||
var s = map.GeoToWorldPosition(lastLatLon);
|
||||
var e = map.GeoToWorldPosition(nextLatLon);
|
||||
Quaternion neededRotation = Quaternion.LookRotation(s - e);
|
||||
player.transform.rotation = Quaternion.Euler(0, neededRotation.eulerAngles.y, 0);
|
||||
playerController.currentRotation = neededRotation;
|
||||
}
|
||||
SingleUIManager singleUIManager;
|
||||
public void AutoStart()
|
||||
@ -231,32 +244,45 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
public bool Is3dView;
|
||||
public void ChangeMapImageStyle(GameObject arrowGameObj)
|
||||
{
|
||||
|
||||
var playerController = player.GetComponent<PlayerController>();
|
||||
var trailRenderer = player.GetComponent<TrailRenderer>();
|
||||
trailRenderer.time = 0;
|
||||
StartCoroutine(EnableTrailRenderer(trailRenderer));
|
||||
if (!Is3dView)
|
||||
{
|
||||
//地图属性变更
|
||||
map.Terrain.ExaggerationFactor = 1.5f;
|
||||
map.Terrain.SetElevationType(ElevationLayerType.TerrainWithElevation);
|
||||
map.ImageLayer.SetLayerSource(ImagerySourceType.Custom);
|
||||
//map.SetTileMaterial(new Material());
|
||||
Is3dView = true;
|
||||
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
||||
//人物属性变更
|
||||
var pos = map.GeoToWorldPosition(playerController.Currentlatlong);
|
||||
playerController.currentPos = pos;
|
||||
target.position = pos;
|
||||
player.transform.localScale = new Vector3(3f, 3f, 3f);
|
||||
player.transform.position = pos;
|
||||
|
||||
arrowGameObj.SetActive(false);
|
||||
Is3dView = true;
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// map.Terrain.ExaggerationFactor = 0f;
|
||||
// map.Terrain.SetElevationType(ElevationLayerType.FlatTerrain);
|
||||
// map.ImageLayer.SetLayerSource(ImagerySourceType.None);
|
||||
// player.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
|
||||
else
|
||||
{
|
||||
//地图属性变更
|
||||
map.ImageLayer.SetLayerSource(ImagerySourceType.JuzeTest);
|
||||
map.Terrain.ExaggerationFactor = 0f;
|
||||
map.Terrain.SetElevationType(ElevationLayerType.FlatTerrain);
|
||||
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
||||
//人物属性变更
|
||||
var pos = map.GeoToWorldPosition(playerController.Currentlatlong);
|
||||
player.transform.position = pos;
|
||||
player.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
|
||||
target.position = pos;
|
||||
playerController.currentPos = Vector3.zero;
|
||||
|
||||
// var playerController = player.GetComponent<PlayerController>();
|
||||
// player.transform.position = map.GeoToWorldPosition(playerController.Currentlatlong);
|
||||
|
||||
// var trailRenderer = player.GetComponent<TrailRenderer>();
|
||||
// trailRenderer.time = 0;
|
||||
// StartCoroutine(EnableTrailRenderer(trailRenderer));
|
||||
// Is3dView = false;
|
||||
// arrowGameObj.SetActive(true);
|
||||
//}
|
||||
arrowGameObj.SetActive(true);
|
||||
Is3dView = false;
|
||||
}
|
||||
}
|
||||
private bool lockView = false;
|
||||
private void Map_OnTileFinished(Mapbox.Unity.MeshGeneration.Data.UnityTile obj)
|
||||
@ -270,15 +296,22 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
if (recorderData != null)
|
||||
{
|
||||
var lastLatLon = Along(recorderData.EndDistance);
|
||||
var nextLatLon = Along(recorderData.EndDistance+0.1);
|
||||
player.transform.position = map.GeoToWorldPosition(lastLatLon);
|
||||
//设定人物方向
|
||||
var s = map.GeoToWorldPosition(lastLatLon);
|
||||
var e = map.GeoToWorldPosition(nextLatLon);
|
||||
Quaternion neededRotation = Quaternion.LookRotation(s - e);
|
||||
player.transform.rotation = Quaternion.Euler(0, neededRotation.eulerAngles.y, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator EnableTrailRenderer(TrailRenderer trailRenderer)
|
||||
{
|
||||
yield return new WaitForSeconds(1f);
|
||||
trailRenderer.time = 10;
|
||||
yield return new WaitForSeconds(2f);
|
||||
trailRenderer.Clear();
|
||||
trailRenderer.time = 30;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -287,7 +320,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//开始骑行
|
||||
public void SetStart()
|
||||
{
|
||||
if (!isPause)
|
||||
if (!isPause || DateTime.MinValue == startTime)
|
||||
{
|
||||
isStart = true;
|
||||
startTime = DateTime.Now;
|
||||
|
||||
@ -98,9 +98,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var screenWidth = UnityEngine.Screen.width;
|
||||
var screenHeight = UnityEngine.Screen.height;
|
||||
|
||||
var sw_world = _minicamera.ViewportToWorldPoint(new Vector3(0, 0, 90));
|
||||
var sw_world = _minicamera.ViewportToWorldPoint(new Vector3(0.2f, 0.2f, 180));
|
||||
var sw = _map.WorldToGeoPosition(sw_world);
|
||||
var ne_world = _minicamera.ViewportToWorldPoint(new Vector3(1f, 1f, 90));
|
||||
var ne_world = _minicamera.ViewportToWorldPoint(new Vector3(0.955f, 0.955f, 180));
|
||||
var ne = _map.WorldToGeoPosition(ne_world);
|
||||
|
||||
return new Vector2dBounds(new Vector2d(sw.x, sw.y), new Vector2d(ne.x, ne.y));
|
||||
@ -120,7 +120,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (mapData != null)
|
||||
{
|
||||
var count = mapData.List.Count;
|
||||
var interval = Math.Max(Math.Ceiling(count / 500D),1f);
|
||||
var interval = Math.Max(Math.Ceiling(count / 100D),1f);
|
||||
for (int i = 0; i < mapData.List.Count; i++)
|
||||
{
|
||||
if(i% interval == 0)
|
||||
@ -147,16 +147,17 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_mipMapRoute.transform.parent = transform;
|
||||
var lineRender = _mipMapRoute.AddComponent<LineRenderer>();
|
||||
|
||||
lineRender.material = Instantiate(Resources.Load<Material>("UI/Material/Round10"));
|
||||
lineRender.material = Instantiate(Resources.Load<Material>("UI/Material/1"));
|
||||
var dat = feat.Points[0];
|
||||
lineRender.endColor = Color.white;
|
||||
lineRender.startColor = Color.white;
|
||||
//设置宽度
|
||||
lineRender.startWidth = 8f;
|
||||
lineRender.endWidth = 8f;
|
||||
lineRender.startWidth = 10f;
|
||||
lineRender.endWidth = 10f;
|
||||
lineRender.positionCount = dat.Count;
|
||||
lineRender.SetPositions(feat.Points[0].ToArray());
|
||||
lineRender.numCornerVertices = 30;
|
||||
lineRender.numCornerVertices = 20;
|
||||
lineRender.numCapVertices = 20;
|
||||
lineRender.loop = false;
|
||||
_mipMapRoute.layer = 9;
|
||||
}
|
||||
|
||||
@ -28,12 +28,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
text.text = string.Format(format, totalDistance);
|
||||
index = currentIndex;
|
||||
mOldScore = (float)totalDistance;
|
||||
}
|
||||
else
|
||||
{
|
||||
mScoreSequence.Append(DOTween.To(delegate (float value)
|
||||
{
|
||||
if (value != newScore)
|
||||
//if (value != newScore)
|
||||
{
|
||||
temp = Math.Round(value, digit);
|
||||
//向Text组件赋值
|
||||
|
||||
@ -7,17 +7,21 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
public class PlayerController : AbstractPlayer
|
||||
{
|
||||
#region 骑行逻辑
|
||||
TrailRenderer trail;
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
base.Init();
|
||||
totalDistance = mainController.selectParamModel.EndDistance;
|
||||
currentlatlong = mainController.GetCenterCoordinate();
|
||||
TrailRenderer trail = FindObjectOfType<TrailRenderer>();
|
||||
trail = FindObjectOfType<TrailRenderer>();
|
||||
trail.startWidth = 1f;
|
||||
trail.endWidth = 1f;
|
||||
trail.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
||||
trail.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
||||
trail.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||
trail.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||
//var color7 = Resources.Load<Material>("UI/Material/color7");
|
||||
//var Graph2 = Resources.Load<Material>("UI/Material/3dGraph2");
|
||||
//trail.materials = new Material[] { color7};
|
||||
}
|
||||
TargetData targetData;
|
||||
/// <summary>
|
||||
@ -41,6 +45,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
speed = Helper.CalculateSpeed(elevation, currentSlope, power, weight, bicycleWeight);
|
||||
distance = mainController.UpdateDistance(speed);
|
||||
totalDistance += distance;
|
||||
|
||||
//preDistance EndDistance
|
||||
|
||||
if (!stopRecord)
|
||||
{
|
||||
//记录骑行数据
|
||||
@ -58,7 +65,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_Lon = currentlatlong.y,
|
||||
_TotalClimb = totalClimb,
|
||||
};
|
||||
|
||||
recorderData.PreDistance = TotalDistance-Distance;
|
||||
recorderData.EndDistance = TotalDistance;
|
||||
recorderData.RiderDatas.Add(targetData);
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Material _material;
|
||||
[SerializeField]
|
||||
[Range(1, 10)]
|
||||
private float UpdateFrequency = 1;
|
||||
private float UpdateFrequency = 0.1f;
|
||||
|
||||
private int _counter;
|
||||
|
||||
@ -31,6 +31,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
CyclingController cyclingCotroller;
|
||||
private bool initComplete = false;
|
||||
|
||||
private List<Vector3> vector3s = new List<Vector3>();
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
if (_map == null)
|
||||
@ -42,6 +44,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
|
||||
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if(!vector3s.Contains(playerController.currentPos))
|
||||
vector3s.Add(playerController.currentPos);
|
||||
}
|
||||
|
||||
private void _map_OnUpdated()
|
||||
@ -120,11 +127,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
decimal diffAbs = Math.Abs(diff);
|
||||
if (diffAbs <= 200)
|
||||
{
|
||||
if (!dat.Contains(item))
|
||||
dat.Add(item);
|
||||
}
|
||||
if (diff <= 0 && diff > -200)
|
||||
{
|
||||
item.y += 0.15f;
|
||||
if (!dat.Contains(item))
|
||||
path.Add(item);
|
||||
}
|
||||
}
|
||||
@ -191,7 +200,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_directionsGO = new GameObject("MapRoute");
|
||||
_directionsGO.transform.parent = transform;
|
||||
var lineRender = _directionsGO.AddComponent<LineRenderer>();
|
||||
lineRender.material = new Material(Shader.Find("Sprites/Default"));
|
||||
//lineRender.material = new Material(Shader.Find("Sprites/Default"));
|
||||
lineRender.material = Resources.Load<Material>("UI/Material/color8");
|
||||
var dat = feat.Points[0];
|
||||
ColorUtility.TryParseHtmlString("#FF2742", out Color c);
|
||||
lineRender.endColor = new Color(1,1,1,0.65f);
|
||||
@ -203,7 +213,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
lineRender.positionCount = dat.Count;
|
||||
lineRender.SetPositions(feat.Points[0].ToArray());
|
||||
lineRender.loop = false;
|
||||
//lineRender.numCapVertices = 10;
|
||||
lineRender.numCapVertices = 10;
|
||||
lineRender.numCornerVertices = 10;
|
||||
|
||||
|
||||
@ -218,8 +228,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_pathRoute = new GameObject("MapPathRoute");
|
||||
_pathRoute.transform.parent = transform;
|
||||
var lineRender = _pathRoute.AddComponent<LineRenderer>();
|
||||
lineRender.material = new Material(Shader.Find("Sprites/Default"));
|
||||
//lineRender.material = Resources.Load<Material>("UI/Material/lineStyle9");
|
||||
//lineRender.material = new Material(Shader.Find("Sprites/Default"));
|
||||
var color7 = Resources.Load<Material>("UI/Material/color7");
|
||||
var Graph2 = Resources.Load<Material>("UI/Material/3dGraph2");
|
||||
lineRender.materials = new Material[] { color7, Graph2 };
|
||||
lineRender.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
||||
lineRender.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
||||
|
||||
@ -228,8 +240,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
lineRender.endWidth = 1f;
|
||||
lineRender.positionCount = feat.Count;
|
||||
lineRender.SetPositions(feat.ToArray());
|
||||
//lineRender.loop = false;
|
||||
lineRender.numCapVertices = 10;
|
||||
lineRender.loop = false;
|
||||
//lineRender.numCapVertices = 10;
|
||||
lineRender.numCornerVertices = 10;
|
||||
//
|
||||
lineRender.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
||||
|
||||
@ -10,6 +10,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine.EventSystems;
|
||||
using ChartAndGraph;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@ -60,7 +61,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Button closeQuitButton;//退出panel关闭按钮
|
||||
|
||||
RawImage head;//海拔图头像
|
||||
RawImage miniMap;//小地图
|
||||
GameObject miniMap;//小地图
|
||||
RawImage altitudeGraph;//海拔图
|
||||
Image leftImage;
|
||||
Image rightImage;
|
||||
@ -97,6 +98,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
Image nextSlopeImage;
|
||||
Image currentSlopeImage;
|
||||
Image miniMapProcess;
|
||||
Text miniMapProcessText;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@ -131,7 +134,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
head = transform.Find("Panel/GraphChart/HeadPanel/Head").GetComponent<RawImage>();
|
||||
headPanel = transform.Find("Panel/GraphChart/HeadPanel").gameObject;
|
||||
t = transform.Find("Panel/GraphChart/Button");
|
||||
miniMap = transform.Find("Panel/MiniMap").GetComponent<RawImage>();
|
||||
miniMap = transform.Find("Panel/MiniMap").gameObject;
|
||||
|
||||
alertPanel = transform.Find("Panel/Alert").gameObject;
|
||||
|
||||
@ -176,6 +179,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
straightSmall = Resources.Load<Sprite>("Images/Ride/straight-small");
|
||||
|
||||
target = transform.parent.Find("Target").gameObject;
|
||||
//小地图进度
|
||||
miniMapProcess = transform.Find("Panel/MiniMap/Process").GetComponent<Image>();
|
||||
miniMapProcessText = transform.Find("Panel/MiniMap/Process/Text").GetComponent<Text>();
|
||||
|
||||
UIManager.AddEvent(startBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, StartRide);
|
||||
UIManager.AddEvent(simpleBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ClearPanel);
|
||||
@ -239,21 +245,24 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
fps.text = (1 / Time.deltaTime).ToString();
|
||||
time = 1;
|
||||
}
|
||||
CountDown();
|
||||
MoveCamera();
|
||||
CountDown();
|
||||
|
||||
}
|
||||
private float cameraX = 0;
|
||||
private float cameraY = 0;
|
||||
private float cameraZ = 0;
|
||||
|
||||
Transform player;
|
||||
MapRoute routeInstance;
|
||||
private void Init()
|
||||
{
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
mainController = FindObjectOfType<CyclingController>();
|
||||
|
||||
player = transform.parent.Find("Player");
|
||||
var route = mainController.GetRoute();
|
||||
mapName.text = route.RouteInstance.Name;
|
||||
var camera = route.RouteInstance.Camera;
|
||||
routeInstance = route.RouteInstance;
|
||||
mapName.text = routeInstance.Name;
|
||||
var camera = routeInstance.Camera;
|
||||
if (!string.IsNullOrEmpty(camera))
|
||||
{
|
||||
var cameraArr = camera.Split(',');
|
||||
@ -311,20 +320,25 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
nearByPanel.SetActive(true);
|
||||
}
|
||||
}
|
||||
Vector3 m = new Vector3(0.1f, 0.1f, 0.1f);
|
||||
|
||||
//移动摄像头和箭头位置
|
||||
private void MoveCamera()
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
target.transform.position = playerController.transform.position; //new Vector3((float)Math.Round(player.transform.position.x,1), 0, (float)Math.Round(player.transform.position.z,1));
|
||||
target.transform.position = playerController.currentPos; //player.transform.position;// new Vector3((float)Math.Round(player.transform.position.x,1), 0, (float)Math.Round(player.transform.position.z,1));
|
||||
if (!mainController.Is3dView)
|
||||
{ //target.transform.rotation = playerController.transform.rotation;//new Quaternion(playerController.transform.rotation.x, playerController.transform.rotation.y +1f, playerController.transform.rotation.z, playerController.transform.rotation.w);
|
||||
target.transform.eulerAngles = new Vector3(0, playerController.transform.eulerAngles.y + 160f, 0);
|
||||
mainController.player.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
|
||||
{
|
||||
Vector3 v = Vector3.zero;
|
||||
v.y += playerController.currentRotation.eulerAngles.y + 160f; //target.transform.rotation = playerController.transform.rotation;//new Quaternion(playerController.transform.rotation.x, playerController.transform.rotation.y +1f, playerController.transform.rotation.z, playerController.transform.rotation.w);
|
||||
target.transform.eulerAngles = v; //.Set(0, playerController.currentRotation.eulerAngles.y + 160f, 0);// = new Vector3(0, playerController.transform.eulerAngles.y + 160f, 0);
|
||||
//mainController.player.transform.localScale.Set(0.1f, 0.1f, 0.1f);
|
||||
player.transform.localScale = m;
|
||||
}
|
||||
else
|
||||
{
|
||||
target.transform.eulerAngles = new Vector3(cameraX, cameraY, cameraZ);
|
||||
target.transform.eulerAngles.Set(cameraX, cameraY, cameraZ);// = new Vector3(cameraX, cameraY, cameraZ);
|
||||
}
|
||||
//控制照片移动
|
||||
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
|
||||
@ -383,6 +397,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
currentSlopeText.text = Math.Round(playerController.CurrentSlope, 1).ToString() + "%";
|
||||
currentSlopeDistanceText.GetComponent<NumberDotween>().AnimateNum((float)playerController.CurrentSlopeDistance, Math.Round(playerController.CurrentDistance, 0), playerController.CurrentIndex, 0, "{0}M");
|
||||
totalClimb.text = Math.Round(playerController.TotalClimb, 0).ToString();
|
||||
//小地图进度
|
||||
var process = (float)(playerController.TotalDistance / routeInstance.Distance);
|
||||
miniMapProcess.fillAmount = process;
|
||||
miniMapProcessText.text = $"{process*100:f0}%";
|
||||
//动态改变坡度图片
|
||||
if (playerController.CurrentSlope >= 1)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user