Commit ea61a883 authored by Chae Ho Shin's avatar Chae Ho Shin

Merge remote-tracking branch 'origin/model-ui-integration-work' into model-ui-integration-work

# Conflicts:
#	Assets/Scripts/PathRenderer.cs
#	Assets/Scripts/UIManager.cs
parents 2fa6c6cd 07a37e59
......@@ -649,6 +649,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
square: {fileID: 934514725}
pathrenderer: {fileID: 948598108}
playercamera: {fileID: 1661408489}
velocityslider: {fileID: 260633610}
accelslider: {fileID: 1086622590}
......@@ -1250,7 +1251,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 691025000}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 394305455}
m_MethodName: PathCancel
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &691025000
......
......@@ -231,5 +231,14 @@ public class PathRenderer : MonoBehaviour
i++;
}
public void DeletePathsAfterNthPath(int n)
{
square.pathList.RemoveRange(n, _pathRenderer.positionCount - n);
square.pathVelocity.RemoveRange(n, _pathRenderer.positionCount - n);
for (int i = 0; i < transform.childCount; i++)
{
if (i + 1 >= n) Destroy(transform.GetChild(i).gameObject);
}
_pathRenderer.positionCount = square.pathList.Count();
}
}
......@@ -11,6 +11,8 @@ public class UIManager : MonoBehaviour
[SerializeField]
Square square;
[SerializeField]
PathRenderer pathrenderer;
[SerializeField]
Camera playercamera;
[SerializeField]
LogScaleSlider velocityslider;
......@@ -225,6 +227,32 @@ public class UIManager : MonoBehaviour
}
bool result;
var positions = pathRenderer.PathPositionsXZ;
var velocitys = pathRenderer.PathVelocitys;
if (positions.Count <= 1 || velocitys.Count <= 1)
{
return;
}
// remove dummy
positions.RemoveAt(0);
velocitys.RemoveAt(0);
result = levelManager.player.MoveToRetivePosition(positions, velocitys);
if (result)
{
pathRenderer.PathClear();
}
}
public void PathCancel()
{
pathrenderer.DeletePathsAfterNthPath(prevSelectPathNum + 1);
_pathUI.SetActive(false);
prevSelectPathNum = -1;
}
public void OnDoubleClicked()
{
......
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