Exemple #1
0
 protected override void PerformDrop()
 {
     if (ObjectPlacementPathTileConnectionSettingsChangeValidation.Validate(true))
     {
         List <GameObject> validUnityPrefabsInvolvedInDropOperation = PrefabValidator.GetValidPrefabsFromEntityCollection(DragAndDrop.objectReferences, false);
         if (validUnityPrefabsInvolvedInDropOperation.Count != 0)
         {
             PerformDropUsingFirstPrefabInValidUnityPrefabCollection(validUnityPrefabsInvolvedInDropOperation);
         }
     }
 }
        private void RenderRemoveAllPrefabAssociationsButton()
        {
            if (GUILayout.Button(GetContentForRemoveAllPrefabAssociationsButton(), GUILayout.Width(_setCommonTilePropertyButtonWidth)))
            {
                if (!ObjectPlacementPathTileConnectionSettingsChangeValidation.Validate(true))
                {
                    return;
                }

                _settings.RecordAllTileConnectionTypeSettingsForUndo();
                _settings.RemoveAllPrefabAssociations();
            }
        }
Exemple #3
0
        private void RenderRemovePrefabAssociationButton()
        {
            if (GUILayout.Button(GetContentForRemovePrefabAssociationButton(), GUILayout.Width(EditorGUILayoutEx.PreferedActionButtonWidth)))
            {
                if (!ObjectPlacementPathTileConnectionSettingsChangeValidation.Validate(true))
                {
                    return;
                }

                UndoEx.RecordForToolAction(_settings);
                _settings.Prefab = null;
            }
        }
        private void RenderUseTileConnectionsToggle()
        {
            bool newBool = EditorGUILayout.ToggleLeft(GetContentForUseTileConnectionsToggle(), _settings.UseTileConnections);

            if (newBool != _settings.UseTileConnections)
            {
                if (!ObjectPlacementPathTileConnectionSettingsChangeValidation.Validate(true))
                {
                    return;
                }

                UndoEx.RecordForToolAction(_settings);
                _settings.UseTileConnections = newBool;
            }
        }
        private void RenderInheritPrefabButton()
        {
            if (GUILayout.Button(GetContentForInheritPrefabButton(), GUILayout.Width(_setCommonTilePropertyButtonWidth)))
            {
                if (!ObjectPlacementPathTileConnectionSettingsChangeValidation.Validate(true))
                {
                    return;
                }

                Prefab prefabToInherit = _settings.GetSettingsForTileConnectionType(_settings.PrefabInheritTileConnectionType).Prefab;
                List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();
                foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
                {
                    UndoEx.RecordForToolAction(_settings.GetSettingsForTileConnectionType(tileConnectionType));
                    _settings.GetSettingsForTileConnectionType(tileConnectionType).Prefab = prefabToInherit;
                }
            }
        }