Tachymètre
This commit is contained in:
parent
aac6e1fac7
commit
1a7ea45d0a
@ -113,6 +113,140 @@ NavMeshSettings:
|
|||||||
debug:
|
debug:
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1 &384609360
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 5
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 384609361}
|
||||||
|
- component: {fileID: 384609364}
|
||||||
|
- component: {fileID: 384609363}
|
||||||
|
- component: {fileID: 384609362}
|
||||||
|
- component: {fileID: 384609366}
|
||||||
|
- component: {fileID: 384609365}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: "HUD Tachym\xE8tre"
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &384609361
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 384609360}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: -2.86}
|
||||||
|
m_LocalScale: {x: 0.00052083336, y: 0.0009259259, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1036252279}
|
||||||
|
m_RootOrder: 0
|
||||||
|
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: 1920, y: 1080}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &384609362
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 384609360}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_IgnoreReversedGraphics: 1
|
||||||
|
m_BlockingObjects: 0
|
||||||
|
m_BlockingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
--- !u!114 &384609363
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 384609360}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_UiScaleMode: 0
|
||||||
|
m_ReferencePixelsPerUnit: 100
|
||||||
|
m_ScaleFactor: 1
|
||||||
|
m_ReferenceResolution: {x: 800, y: 600}
|
||||||
|
m_ScreenMatchMode: 0
|
||||||
|
m_MatchWidthOrHeight: 0
|
||||||
|
m_PhysicalUnit: 3
|
||||||
|
m_FallbackScreenDPI: 96
|
||||||
|
m_DefaultSpriteDPI: 96
|
||||||
|
m_DynamicPixelsPerUnit: 1
|
||||||
|
--- !u!223 &384609364
|
||||||
|
Canvas:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 384609360}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_RenderMode: 2
|
||||||
|
m_Camera: {fileID: 0}
|
||||||
|
m_PlaneDistance: 100
|
||||||
|
m_PixelPerfect: 0
|
||||||
|
m_ReceivesEvents: 1
|
||||||
|
m_OverrideSorting: 0
|
||||||
|
m_OverridePixelPerfect: 0
|
||||||
|
m_SortingBucketNormalizedSize: 0
|
||||||
|
m_AdditionalShaderChannelsFlag: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_TargetDisplay: 0
|
||||||
|
--- !u!114 &384609365
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 384609360}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||||
|
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_FontData:
|
||||||
|
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_FontSize: 200
|
||||||
|
m_FontStyle: 0
|
||||||
|
m_BestFit: 0
|
||||||
|
m_MinSize: 2
|
||||||
|
m_MaxSize: 300
|
||||||
|
m_Alignment: 0
|
||||||
|
m_AlignByGeometry: 0
|
||||||
|
m_RichText: 1
|
||||||
|
m_HorizontalOverflow: 0
|
||||||
|
m_VerticalOverflow: 0
|
||||||
|
m_LineSpacing: 1
|
||||||
|
m_Text: LUDICROUS
|
||||||
|
--- !u!222 &384609366
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 384609360}
|
||||||
--- !u!1 &670213594
|
--- !u!1 &670213594
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -125,7 +259,7 @@ GameObject:
|
|||||||
- component: {fileID: 670213596}
|
- component: {fileID: 670213596}
|
||||||
- component: {fileID: 670213595}
|
- component: {fileID: 670213595}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Main Camera
|
m_Name: CameraP1
|
||||||
m_TagString: MainCamera
|
m_TagString: MainCamera
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@ -162,7 +296,7 @@ Camera:
|
|||||||
width: 1
|
width: 1
|
||||||
height: 1
|
height: 1
|
||||||
near clip plane: 0.3
|
near clip plane: 0.3
|
||||||
far clip plane: 1000
|
far clip plane: 15
|
||||||
field of view: 60
|
field of view: 60
|
||||||
orthographic: 1
|
orthographic: 1
|
||||||
orthographic size: 5
|
orthographic size: 5
|
||||||
@ -190,7 +324,8 @@ Transform:
|
|||||||
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: -10}
|
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children:
|
||||||
|
- {fileID: 1036252279}
|
||||||
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}
|
||||||
@ -204,7 +339,7 @@ GameObject:
|
|||||||
- component: {fileID: 896084742}
|
- component: {fileID: 896084742}
|
||||||
- component: {fileID: 896084743}
|
- component: {fileID: 896084743}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: HUD Progress
|
m_Name: HUD Progression
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@ -222,7 +357,7 @@ Transform:
|
|||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1865218697}
|
- {fileID: 1865218697}
|
||||||
m_Father: {fileID: 1036252279}
|
m_Father: {fileID: 1036252279}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &896084743
|
--- !u!114 &896084743
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -306,13 +441,14 @@ Transform:
|
|||||||
m_PrefabParentObject: {fileID: 0}
|
m_PrefabParentObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInternal: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1036252277}
|
m_GameObject: {fileID: 1036252277}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 8.888889, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||||
m_LocalScale: {x: 17.777779, y: 10, z: 1}
|
m_LocalScale: {x: 17.777779, y: 10, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
|
- {fileID: 384609361}
|
||||||
- {fileID: 896084742}
|
- {fileID: 896084742}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 670213598}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &1036252280
|
--- !u!114 &1036252280
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -325,6 +461,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 4cdc0f9b9c7604ab9a5d4ac68eb8277f, type: 3}
|
m_Script: {fileID: 11500000, guid: 4cdc0f9b9c7604ab9a5d4ac68eb8277f, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
raceFinishTime: 30
|
||||||
--- !u!114 &1036252281
|
--- !u!114 &1036252281
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -337,10 +474,11 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
playerID: 0
|
playerID: 0
|
||||||
distanceToRun: 100
|
distanceToRun: 400
|
||||||
wheelDiameter: 0.559
|
wheelDiameter: 0.559
|
||||||
ticPerTurn: 4
|
ticPerTurn: 4
|
||||||
speedIntegrationTime: 1
|
speedIntegrationTime: 1
|
||||||
|
tachometer: {fileID: 384609365}
|
||||||
--- !u!1 &1865218696
|
--- !u!1 &1865218696
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class BikeManager : MonoBehaviour {
|
public class BikeManager : MonoBehaviour {
|
||||||
|
|
||||||
@ -27,6 +28,9 @@ public class BikeManager : MonoBehaviour {
|
|||||||
|
|
||||||
private VideoManager vm;
|
private VideoManager vm;
|
||||||
|
|
||||||
|
// TODO: Refactor deps!
|
||||||
|
public Text tachometer;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
vm = gameObject.GetComponent<VideoManager>();
|
vm = gameObject.GetComponent<VideoManager>();
|
||||||
@ -58,6 +62,7 @@ public class BikeManager : MonoBehaviour {
|
|||||||
Debug.Log(Speed);
|
Debug.Log(Speed);
|
||||||
|
|
||||||
vm.speed = Speed / normalSpeed;
|
vm.speed = Speed / normalSpeed;
|
||||||
|
tachometer.text = (Speed * 3.6f).ToString() + "km/h";
|
||||||
}
|
}
|
||||||
|
|
||||||
int getBikeImpulses(float timeWindow = .5f) {
|
int getBikeImpulses(float timeWindow = .5f) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user