AR演示版本调优

This commit is contained in:
lishuo 2023-01-17 18:07:49 +08:00
parent 27d18d7d01
commit df936c4e04
27 changed files with 3143 additions and 2980 deletions

View File

@ -432,6 +432,7 @@ namespace Assets.AR
this.SlamSegments = data.SlamSegments;
this.CameraHeight = data.CameraHeight;
this.RiderScale = (double)data.RiderScale != 0.0 ? data.RiderScale : 1f;
this.RiderScale *= 0.9f;
this.CameraPositions = ((IEnumerable<VectorData>)data.CameraPositions).Select<VectorData, Vector3>((Func<VectorData, Vector3>)(x => x.ToUnityVector())).ToArray<Vector3>();
this.ProjectionParameters = data.CameraProjectionParameters;
this.CameraRotations = ((IEnumerable<VectorData>)data.CameraRotations).Select<VectorData, Quaternion>((Func<VectorData, Quaternion>)(x => Quaternion.Euler(x.ToUnityVector()))).ToArray<Quaternion>();

View File

@ -94,6 +94,16 @@ namespace Assets.AR
item.PreSpeed = item.Speed;
item.Speed = (float)dic.Key.OnlineSpeed;
item.DeltaDistance = (float)(dic.Key.EndDistance - dic.Key.PreDistance);
//如果速度为0就停止播放视频
if (item.DeltaDistance == 0 || item.Speed == 0)
{
item.DeltaDistance = 0;
videoPlayer.Pause();
}
else
{
videoPlayer.Resume();
}
item.Route = Route;
item.VideoSync = videoPointsSync;
item.IsAtFinish = dic.Key.EndDistance >= manager.GetMapRoute().Distance*1000f;
@ -111,6 +121,7 @@ namespace Assets.AR
foreach (var obj in this.riderObjects.Values)
{
var offset = obj.DeltaDistance * delta;
//Debug.Log($"offset:{offset}:{DateTime.Now}");
obj.Distance += offset;
obj.RouteDistance += offset;
}

View File

@ -1,24 +0,0 @@
using UnityEngine;
namespace Assets.AR
{
public class ExampleClass : MonoBehaviour
{
public Matrix4x4 originalProjection;
Camera cam;
void Start()
{
cam = GetComponent<Camera>();
originalProjection = cam.projectionMatrix;
}
void Update()
{
Matrix4x4 p = originalProjection;
p.m01 += Mathf.Sin(Time.time * 1.2F) * 0.1F;
p.m10 += Mathf.Sin(Time.time * 1.5F) * 0.1F;
cam.projectionMatrix = p;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 202761b738f529a438db2134c721aae4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,4 +1,4 @@
using Assets.Core;

using System;
using UnityEngine;
@ -83,11 +83,19 @@ namespace Assets.AR
{
if ((UnityEngine.Object)this.animator != (UnityEngine.Object)null)
{
//根据人物当前的属性计算动画状态
animator.SetFloat("speed", (float)Speed);
animator.SetFloat("power", (float)Power);
if (lastSpeed > 0)
{
animator.Play("rideLoop");
}
else
{
animator.Play("idle");
}
animator.SetFloat("speed", lastSpeed);
}
}
private string LastAnimatorState { get; set; }
protected override void Start()
{

View File

@ -1562,9 +1562,9 @@ AnimatorStateTransition:
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.24999952
m_TransitionOffset: 0.00000060872236
m_ExitTime: 0.9997488
m_TransitionDuration: 0.24999988
m_TransitionOffset: 0.61737543
m_ExitTime: 0.6409338
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0

View File

@ -111,6 +111,7 @@ RectTransform:
- {fileID: 356461757161456314}
- {fileID: 2862935674694061735}
- {fileID: 6265415831168584355}
- {fileID: 1806753320241620463}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -184,6 +185,7 @@ MonoBehaviour:
nameLabel: {fileID: 356461757142253270}
genderLabel: {fileID: 356461757161456313}
idLabel: {fileID: 356461756806036588}
powerLabel: {fileID: 8338408867196048427}
master: {fileID: 2140202266184974615}
Id:
Rank:
@ -343,8 +345,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 112, y: -16}
m_SizeDelta: {x: 120, y: 16}
m_AnchoredPosition: {x: 97.08, y: -21}
m_SizeDelta: {x: 90.157715, y: 16}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &356461757142253269
CanvasRenderer:
@ -465,6 +467,84 @@ MonoBehaviour:
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: 0M
--- !u!1 &383536821492172191
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1806753320241620463}
- component: {fileID: 7513355834687980536}
- component: {fileID: 8338408867196048427}
m_Layer: 5
m_Name: Power
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &1806753320241620463
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 383536821492172191}
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: 356461756423929917}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 112, y: -29}
m_SizeDelta: {x: 120, y: 12}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7513355834687980536
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 383536821492172191}
m_CullTransparentMesh: 0
--- !u!114 &8338408867196048427
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 383536821492172191}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9764706, g: 0.1882353, b: 0.5254902, a: 0.6}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 9428f2aab98e9c34d923a9174035a197, type: 3}
m_FontSize: 10
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 40
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 0W
--- !u!1 &2140202266184974615
GameObject:
m_ObjectHideFlags: 0

View File

@ -530,7 +530,7 @@ MonoBehaviour:
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: challenage route from Po
m_Text: unkown
--- !u!114 &8517265170557612342
MonoBehaviour:
m_ObjectHideFlags: 0
@ -621,7 +621,7 @@ MonoBehaviour:
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_Interactable: 0
m_TargetGraphic: {fileID: 6395839599251440037}
m_FillRect: {fileID: 779902164117560685}
m_HandleRect: {fileID: 6579941052591197295}

View File

@ -2212,6 +2212,7 @@ RectTransform:
- {fileID: 5144962272042509941}
- {fileID: 5307116754629177247}
- {fileID: 5836440877148088560}
- {fileID: 5992092576151745863}
m_Father: {fileID: 5262667172184159172}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -3060,6 +3061,80 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &8785820966701978836
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5992092576151745863}
- component: {fileID: 4878294983436146214}
- component: {fileID: 9183130272398829424}
m_Layer: 5
m_Name: AR
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &5992092576151745863
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8785820966701978836}
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: 5836440878484963209}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 103, y: -14}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4878294983436146214
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8785820966701978836}
m_CullTransparentMesh: 0
--- !u!114 &9183130272398829424
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8785820966701978836}
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: 80ca2c4b44afce842834c2afcb41da14, 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 &9037866035028281532
GameObject:
m_ObjectHideFlags: 0
@ -3477,11 +3552,21 @@ PrefabInstance:
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8346147358446958508, guid: 54041a2a3df27f94eb85f6a36d823947,
type: 3}
propertyPath: m_Maskable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8346147358446958508, guid: 54041a2a3df27f94eb85f6a36d823947,
type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 0}
- target: {fileID: 8955431166369480975, guid: 54041a2a3df27f94eb85f6a36d823947,
type: 3}
propertyPath: m_Maskable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8955431166369480975, guid: 54041a2a3df27f94eb85f6a36d823947,
type: 3}
propertyPath: m_Material

View File

@ -167,7 +167,7 @@ MonoBehaviour:
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 0.23921569, g: 0.24313726, b: 0.3019608, a: 1}
m_NormalColor: {r: 0.43137255, g: 0.43137255, b: 0.49019608, a: 1}
m_HighlightedColor: {r: 1, g: 1, b: 1, a: 1}
m_PressedColor: {r: 1, g: 1, b: 1, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}

View File

@ -167,7 +167,7 @@ MonoBehaviour:
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 0.23921569, g: 0.24313726, b: 0.3019608, a: 1}
m_NormalColor: {r: 0.43137255, g: 0.43137255, b: 0.49019608, a: 1}
m_HighlightedColor: {r: 1, g: 1, b: 1, a: 1}
m_PressedColor: {r: 1, g: 1, b: 1, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}

View File

@ -99,7 +99,6 @@ GameObject:
- component: {fileID: 2488873306782836046}
- component: {fileID: 4724798560655184725}
- component: {fileID: 8346147358446958508}
- component: {fileID: 3517092285969804859}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
@ -123,8 +122,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0}
m_AnchoredPosition: {x: -0.45999908, y: 0}
m_SizeDelta: {x: 10.9135895, y: 2.2820501}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4724798560655184725
CanvasRenderer:
@ -149,11 +148,11 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0.9764706, g: 0.1882353, b: 0.5254902, a: 1}
m_RaycastTarget: 0
m_Maskable: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@ -163,19 +162,6 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &3517092285969804859
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1532695884605852183}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: adb30198aa32dd140b5750692dd48104, type: 3}
m_Name:
m_EditorClassIdentifier:
radius: 5
--- !u!1 &2308879617044449008
GameObject:
m_ObjectHideFlags: 0
@ -407,7 +393,7 @@ MonoBehaviour:
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0.6199647
m_Value: 0
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []

View File

@ -11060,7 +11060,7 @@ MonoBehaviour:
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 0.13333334, g: 0.2, b: 0.13333334, a: 1}
m_NormalColor: {r: 0.43137255, g: 0.43137255, b: 0.49019608, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 1, g: 1, b: 1, a: 1}
@ -18351,8 +18351,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -205.5, y: 88}
m_SizeDelta: {x: 291, y: 56}
m_AnchoredPosition: {x: -205.5, y: 333}
m_SizeDelta: {x: 291, y: 546}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &869953156436115466
CanvasRenderer:

View File

@ -65,7 +65,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 5781e63d9fc789b46b84410ccd0e994d, type: 3}
m_Sprite: {fileID: 21300000, guid: 0c96af6ac7950394f81832009c039c98, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
@ -95,9 +95,9 @@ MonoBehaviour:
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 0.13725491, g: 0.13725491, b: 0.1764706, a: 1}
m_NormalColor: {r: 0.43137255, g: 0.43137255, b: 0.49019608, a: 1}
m_HighlightedColor: {r: 1, g: 1, b: 1, a: 1}
m_PressedColor: {r: 0.078431375, g: 0.078431375, b: 0.09019608, a: 1}
m_PressedColor: {r: 1, g: 1, b: 1, a: 1}
m_SelectedColor: {r: 1, g: 1, b: 1, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1

View File

@ -661,6 +661,92 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 313551262}
m_CullTransparentMesh: 0
--- !u!21 &389789418
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, 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}
- _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
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 50, g: 50, b: 50, a: 0}
--- !u!1 &684809389
GameObject:
m_ObjectHideFlags: 0
@ -906,7 +992,7 @@ Camera:
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Bits: 196407
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
@ -1136,92 +1222,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: -3.896, z: 0}
--- !u!21 &866930765
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, 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}
- _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
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 446, g: 70, b: 70, a: 0}
--- !u!1 &871660769
GameObject:
m_ObjectHideFlags: 0
@ -1537,92 +1537,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: -3.896, z: 0}
--- !u!21 &1277262929
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, 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}
- _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
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 50, g: 50, b: 50, a: 0}
--- !u!1 &1378474435
GameObject:
m_ObjectHideFlags: 0
@ -2227,6 +2141,92 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!21 &1966228851
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, 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}
- _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
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 446, g: 70, b: 70, a: 0}
--- !u!1 &1985738405
GameObject:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -98,13 +98,16 @@ namespace Assets.Scripts.Scenes.VideoRide
Forward();
ComputeRecord();
ComputeVideo();
ComputeAnimator();//控制动画
}
else
{
animator.Play("idle");
power = 0;
OnlineSpeed = 0;
PreDistance = EndDistance;
speed = 0;
distance = 0;
}
ComputeAnimator();//控制动画
timer += 1f;
}
catch (Exception e)
@ -204,7 +207,7 @@ namespace Assets.Scripts.Scenes.VideoRide
}
if (ratio < 1)
{
ratio = Math.Max(ratio, 0.6f);
ratio = Math.Max(ratio, 0.3f);
}
if (speed == 0)
{
@ -212,7 +215,7 @@ namespace Assets.Scripts.Scenes.VideoRide
}
var info = animator.GetCurrentAnimatorClipInfo(0);
var currentClip = info.FirstOrDefault();
if (currentClip.clip != null && currentClip.clip.isLooping)
if (currentClip.clip != null)
{
animator.speed = ratio;
}
@ -271,6 +274,11 @@ namespace Assets.Scripts.Scenes.VideoRide
{
head?.SetActive(false);
}
private void OnEnable()
{
head?.SetActive(true);
}
//显示人物海拔图的头像
protected virtual void CreateHeadImage()
{
@ -282,6 +290,7 @@ namespace Assets.Scripts.Scenes.VideoRide
ftpImage = head.transform.Find("ftp").GetComponent<Image>();
headName = head.transform.Find("name").GetComponent<Text>();
headWkg = head.transform.Find("wkg").GetComponent<Text>();
}
}
if (head != null)

View File

@ -15,6 +15,7 @@ namespace Assets.Scripts.Scenes.VideoRide
public Text nameLabel;
public Text genderLabel;
public Text idLabel;
public Text powerLabel;
public GameObject master;
//Model
@ -67,6 +68,7 @@ namespace Assets.Scripts.Scenes.VideoRide
nameLabel.text = contactInfo.Name;
genderLabel.text = contactInfo.Gender;
idLabel.text = contactInfo.id;
powerLabel.text = contactInfo.Power.ToString("f0") + "W";
//master.SetActive(manager.CurrentPlayer.UserId.ToString() == contactInfo.id);
}
public void UpdateItem(string name,string gender,string id)

View File

@ -15,6 +15,7 @@ namespace Assets.Scripts.Scenes.VideoRide
public string Name;
public string Gender;
public string id;
public double Power;
}
class NearVideoPlayerList : MonoBehaviour, IRecyclableScrollRectDataSource
{
@ -56,6 +57,7 @@ namespace Assets.Scripts.Scenes.VideoRide
obj.Name = item.Name;
obj.Gender = "";
obj.id = item.Id.ToString();
obj.Power = item.Power;
_contactList.Add(obj);
}
}

View File

@ -234,15 +234,14 @@ namespace Assets.Scripts.Scenes.VideoRide
}
CurrentPlayer = videoPlayer.GetComponent<AbstractVideoPlayer>();
var vv = videoPlayer.GetComponent<VideoPlayer>();
vv.SetEndDistance(item.EndDistance);
var vp = videoPlayer.GetComponent<VideoPlayer>();
vp.SetEndDistance(item.EndDistance);
CurrentPlayer.SetStartDistance(item.EndDistance);
var rideObj = videoPlayer.GetComponent<RiderRenderer>();
rideObj.Distance = (float)CurrentPlayer.StartDistance;
rideObj.RouteDistance = rideObj.Distance;
rideObj.IsMain = true;
Debug.Log("IsMain = true");
rideObjs.Add(CurrentPlayer, rideObj);
visibleRiders.Add(CurrentPlayer);

View File

@ -59,10 +59,12 @@ namespace Assets.Scripts.Scenes.VideoRide
power = manager.UpdatePower();
cadance = manager.UpdateCadence();
//#if UNITY_EDITOR
if(mockpower > 0)
power = mockpower;//TODO:动态
cadance = 50;
heartRate = 120;
if (mockpower > 0)
{
power = mockpower;
cadance = 50;
heartRate = 120;
}
//#endif
weight = App.CurrentUser.Weight;
bicycleWeight = App.CurrentUser.BicycleWeight;
@ -125,7 +127,6 @@ namespace Assets.Scripts.Scenes.VideoRide
recorderData.PreDistance = Math.Round(preDistance, 6, MidpointRounding.AwayFromZero);
recorderData.EndDistance = Math.Round(targetData._Distance, 6, MidpointRounding.AwayFromZero);
recorderData.RiderDatas.Add(targetData);
Debug.Log(recorderData.RoomId);
//默认启用多圈
if (isSingle && totalDistance >= mapData.TotalDistance)
{
@ -156,7 +157,16 @@ namespace Assets.Scripts.Scenes.VideoRide
}
this.PreDistance = preDistance * 1000;
this.EndDistance = endDistance * 1000;
this.OnlineSpeed = speed / 3.6;
if (manager.IsQuit())
{
this.OnlineSpeed = 0;
}
else
{
this.OnlineSpeed = speed / 3.6;
}
}
}
}

View File

@ -249,6 +249,15 @@ namespace Assets.Scripts.Scenes.VideoRide
}
private void QuitClick(BaseEventData e)
{
if (manager.CurrentPlayer.UserId == App.CurrentUser.Id && (manager.CurrentPlayer.ticks == 0 || manager.CurrentPlayer.EndDistance - manager.CurrentPlayer.StartDistance < 0.1f))
{
UIManager.ShowConfirm("Quit", App.GetLocalString("Current ride distance too short to save."), () => {
UIManager.CloseConfirm();
SceneManager.LoadSceneAsync("MainScene");
}, 2, () => { UIManager.CloseConfirm(); });
return;
}
if (manager._aRMode == VideoGameManager.ARMode.RIDE)
{

View File

@ -18,7 +18,7 @@ using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler,IProgress<float>
public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler
{
public class PropNames
{
@ -78,7 +78,21 @@ public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnter
downloading.SetActive(true);
downloadTxt.SetActive(false);
slider.gameObject.SetActive(true);
Loom.Download(map);
var progress = Progress.Create<float>(x =>
{
Loom.DownLoadTaskList[map.FileName] = x;
slider.value = x;
LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)this.slider.transform);
if (x == 1)
{
transform.Find("DownLoadModal").gameObject.SetActive(false);
}
else
{
transform.Find("DownLoadModal").gameObject.SetActive(true);
}
});
Loom.Download(map, progress);
});
transform.Find("Name").GetComponent<Text>().text = myMap.Name;
@ -303,24 +317,4 @@ public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnter
{
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
}
public void Report(float value)
{
if (gameObject != null)
slider.value = value;
if (Loom.DownLoadTaskList.ContainsKey(map.FileName))
{
Loom.DownLoadTaskList[map.FileName] = value;
}
else
{
Loom.DownLoadTaskList.Add(map.FileName, value);
}
if (value == 100)
{
Ride();
transform.Find("DownLoadModal").gameObject.SetActive(false);
}
}
}

View File

@ -79,7 +79,7 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
var diff = tabContainer.Find("Diff");
diff.Find("Text").GetComponent<Text>().text = myMap.Hard;
tabContainer.Find("3d").gameObject.SetActive(!myMap.EnableAR && myMap.Enable3D);
tabContainer.Find("AR").gameObject.SetActive(myMap.EnableAR);
tabContainer.Find("AR")?.gameObject.SetActive(myMap.EnableAR);
tabContainer.Find("Country").GetComponent<RawImage>().texture = UIManager.Instance.loginRegOptions.GetCountryImage(myMap.CountryCode);
transform.Find("CollectImg").GetComponent<Button>().onClick.RemoveAllListeners();
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(Collect);

View File

@ -274,13 +274,18 @@ public class GameRoomListController : PFUIPanel
//LOOM中取数据渲染下载当前下载进度
var downLoadList = transform.Find("DownLoadList").gameObject;
var downloadPanel = transform.Find("DownloadPanel").gameObject;
if (!downLoadList.activeSelf && !downloadPanel.activeSelf)
if (Loom.DownLoadTaskList.Count>0)
{
var content = downLoadList.transform.Find("Viewport/Content");
var taskList = FindObjectsOfType<GameRoomDownloadTask>();
foreach (var item in Loom.DownLoadTaskList)
{
var newtask = Instantiate(_downLoadTask, content);
newtask.GetComponent<GameRoomDownloadTask>().Init(0, item.Key, downloadPanel);
var done = taskList.Where(c => c.FileName.Equals(item.Key)).Any();
if (!done)
{
var newtask = Instantiate(_downLoadTask, content);
newtask.GetComponent<GameRoomDownloadTask>().Init(0, item.Key, downloadPanel);
}
downLoadList.SetActive(true);
}
}

View File

@ -179,11 +179,8 @@ public class Loom : MonoBehaviour
}
}
public static async void Download(MapRoute route)
public static async void Download(MapRoute route,IProgress<float> progress)
{
var progress = Progress.Create<float>(x =>
DownLoadTaskList[route.FileName] = x
);
DownLoadTaskList.Add(route.FileName, 0);
var path = PFConstants.VideoFolder;
var localPath = PFConstants.ARFolder;

View File

@ -129,7 +129,7 @@ QualitySettings:
skinWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
antiAliasing: 8
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1