Add service speech command
This commit is contained in:
parent
2b80596cba
commit
a1f5323758
|
@ -38,7 +38,7 @@ MonoBehaviour:
|
||||||
description: None
|
description: None
|
||||||
axisConstraint: 0
|
axisConstraint: 0
|
||||||
- localizationKey:
|
- localizationKey:
|
||||||
keyword: Hello
|
keyword: Service
|
||||||
keyCode: 0
|
keyCode: 0
|
||||||
action:
|
action:
|
||||||
id: 0
|
id: 0
|
||||||
|
|
|
@ -16,6 +16,8 @@ public class ServicesListPopulator : MonoBehaviour
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private GridObjectCollection gridObjectCollection;
|
private GridObjectCollection gridObjectCollection;
|
||||||
|
|
||||||
|
private bool isVisible = true;
|
||||||
|
|
||||||
public void AddItemFromService(MdnsService service, Action action)
|
public void AddItemFromService(MdnsService service, Action action)
|
||||||
{
|
{
|
||||||
GameObject itemInstance = Instantiate(dynamicItem, gridObjectCollection.transform);
|
GameObject itemInstance = Instantiate(dynamicItem, gridObjectCollection.transform);
|
||||||
|
@ -29,8 +31,20 @@ public class ServicesListPopulator : MonoBehaviour
|
||||||
{
|
{
|
||||||
Debug.Log($"Clicked on service: {service.Host}");
|
Debug.Log($"Clicked on service: {service.Host}");
|
||||||
action.Invoke();
|
action.Invoke();
|
||||||
|
ToggleVisibility();
|
||||||
});
|
});
|
||||||
|
|
||||||
gridObjectCollection.UpdateCollection();
|
gridObjectCollection.UpdateCollection();
|
||||||
|
scrollView.UpdateContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggleVisibility()
|
||||||
|
{
|
||||||
|
isVisible = !isVisible;
|
||||||
|
|
||||||
|
foreach (Renderer renderer in GetComponentsInChildren<Renderer>())
|
||||||
|
{
|
||||||
|
renderer.enabled = isVisible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue