细节调整
线路材质&位置调整,海拔图区间优化,loading动画只执行一次问题解决,小地图的球替换成圆形图片
This commit is contained in:
parent
e29381b13b
commit
eb70ee4397
100
Assets/Resources/UI/Material/4.mat
Normal file
100
Assets/Resources/UI/Material/4.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: 4
|
||||||
|
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: 0.15294118, g: 0.8745098, b: 0.8901961, a: 1}
|
||||||
|
- _ColorTo: {r: 0.15294118, g: 0.8745098, b: 0.8901961, a: 1}
|
||||||
|
- _Combine: {r: 0.15294118, g: 0.8745098, b: 0.8901961, 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/4.mat.meta
Normal file
8
Assets/Resources/UI/Material/4.mat.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d28dbfb9c0d425a418c170baba9d8b89
|
||||||
|
timeCreated: 1500387811
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
90
Assets/Resources/UI/Prefab/Ride/MiniArrow.prefab
Normal file
90
Assets/Resources/UI/Prefab/Ride/MiniArrow.prefab
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &1148602845821646044
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1148602845821646045}
|
||||||
|
- component: {fileID: 1148602845821646048}
|
||||||
|
- component: {fileID: 1148602845821646051}
|
||||||
|
- component: {fileID: 1148602845821646050}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: arrow
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &1148602845821646045
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1148602845821646044}
|
||||||
|
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: 0}
|
||||||
|
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: -638, y: -330}
|
||||||
|
m_SizeDelta: {x: 8, y: 8}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &1148602845821646048
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1148602845821646044}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!114 &1148602845821646051
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1148602845821646044}
|
||||||
|
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: 0.15294118, g: 0.8745098, b: 0.8901961, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 0}
|
||||||
|
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!114 &1148602845821646050
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1148602845821646044}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: adb30198aa32dd140b5750692dd48104, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
radius: 4
|
||||||
7
Assets/Resources/UI/Prefab/Ride/MiniArrow.prefab.meta
Normal file
7
Assets/Resources/UI/Prefab/Ride/MiniArrow.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 122fb7a13211ef745867d497d891788f
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -30,7 +30,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 3777003654129381334}
|
m_GameObject: {fileID: 3777003654129381334}
|
||||||
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: 15, y: 15, z: 15}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -75,6 +75,10 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
resultPanel = transform.Find("SingleUI/Panel/ResultPanel").gameObject;
|
resultPanel = transform.Find("SingleUI/Panel/ResultPanel").gameObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
App.TextureCache.Clear();
|
||||||
|
}
|
||||||
Transform target;
|
Transform target;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Assets.Scenes.Ride.Scripts
|
namespace Assets.Scenes.Ride.Scripts
|
||||||
{
|
{
|
||||||
@ -21,6 +22,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
CyclingController cyclingCotroller;
|
CyclingController cyclingCotroller;
|
||||||
public PlayerController playerController;
|
public PlayerController playerController;
|
||||||
GameObject _mipMapRoute;
|
GameObject _mipMapRoute;
|
||||||
|
public RectTransform RectRoot;//rawImage
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
cyclingCotroller = FindObjectOfType<CyclingController>();
|
cyclingCotroller = FindObjectOfType<CyclingController>();
|
||||||
@ -40,17 +42,19 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
var screenBounds = GetScreenBounds();
|
var screenBounds = GetScreenBounds();
|
||||||
var z = SetZoomToFitBounds(targetbounds, screenBounds);
|
var z = SetZoomToFitBounds(targetbounds, screenBounds);
|
||||||
}
|
}
|
||||||
}
|
RectRoot = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap").GetComponent<RectTransform>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
float timer = 0;
|
float timer = 0;
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (playerController != null)
|
if (playerController != null)
|
||||||
{
|
{
|
||||||
var tr=transform.parent.Find("SingleUI/Panel/Image");
|
var tr = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap/arrow");
|
||||||
|
tr.SetSiblingIndex(9999);
|
||||||
_player.transform.localPosition = _map.GeoToWorldPosition(playerController.Currentlatlong);
|
_player.transform.localPosition = _map.GeoToWorldPosition(playerController.Currentlatlong);
|
||||||
((RectTransform)tr.transform).position = _minicamera.WorldToScreenPoint(_player.transform.localPosition);
|
Vector2 vp2 = _minicamera.WorldToViewportPoint(_player.transform.localPosition);//将三维物体的世界坐标转换为视口坐标
|
||||||
//((RectTransform)tr).localPosition = _minicamera.WorldToViewportPoint(_player.transform.localPosition);
|
((RectTransform)tr.transform).anchoredPosition = new Vector2((vp2.x * RectRoot.sizeDelta.x) - (RectRoot.sizeDelta.x * 0.5f), (vp2.y * RectRoot.sizeDelta.y) - (RectRoot.sizeDelta.y * 0.5f));
|
||||||
}
|
}
|
||||||
timer += Time.deltaTime;
|
timer += Time.deltaTime;
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
CyclingController cyclingController;
|
CyclingController cyclingController;
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
App.TextureCache.Clear();
|
||||||
loadingPanel = transform.Find("Panel/LoadingPanel").gameObject;
|
loadingPanel = transform.Find("Panel/LoadingPanel").gameObject;
|
||||||
loadingPanel.showLoadingExtension();
|
loadingPanel.showLoadingExtension();
|
||||||
//InitGameObject();
|
//InitGameObject();
|
||||||
@ -220,10 +220,9 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
mapCountry.texture = cyclingController.GetCountryImageByName(userList[0].Country);//路书国家
|
mapCountry.texture = cyclingController.GetCountryImageByName(userList[0].Country);//路书国家
|
||||||
|
|
||||||
Utils.DisplayImage(altitudeGraph, route.AltitudeGraph);//海拔图
|
Utils.DisplayImage(altitudeGraph, route.AltitudeGraph);//海拔图
|
||||||
loadingPanel.SetActive(false);
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
StartCoroutine(HiddenLoading());
|
||||||
#region 地图注册 排行榜等接口
|
#region 地图注册 排行榜等接口
|
||||||
_map.OnInitialized += _map_OnInitialized;
|
_map.OnInitialized += _map_OnInitialized;
|
||||||
_map.OnEditorPreviewEnabled += OnEditorPreviewEnabled;
|
_map.OnEditorPreviewEnabled += OnEditorPreviewEnabled;
|
||||||
@ -231,7 +230,11 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
IEnumerator HiddenLoading()
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(1f);
|
||||||
|
loadingPanel.SetActive(false);
|
||||||
|
}
|
||||||
void _map_OnInitialized()
|
void _map_OnInitialized()
|
||||||
{
|
{
|
||||||
var visualizer = _map.MapVisualizer;
|
var visualizer = _map.MapVisualizer;
|
||||||
|
|||||||
@ -7,9 +7,16 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
private AbstractPlayer _player;
|
private AbstractPlayer _player;
|
||||||
private AbstractMap _map;
|
private AbstractMap _map;
|
||||||
|
RectTransform RectRoot;
|
||||||
|
GameObject arrow;
|
||||||
|
Camera _minicamera;
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
_map = transform.parent.Find("MiniMap").GetComponent<AbstractMap>();
|
_map = transform.parent.Find("MiniMap").GetComponent<AbstractMap>();
|
||||||
|
_minicamera = transform.parent.Find("MiniCamera").GetComponent<Camera>();
|
||||||
|
RectRoot = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap").GetComponent<RectTransform>();
|
||||||
|
var parent = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap");
|
||||||
|
arrow = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/MiniArrow"), parent);
|
||||||
}
|
}
|
||||||
public void SetController(AbstractPlayer player)
|
public void SetController(AbstractPlayer player)
|
||||||
{
|
{
|
||||||
@ -24,6 +31,9 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
if (_player != null)
|
if (_player != null)
|
||||||
{
|
{
|
||||||
transform.localPosition = _map.GeoToWorldPosition(_player.Currentlatlong);
|
transform.localPosition = _map.GeoToWorldPosition(_player.Currentlatlong);
|
||||||
|
var tr = arrow.GetComponent<RectTransform>();
|
||||||
|
Vector2 vp2 = _minicamera.WorldToViewportPoint(transform.localPosition);//将三维物体的世界坐标转换为视口坐标
|
||||||
|
tr.anchoredPosition = new Vector2((vp2.x * RectRoot.sizeDelta.x) - (RectRoot.sizeDelta.x * 0.5f), (vp2.y * RectRoot.sizeDelta.y) - (RectRoot.sizeDelta.y * 0.5f));
|
||||||
}
|
}
|
||||||
t = 1;
|
t = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,9 +120,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineInfoPanel"), uiObject);
|
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineInfoPanel"), uiObject);
|
||||||
}
|
}
|
||||||
|
var headPos = infoPanel.transform.Find("Head").position;
|
||||||
var infoPos = playerScreenPos + new Vector3(150f, 60f, 0f);
|
var infoPos = playerScreenPos + new Vector3(150f, 60f, 0f);
|
||||||
((RectTransform)infoPanel.transform).position = infoPos;
|
((RectTransform)infoPanel.transform).position = infoPos;
|
||||||
CreateInfoLine(playerScreenPos, infoPos);
|
CreateInfoLine(playerScreenPos, headPos);
|
||||||
var infoHead = infoPanel.transform.Find("Head").GetComponent<RawImage>();
|
var infoHead = infoPanel.transform.Find("Head").GetComponent<RawImage>();
|
||||||
if (head != null)
|
if (head != null)
|
||||||
{
|
{
|
||||||
@ -183,14 +184,14 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
_directionsGO.Destroy();
|
_directionsGO.Destroy();
|
||||||
}
|
}
|
||||||
startPos = Camera.main.ScreenToWorldPoint(startPos);
|
startPos = Camera.main.ScreenToWorldPoint(startPos);
|
||||||
endPos.x -= 120f;
|
//endPos.x -= 120f;
|
||||||
endPos = Camera.main.ScreenToWorldPoint(endPos);
|
endPos = Camera.main.ScreenToWorldPoint(endPos);
|
||||||
|
|
||||||
_directionsGO = new GameObject("InfoLinerender");
|
_directionsGO = new GameObject("InfoLinerender");
|
||||||
_directionsGO.transform.SetParent(transform);
|
_directionsGO.transform.SetParent(transform);
|
||||||
var lineRender = _directionsGO.AddComponent<LineRenderer>();
|
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");
|
lineRender.material = Resources.Load<Material>("UI/Material/4");
|
||||||
lineRender.endColor = new Color(0.1529412f, 0.8745098f, 0.8901961f, 1f);
|
lineRender.endColor = new Color(0.1529412f, 0.8745098f, 0.8901961f, 1f);
|
||||||
lineRender.startColor = new Color(0.1529412f, 0.8745098f, 0.8901961f, 1f);
|
lineRender.startColor = new Color(0.1529412f, 0.8745098f, 0.8901961f, 1f);
|
||||||
|
|
||||||
|
|||||||
@ -88,9 +88,10 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
{
|
{
|
||||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineInfoPanel"), uiObject);
|
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineInfoPanel"), uiObject);
|
||||||
}
|
}
|
||||||
|
var headPos = infoPanel.transform.Find("Head").position;
|
||||||
var infoPos = playerScreenPos + new Vector3(150f, 60f, 0f);
|
var infoPos = playerScreenPos + new Vector3(150f, 60f, 0f);
|
||||||
((RectTransform)infoPanel.transform).position = infoPos;
|
((RectTransform)infoPanel.transform).position = infoPos;
|
||||||
CreateInfoLine(playerScreenPos, infoPos);
|
CreateInfoLine(playerScreenPos, headPos);
|
||||||
var infoHead = infoPanel.transform.Find("Head").GetComponent<RawImage>();
|
var infoHead = infoPanel.transform.Find("Head").GetComponent<RawImage>();
|
||||||
if (head != null)
|
if (head != null)
|
||||||
{
|
{
|
||||||
@ -122,14 +123,15 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
_directionsGO.Destroy();
|
_directionsGO.Destroy();
|
||||||
}
|
}
|
||||||
startPos = Camera.main.ScreenToWorldPoint(startPos);
|
startPos = Camera.main.ScreenToWorldPoint(startPos);
|
||||||
endPos.x -= 120f;
|
//endPos.x -= 120f;
|
||||||
endPos = Camera.main.ScreenToWorldPoint(endPos);
|
endPos = Camera.main.ScreenToWorldPoint(endPos);
|
||||||
|
|
||||||
_directionsGO = new GameObject("InfoLinerender");
|
_directionsGO = new GameObject("InfoLinerender");
|
||||||
_directionsGO.transform.SetParent(transform);
|
_directionsGO.transform.SetParent(transform);
|
||||||
var lineRender = _directionsGO.AddComponent<LineRenderer>();
|
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");
|
//lineRender.material = Resources.Load<Material>("UI/Material/color8");
|
||||||
|
lineRender.material = Resources.Load<Material>("UI/Material/1");
|
||||||
lineRender.endColor = new Color(1, 1f, 1f, 0.65f);
|
lineRender.endColor = new Color(1, 1f, 1f, 0.65f);
|
||||||
lineRender.startColor = new Color(1, 1f, 1f, 0.65f);
|
lineRender.startColor = new Color(1, 1f, 1f, 0.65f);
|
||||||
|
|
||||||
|
|||||||
@ -165,9 +165,9 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
|
|
||||||
viewButton = transform.Find("Panel/ViewButton").GetComponent<Button>();
|
viewButton = transform.Find("Panel/ViewButton").GetComponent<Button>();
|
||||||
altitudeGraph = transform.Find("Panel/TitlePanel/AltitudeGraph").GetComponent<RawImage>();
|
altitudeGraph = transform.Find("Panel/TitlePanel/AltitudeGraph").GetComponent<RawImage>();
|
||||||
leftImage = transform.Find("Panel/TitlePanel/Left").GetComponent<Image>();
|
leftImage = transform.Find("Panel/TitlePanel/AltitudeGraph/Left").GetComponent<Image>();
|
||||||
rightImage = transform.Find("Panel/TitlePanel/Right").GetComponent<Image>();
|
rightImage = transform.Find("Panel/TitlePanel/AltitudeGraph/Right").GetComponent<Image>();
|
||||||
area = transform.Find("Panel/TitlePanel/Area").GetComponent<Image>();
|
area = transform.Find("Panel/TitlePanel/AltitudeGraph/Area").GetComponent<Image>();
|
||||||
settingPanel = transform.Find("Panel/SettingPanel").gameObject;
|
settingPanel = transform.Find("Panel/SettingPanel").gameObject;
|
||||||
preSlopeText = transform.Find("Panel/PreSlopePanel/PreSlopeText").GetComponent<Text>();
|
preSlopeText = transform.Find("Panel/PreSlopePanel/PreSlopeText").GetComponent<Text>();
|
||||||
|
|
||||||
@ -678,21 +678,21 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var m = Screen.width / 1600D;
|
//var m = Screen.width / 1600D;
|
||||||
var start = chartDataSourceScript.GetRealTimeStart();
|
var start = chartDataSourceScript.GetRealTimeStart();
|
||||||
var end = chartDataSourceScript.GetRealTimeEnd();
|
var end = chartDataSourceScript.GetRealTimeEnd();
|
||||||
|
|
||||||
var originWith = m * 30D;
|
var originWith =0D;
|
||||||
var with = m * 286D;
|
var with = altitudeGraph.GetComponent<RectTransform>().sizeDelta.x;
|
||||||
|
|
||||||
var left = start * with + originWith;
|
var left = start * with + originWith;
|
||||||
var right = end * with + originWith;
|
var right = end * with + originWith;
|
||||||
var rectTransform = area.gameObject.GetComponent<RectTransform>();
|
var rectTransform = area.gameObject.GetComponent<RectTransform>();
|
||||||
var width = m *(float)(right - left);
|
var width = (float)(end - start)* 286F;
|
||||||
rectTransform.sizeDelta = new Vector2((float)width, 40);
|
rectTransform.DOSizeDelta(new Vector2((float)width+5f, 40), 1);
|
||||||
rectTransform.DOMoveX((float)(left), 1);
|
rectTransform.DOLocalMoveX((float)(left), 1);
|
||||||
leftImage.transform.DOMoveX((float)left, 1);
|
leftImage.GetComponent<RectTransform>().DOLocalMoveX((float)left, 1);
|
||||||
rightImage.transform.DOMoveX((float)right, 1);
|
rightImage.GetComponent<RectTransform>().DOLocalMoveX((float)right, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user