Ejemplo n.º 1
0
    // Use this for initialization
    public void Start()
    {
        sceneButton  = UnityUIUtil.FindButtonAndAddClickHandler("SceneTab", on_scene);
        objectButton = UnityUIUtil.FindButtonAndAddClickHandler("ObjectTab", on_object);

        scenePanel  = this.gameObject.FindChildByName("SceneScrollView", true);
        objectPanel = this.gameObject.FindChildByName("ObjectScrollView", true);

        visiblePanel = VisiblePanel.ObjectPanel;
        update_visibility();

        panelSetup = this;
    }
Ejemplo n.º 2
0
        /// <summary>
        /// called on scene & selection changes, to update the global current PrintSettings object
        /// (which currently can only be applied to a single object at a time)
        /// </summary>
        public static void UpdateObjectSettings()
        {
            if (CC.ObjSettings.IsActive)
            {
                CC.ObjSettings.WriteToCurrentSettings();
            }

            List <PrintMeshSO> meshes   = CC.ActiveScene.FindSceneObjectsOfType <PrintMeshSO>();
            List <PrintMeshSO> selected = CC.ActiveScene.FindSceneObjectsOfType <PrintMeshSO>(true);

            // invalid scene/selection, clear settings and hide panel
            if (meshes.Count == 0 || (meshes.Count > 1 && selected.Count != 1))
            {
                CC.ObjSettings.ClearCurrentSettings();
            }
            else
            {
                // upate for current object
                PrintMeshSO so = (meshes.Count == 1) ? meshes[0] : selected[0];
                CC.ObjSettings.UpdateFromSettings(so);
            }

            ObjectsTabbedPanelSetup.UpdateVisibilityFromSelection();
        }