Commit df67be5d authored by 15박보승's avatar 15박보승

플레이어 높이를 보여주는 UI 추가

parent 0e4daf51
......@@ -704,6 +704,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330379322}
m_CullTransparentMesh: 0
--- !u!1 &369112310
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 369112311}
- component: {fileID: 369112313}
- component: {fileID: 369112312}
m_Layer: 5
m_Name: HeightText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &369112311
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 369112310}
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: 413298776}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &369112312
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 369112310}
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.19607843, g: 0.19607843, b: 0.19607843, 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: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 0 M
--- !u!222 &369112313
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 369112310}
m_CullTransparentMesh: 0
--- !u!1 &398288500
GameObject:
m_ObjectHideFlags: 0
......@@ -922,6 +1001,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 330379323}
- {fileID: 369112311}
m_Father: {fileID: 0}
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -944,6 +1024,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
targetLockedUIPrefab: {fileID: 5037612186728958095, guid: 04d7a8bd5b7afea418585e2d9e55c109,
type: 3}
heightText: {fileID: 369112312}
--- !u!1 &519663054
GameObject:
m_ObjectHideFlags: 0
......@@ -1963,7 +2044,7 @@ ParticleSystemRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10308, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10306, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 0}
m_StaticBatchInfo:
firstSubMesh: 0
......@@ -2091,7 +2172,7 @@ ParticleSystem:
startLifetime:
serializedVersion: 2
minMaxState: 0
scalar: 0.5
scalar: 0.1
minScalar: 5
maxCurve:
serializedVersion: 2
......@@ -2144,7 +2225,7 @@ ParticleSystem:
startSpeed:
serializedVersion: 2
minMaxState: 0
scalar: 100
scalar: 500
minScalar: 5
maxCurve:
serializedVersion: 2
......@@ -2259,9 +2340,9 @@ ParticleSystem:
m_NumAlphaKeys: 2
startSize:
serializedVersion: 2
minMaxState: 0
scalar: 1
minScalar: 1
minMaxState: 3
scalar: 0.1
minScalar: 0.5
maxCurve:
serializedVersion: 2
m_Curve:
......@@ -2312,7 +2393,7 @@ ParticleSystem:
m_RotationOrder: 4
startSizeY:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
scalar: 1
minScalar: 1
maxCurve:
......@@ -2365,7 +2446,7 @@ ParticleSystem:
m_RotationOrder: 4
startSizeZ:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
scalar: 1
minScalar: 1
maxCurve:
......
......@@ -7,9 +7,11 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
{
[SerializeField]
private GameObject targetLockedUIPrefab;
private List<Image> targetLockedUIs = new List<Image>();
[SerializeField]
private Text heightText;
public void UpdateTargetLockedUIs(Vector3[] pos)
{
int tmp, i = 0;
......@@ -37,4 +39,9 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
targetLockedUIs.RemoveRange(tmp, targetLockedUIs.Count - tmp);
}
}
public void UpdateHeightText(float height)
{
heightText.text = string.Format("{0:F1}", height) + " M";
}
}
......@@ -63,6 +63,7 @@ public class PlayerController : MonoBehaviour
float vertical = Input.GetAxis("Vertical");
float horizontal = Input.GetAxis("Horizontal");
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit[] enemyHits = Physics.SphereCastAll(ray, 3, 50, enemyMask);
Vector3[] positions = new Vector3[enemyHits.Length];
......@@ -108,7 +109,7 @@ public class PlayerController : MonoBehaviour
private void LateUpdate()
{
IngameUIManager.inst.UpdateHeightText(transform.position.y);
}
private void FireHook()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment