diff --git a/Assets/FactManager.cs b/Assets/FactManager.cs index 228c94fc62fbdcc92ee4de87f6640481d836fad5..829e1a276ac42e4fa44b2688852a65237ffc7b15 100644 --- a/Assets/FactManager.cs +++ b/Assets/FactManager.cs @@ -7,7 +7,7 @@ public class FactManager : MonoBehaviour { public GameObject SmartMenu; - private Stack<int> NextEmptyStack = new Stack<int>(); + private List<int> NextEmpties= new List<int>(); //Variables for LineMode distinction public bool lineModeIsFirstPointSelected = false; @@ -26,7 +26,7 @@ void Start() //We dont want to have this here anymore... //CommunicationEvents.RemoveFactEvent.AddListener(DeleteFact); - NextEmptyStack.Push(0); + NextEmpties.Add(0); } @@ -38,7 +38,7 @@ void Update() PointFact AddPointFact(RaycastHit hit, int id) { - + Facts.Insert(id, new PointFact { Id = id, @@ -77,7 +77,7 @@ AngleFact AddAngleFact(int pid1, int pid2, int pid3, int id) public void DeleteFact(Fact fact) { if (Facts.Contains(fact)) { - NextEmptyStack.Push(fact.Id); + NextEmpties.Add(fact.Id); //Facts.RemoveAt(fact.Id); Facts.Remove(Facts.Find(x => x.Id == fact.Id)); CommunicationEvents.RemoveFactEvent.Invoke(fact); @@ -93,10 +93,12 @@ public int GetFirstEmptyID() return i; } return Facts.Length - 1;*/ + NextEmpties.Sort(); - int id = NextEmptyStack.Pop(); - if (NextEmptyStack.Count == 0) - NextEmptyStack.Push(id + 1); + int id = NextEmpties[0]; + NextEmpties.RemoveAt(0); + if (NextEmpties.Count == 0) + NextEmpties.Add(id + 1); Debug.Log("place fact at " + id); diff --git a/Assets/TreeWorld.unity b/Assets/TreeWorld.unity index 7461e9e1b4ba5fdebf2b7644a63751b8cab8e13a..fb27008ef47010c3c8818ab3fbb26b9b4cf4c618 100644 --- a/Assets/TreeWorld.unity +++ b/Assets/TreeWorld.unity @@ -324,7 +324,7 @@ RectTransform: 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: 442, y: 405.5} + m_AnchoredPosition: {x: 442, y: 209} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &154206643 @@ -1448,7 +1448,7 @@ RectTransform: 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: 133, y: 0} + m_AnchoredPosition: {x: 133, y: -110} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1017737550 @@ -1846,7 +1846,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -349} + m_AnchoredPosition: {x: 0, y: -459} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1351049952 @@ -2220,10 +2220,10 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} + m_ReferenceResolution: {x: 1920, y: 1080} m_ScreenMatchMode: 0 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3