Ejemplo n.º 1
0
 public void RemoveTweakables(UserInterfaceTweakables tweakables)
 {
     foreach (var UIElement in tweakables.Elements)
     {
         Destroy(UIElement.gameObject);
     }
     foreach (var UIElement in tweakables.CameraElements)
     {
         Destroy(UIElement.gameObject);
     }
 }
Ejemplo n.º 2
0
 public void ToggleTweakable(UserInterfaceTweakables tweakables, string type, bool state)
 {
     foreach (var UIElement in tweakables.Elements)
     {
         if (UIElement.name.Contains(type))
         {
             Toggle toggle = UIElement.GetComponent <Toggle>();
             if (toggle != null)
             {
                 toggle.isOn = state;
             }
         }
     }
 }
Ejemplo n.º 3
0
    public void AddTweakables(UserInterfaceTweakables tweakables)
    {
        int childCount = MainPanel.childCount;

        foreach (var UIElement in tweakables.Elements)
        {
            UIElement.transform.SetParent(MainPanel);
            UIElement.transform.SetSiblingIndex(childCount - 1);
            UIElement.transform.localScale = Vector3.one;
        }
        foreach (var UIElement in tweakables.CameraElements)
        {
            UIElement.transform.SetParent(CameraPreviewPanel);
            UIElement.transform.localScale = Vector3.one;
        }
    }