Exemplo n.º 1
0
 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);
     });
 }
Exemplo n.º 2
0
    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;
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 private GUIObjectNodeHelper(ObjectNode objectNode, IUnifiedContainerPropertyDrawer.SerializedContainer serializedContainer)
 {
     _objectNode          = objectNode;
     _serializedContainer = serializedContainer;
     _displayFoldout      = _objectNode.Children.Any();
 }
 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;
    }