public void RemoveAllPrefabAssociations()
        {
            List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();

            foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
            {
                GetSettingsForTileConnectionType(tileConnectionType).Prefab = null;
            }
        }
        private void RenderViewForEachTileConnectionType()
        {
            List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();

            for (int tileConnectionIndex = 0; tileConnectionIndex < allTileConnectionTypes.Count; ++tileConnectionIndex)
            {
                _settings.GetSettingsForTileConnectionType(allTileConnectionTypes[tileConnectionIndex]).View.Render();
            }
        }
        public void RecordAllTileConnectionTypeSettingsForUndo()
        {
            List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();

            foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
            {
                UndoEx.RecordForToolAction(GetSettingsForTileConnectionType(tileConnectionType));
            }
        }
        public void RemovePrefabAssociation(Prefab prefab)
        {
            List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();

            foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
            {
                ObjectPlacementPathTileConnectionTypeSettings tileConnectionTypeSettings = GetSettingsForTileConnectionType(tileConnectionType);
                if (tileConnectionTypeSettings.Prefab == prefab)
                {
                    tileConnectionTypeSettings.Prefab = null;
                }
            }
        }
        public bool UsesSprites()
        {
            List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();

            foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
            {
                ObjectPlacementPathTileConnectionTypeSettings tileConnectionTypeSettings = GetSettingsForTileConnectionType(tileConnectionType);
                if (tileConnectionTypeSettings.Prefab != null && tileConnectionTypeSettings.Prefab.UnityPrefab.IsSprite())
                {
                    return(true);
                }
            }

            return(false);
        }
        public List <Prefab> GetAllTileConnectionPrefabs(bool ignoreAutofill)
        {
            List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();
            List <Prefab> allTileConnectionPrefabs = new List <Prefab>(ObjectPlacementPathTileConnectionTypes.Count);

            foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
            {
                if (tileConnectionType == ObjectPlacementPathTileConnectionType.Autofill && ignoreAutofill)
                {
                    continue;
                }
                allTileConnectionPrefabs.Add(GetSettingsForTileConnectionType(tileConnectionType).Prefab);
            }

            return(allTileConnectionPrefabs);
        }
        public void ApplyConfigurationDataToSettings(ObjectPlacementPathTileConnectionSettings tileConnectionSettings)
        {
            List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();

            foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
            {
                int tileConnectionIndex = (int)tileConnectionType;
                ObjectPlacementPathTileConnectionTypeSettings tileConnectionTypeSettings = tileConnectionSettings.GetSettingsForTileConnectionType(tileConnectionType);

                tileConnectionTypeSettings.YAxisRotation            = _tileConnectionYAxisRotations[tileConnectionIndex];
                tileConnectionTypeSettings.YOffset                  = _tileConnectionYOffsets[tileConnectionIndex];
                tileConnectionTypeSettings.UpwardsExtrusionAmount   = _tileConnectionUpwardsExtrusionAmount[tileConnectionIndex];
                tileConnectionTypeSettings.DownwardsExtrusionAmount = _tileConnectionDownwardsExtrusionAmount[tileConnectionIndex];
                tileConnectionTypeSettings.Prefab = _tileConnectionPrefabs[tileConnectionIndex];
            }
        }
 private void RenderSetCommonYAxisRotationButton()
 {
     if (GUILayout.Button(GetContentForSetCommonYAxisRotationButton(), GUILayout.Width(_setCommonTilePropertyButtonWidth)))
     {
         List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();
         foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
         {
             UndoEx.RecordForToolAction(_settings.GetSettingsForTileConnectionType(tileConnectionType));
             _settings.GetSettingsForTileConnectionType(tileConnectionType).YAxisRotation = _settings.CommonYAxisRotation;
         }
     }
 }
        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;
                }
            }
        }
        private void RenderSetCommonDownwardsExtrusionAmountButton()
        {
            if (GUILayout.Button(GetContentForSetCommonDownwardsExtrusionAmountButton(), GUILayout.Width(_setCommonTilePropertyButtonWidth)))
            {
                List <ObjectPlacementPathTileConnectionType> allTileConnectionTypes = ObjectPlacementPathTileConnectionTypes.GetAll();
                foreach (ObjectPlacementPathTileConnectionType tileConnectionType in allTileConnectionTypes)
                {
                    UndoEx.RecordForToolAction(_settings.GetSettingsForTileConnectionType(tileConnectionType));
                    _settings.GetSettingsForTileConnectionType(tileConnectionType).DownwardsExtrusionAmount = _settings.CommonDownwardsExtrusionAmount;
                }

                SceneView.RepaintAll();
            }
        }