public static void ObjectNodeGUI(ObjectNode objectNode, IUnifiedContainerPropertyDrawer.SerializedContainer serializedContainer, GUIStyle style, int indentLevel) { IUnifiedGUIHelper.HorizontalBlock(() => { var helper = new GUIObjectNodeHelper(objectNode, serializedContainer); helper.DrawGUI(style, indentLevel); }); }
private void Initialize(string resultTypeName, bool selectingForProjectAsset, IUnifiedContainerPropertyDrawer.SerializedContainer serializedContainer, IEnumerable <IUnifiedContainerPropertyDrawer.SelectableObject> selectableObject) { serializedContainer.SetSelecting(true); _resultTypeName = resultTypeName; _selectingForProjectAsset = selectingForProjectAsset; titleContent = new GUIContent($"Implementing {_resultTypeName} {(_selectingForProjectAsset ? "( project assets only )" : "")}"); _serializedContainer = serializedContainer; _allObjects = new SelectableObjectsHierarchyBuilder().BuildSelectableObjectsList(selectableObject, _serializedContainer.ObjectField, out _selectingProjectAssets); _projectAssets = _allObjects.Where(g => g.IsProjectAsset).ToList(); _sceneAssets = _allObjects.Where(g => !g.IsProjectAsset).ToList(); _projectAssetsExist = _projectAssets.Any(); _sceneAssetsExist = _sceneAssets.Any(); _selectingProjectAssets = (_selectingProjectAssets || _selectingForProjectAsset) || (_projectAssetsExist && !_sceneAssetsExist); _close = false; }
public static IUnifiedContainerSelectWindow ShowSelectWindow(string resultTypeName, bool selectingForProjectAsset, IUnifiedContainerPropertyDrawer.SerializedContainer serializedContainer, IEnumerable <IUnifiedContainerPropertyDrawer.SelectableObject> selectableObjects) { var window = (IUnifiedContainerSelectWindow)CreateInstance(typeof(IUnifiedContainerSelectWindow)); window.Initialize(resultTypeName, selectingForProjectAsset, serializedContainer, selectableObjects); window.ShowUtility(); return(window); }
private GUIObjectNodeHelper(ObjectNode objectNode, IUnifiedContainerPropertyDrawer.SerializedContainer serializedContainer) { _objectNode = objectNode; _serializedContainer = serializedContainer; _displayFoldout = _objectNode.Children.Any(); }
private void Initialize(string resultTypeName, bool selectingForProjectAsset, IUnifiedContainerPropertyDrawer.SerializedContainer serializedContainer, IEnumerable<IUnifiedContainerPropertyDrawer.SelectableObject> selectableObject) { serializedContainer.SetSelecting(true); _resultTypeName = resultTypeName; _selectingForProjectAsset = selectingForProjectAsset; title = string.Format("Implementing {0} {1}", _resultTypeName, _selectingForProjectAsset ? "( project assets only )" : ""); _serializedContainer = serializedContainer; _allObjects = new SelectableObjectsHierarchyBuilder().BuildSelectableObjectsList(selectableObject, _serializedContainer.ObjectField, out _selectingProjectAssets); _projectAssets = _allObjects.Where(g => g.IsProjectAsset).ToList(); _sceneAssets = _allObjects.Where(g => !g.IsProjectAsset).ToList(); _projectAssetsExist = _projectAssets.Any(); _sceneAssetsExist = _sceneAssets.Any(); _selectingProjectAssets = (_selectingProjectAssets || _selectingForProjectAsset) || (_projectAssetsExist && !_sceneAssetsExist); _close = false; }