Skip to content

Commit 4786ee8

Browse files
committed
Minor method name change + remove unused method
1 parent 640b7eb commit 4786ee8

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed

Assets/scripts/FilterTypeBehaviour.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ private void GenerateButtons(List<string> foundStrings)
3838
{
3939
foreach (string FoundCategory in foundStrings)
4040
{
41-
Debug.Log("Found "+FoundCategory);
42-
4341
GameObject FilterButton = Instantiate(TypePrefab);
4442

4543
FilterButton.GetComponentInChildren<Text>().text = FoundCategory;
@@ -51,9 +49,9 @@ private void GenerateButtons(List<string> foundStrings)
5149
if (ContentForScroll != null)
5250
{
5351
FilterButton.transform.SetParent(ContentForScroll.transform, false);
54-
Debug.Log("IF ACCESSED");
5552
}
56-
else {
53+
else
54+
{
5755
FilterButton.transform.SetParent(ParentPanel.transform, false);
5856
}
5957

@@ -66,8 +64,6 @@ private void ActivateFilter(GameObject ButtonPressed)
6664
string ButtonText = ButtonPressed.GetComponentInChildren<Text>().text;
6765

6866
GameObject SearchBox = GameObject.Find("InputField");
69-
Debug.Log(SearchBox);
70-
Debug.Log(ButtonText);
7167

7268
SearchBox.GetComponent<InputField>().text = ButtonText;
7369
CatalogueScript.showingItems = true;
@@ -84,9 +80,4 @@ private void SetButtonSize(GameObject Button)
8480
rt.sizeDelta = new Vector2(ParentPanel.GetComponent<RectTransform>().rect.width - SIDEGAP, HEIGHT);
8581
}
8682

87-
// Update is called once per frame
88-
void Update()
89-
{
90-
91-
}
9283
}

Assets/scripts/LoadCatalog.cs

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void Start()
5151
itemManager = GameObject.Find("Item Manager").GetComponent<ItemManager>();
5252

5353
loadedItems = itemManager.GetItemList();
54-
GenerateLists();
54+
GenerateAllListingFromItemManager();
5555
int listingNo = 0;
5656
foreach (Item itemInList in loadedItems)
5757
{
@@ -81,9 +81,6 @@ void Start()
8181
listingNo++;
8282
}
8383

84-
Debug.Log($"List<T>: {itemListings.Count}");
85-
86-
8784
listingNo = 0;
8885
foreach (string category in foundCategories)
8986
{
@@ -207,8 +204,6 @@ public void SearchCatalog()
207204
return;
208205
}
209206

210-
Debug.Log("Searching for: " + search);
211-
212207
List<Item> searchResults = new List<Item>();
213208

214209
foreach (Item foundItem in loadedItems)
@@ -254,7 +249,7 @@ public void SearchCatalog()
254249

255250
}
256251

257-
hideListings();
252+
HideListings();
258253

259254
foreach (Item toShow in searchResults)
260255
{
@@ -263,7 +258,7 @@ public void SearchCatalog()
263258
}
264259

265260
//Hides all listings currently visible
266-
private void hideListings()
261+
private void HideListings()
267262
{
268263
List<GameObject> listingsToHide = new List<GameObject>();
269264

@@ -287,38 +282,30 @@ private void hideListings()
287282
//Shows listing that is passed in and updates visible/disabled lists
288283
private void showListing(Item listing)
289284
{
290-
Debug.Log($"Looking for: Listing: {listing.GetItemID()} {listing.GetName()}");
291-
292285
GameObject content = GameObject.Find("Content");
293-
GameObject toShow = content.transform.Find($"Listing: { listing.GetItemID()} { listing.GetName()}").gameObject;
286+
GameObject itemFound = content.transform.Find($"Listing: { listing.GetItemID()} { listing.GetName()}").gameObject;
294287

295-
toShow.SetActive(true);
288+
itemFound.SetActive(true);
296289

297-
visibleListings.Add(toShow);
298-
disabledListings.Remove(toShow);
290+
visibleListings.Add(itemFound);
291+
disabledListings.Remove(itemFound);
299292
UpdateItemManagerModels();
300293
}
301294

302295
private void NavigateToInfoScene(Item itemToShow)
303296
{
304-
Debug.Log("Navigate to infoscene");
305297
itemSceneController.GetComponent<ItemDisplayPanelBehaviour>().SetCurrentItem(itemToShow);
306298
}
307299

308-
private void GenerateLists()
300+
private void GenerateAllListingFromItemManager()
309301
{
310302
foreach (Item item in loadedItems)
311303
{
312-
313304
List<string> itemCategories = item.GetCategories();
314305

315306
foreach (string category in itemCategories)
316307
{
317-
if (foundCategories.Contains(category))
318-
{
319-
Debug.Log($"Category {category} is already in foundCategories.");
320-
}
321-
else
308+
if (!foundCategories.Contains(category))
322309
{
323310
foundCategories.Add(category);
324311
}
@@ -339,16 +326,13 @@ private void GenerateLists()
339326
foundCategories.Sort();
340327
foundBrands.Sort();
341328
foundDesigners.Sort();
342-
343-
var result = string.Join(", ", foundCategories.ToArray());
344-
Debug.Log($"Categories loaded: {result}");
345329
}
346330

347331
public void ChangeContentToCategory(string category)
348332
{
349333
GameObject content = GameObject.Find("Content");
350334

351-
hideListings();
335+
HideListings();
352336

353337
foreach (Item itemInList in loadedItems)
354338
{
@@ -361,9 +345,4 @@ public void ChangeContentToCategory(string category)
361345
showingItems = true;
362346
}
363347

364-
// Update is called once per frame
365-
void Update()
366-
{
367-
368-
}
369348
}

Assets/scripts/SwitchToCameraScene.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ void Update()
1919

2020
public void SwitchToCamera()
2121
{
22-
SceneManager.LoadScene("ARScene");
22+
SceneManager.LoadScene("ARManipulation");
2323
}
2424
}

0 commit comments

Comments
 (0)