public void selectProject(ProjectListItem item)
 {
     for (int i = 0; i < projectListEntries.Count; i++)
     {
         toggleButton toggle = projectListEntries[i].GetComponent <toggleButton>();
         if (toggle != null)
         {
             if (i == item.index && !toggle.IsPressed)
             {
                 // select it!
                 toggle.changeState();
                 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                 // !!!                                             !!!
                 // !!!   THIS IS WHERE YOU WILL LOAD THE PROJECT   !!!
                 // !!!                                             !!!
                 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                 // Config.projectId = projectListEntries[i].id;
                 SceneManager.LoadScene(BUILD_SETTING_MOBILE_INTERFACE);
                 break;
             }
             else if (toggle.IsPressed)
             {
                 // deselect it!
                 toggle.changeState();
             }
         }
     }
 }
    // Select an object in the world by clicking its name in the outliner. Currently broken.
    public void selectedInOutliner(OutlinerItemManager item)
    {
        Debug.Log("Selected in outliner");

        for (int j = 0; j < OutlinerItems.Count; j++)
        {
            toggleButton toggle = OutlinerItems[j].GetComponent <toggleButton>();
            if (toggle != null)
            {
                if (j == item.index && !toggle.IsPressed)
                {
                    // select it!
                    //toggle.changeState();
                    if (gizmo != null)
                    {
                        gizmo.ClearAndAddTarget(item.obj.transform);
                    }
                    else
                    {
                        Debug.Log("gizmo is null in select()");
                    }
                }
                else if (toggle.IsPressed)
                {
                    // deselect it!
                    //toggle.changeState();
                }
            }
        }
    }
Beispiel #3
0
 public void selectTool(int selected)
 {
     RuntimeGizmos.TransformGizmo transformGizmo = mainCamera.GetComponent <RuntimeGizmos.TransformGizmo>();
     for (int i = 0; i < toolButtons.Length; i++)
     {
         toggleButton toggle = toolButtons[i].GetComponent <toggleButton>();
         // If we've reached the index of the tool the user wants to use, activate it if it is not already active.
         if (i == selected && toggle != null && !toggle.IsPressed)
         {
             toggle.changeState();
             transformGizmo.transformType = getTransformType(i, transformGizmo.transformType);
         }
         // Otherwise, deactivate the tool at this index.
         else if (toggle != null & toggle.IsPressed)
         {
             toggle.changeState();
         }
     }
 }
    // Select an object in the outliner when clicking the object in the world. Currently not broken
    // ... probably.
    public void selectedInWorld(Transform item)
    {
        Debug.Log("Selected in world");

        for (int j = 0; j < OutlinerItems.Count; j++)
        {
            toggleButton toggle = OutlinerItems[j].GetComponent <toggleButton>();
            if (toggle != null)
            {
                // The fact that these toggle commands are commented out may be problematic though.
                if (OutlinerItems[j].GetComponent <OutlinerItemManager>().obj.transform == item && !toggle.IsPressed)
                {
                    // select it!
                    //toggle.changeState();
                }
                else if (toggle.IsPressed)
                {
                    // deselect it!
                    //toggle.changeState();
                }
            }
        }
    }