#35 generate ores from resource folder
3 files modified
4 files renamed
5 files added
1 files copied
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 97b6063fa71536b4e87a96b6218fb104 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
File was renamed from Assets/TileSets/Palettes/DrillIronOre.prefab |
| | |
| | | - component: {fileID: 3926666667628910059} |
| | | - component: {fileID: 5943816882416256805} |
| | | m_Layer: 6 |
| | | m_Name: DrillIronOre |
| | | m_Name: IronOre |
| | | m_TagString: Untagged |
| | | m_Icon: {fileID: 0} |
| | | m_NavMeshLayer: 0 |
| | |
| | | weight: 7 |
| | | clusterWeight: 30 |
| | | minClusterSize: 8 |
| | | tile: {fileID: 11400000, guid: bbc5a3964d8331546a4dbc880f8ae9fc, type: 2} |
| | | maxSpawnHeight: 250 |
| | | minSpawnHeight: 150 |
| | | sprite: {fileID: 21300000, guid: 83ee72e0f385a7641b729c9f5c288e74, type: 3} |
copy from Assets/TileSets/Palettes/DrillIronOre.prefab
copy to Assets/Resources/Generateable/IronOreHigh.prefab
File was copied from Assets/TileSets/Palettes/DrillIronOre.prefab |
| | |
| | | - component: {fileID: 3926666667628910059} |
| | | - component: {fileID: 5943816882416256805} |
| | | m_Layer: 6 |
| | | m_Name: DrillIronOre |
| | | m_Name: IronOreHigh |
| | | m_TagString: Untagged |
| | | m_Icon: {fileID: 0} |
| | | m_NavMeshLayer: 0 |
| | |
| | | m_EditorClassIdentifier: |
| | | isDropable: 1 |
| | | dropable: {fileID: 7215668260114684477, guid: ead8eea59ce41c244814a994365e1129, type: 3} |
| | | dropAmount: 2 |
| | | dropAmount: 4 |
| | | --- !u!114 &5943816882416256805 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | |
| | | m_Name: |
| | | m_EditorClassIdentifier: |
| | | isGenerateable: 1 |
| | | weight: 7 |
| | | clusterWeight: 30 |
| | | minClusterSize: 8 |
| | | tile: {fileID: 11400000, guid: bbc5a3964d8331546a4dbc880f8ae9fc, type: 2} |
| | | maxSpawnHeight: 250 |
| | | minSpawnHeight: 150 |
| | | weight: 8 |
| | | clusterWeight: 25 |
| | | minClusterSize: 4 |
| | | maxSpawnHeight: 200 |
| | | minSpawnHeight: 100 |
| | | sprite: {fileID: 21300000, guid: f2e947bf683bb8e419d65be7f14b0679, type: 3} |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ab4d91bcb33d69e438751ef6299da505 |
| | | PrefabImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0538179ca52d13c40969742a1a14306d |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.Tilemaps; |
| | | using UnityEngine.UIElements; |
| | | using static UnityEditor.Progress; |
| | | |
| | | //[Serializable] |
| | | //public class Ore |
| | |
| | | SetSettingsFromSeed(seed.Value); |
| | | |
| | | transform.position = new Vector3((maxWidth / 2) * -1, (maxGroundHeight + 1) * -1, transform.position.z); |
| | | |
| | | LoadGenerateablesFromResources(); |
| | | } |
| | | private void LoadGenerateablesFromResources() |
| | | { |
| | | // Load all Item prefabs from the "Resources/Items" folder |
| | | GameObject[] generateablePrefabs = Resources.LoadAll<GameObject>("Generateable"); |
| | | generateables = new List<Generateable>(); |
| | | foreach (GameObject prefab in generateablePrefabs) |
| | | { |
| | | Generateable generateable = prefab.GetComponent<Generateable>(); |
| | | if (generateable != null) |
| | | { |
| | | generateable.tile = ScriptableObject.CreateInstance<CustomRuleTile>(); |
| | | generateable.tile.m_DefaultGameObject = prefab; |
| | | generateable.tile.m_DefaultSprite = generateable.sprite; |
| | | generateables.Add(generateable); |
| | | forestRuleTile.siblings.Add(generateable.tile); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogWarning($"Prefab {prefab.name} does not have an Item component"); |
| | | } |
| | | } |
| | | |
| | | if (generateables.Count == 0) |
| | | { |
| | | Debug.LogWarning("No items found in Resources/Items folder"); |
| | | } |
| | | } |
| | | |
| | | public void SetSettingsFromSeed(int seed) |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using Unity.VisualScripting; |
| | | using UnityEngine; |
| | | |
| | | [Serializable] |
| | |
| | | [Range(10, 100000)] |
| | | public int clusterWeight; |
| | | public int minClusterSize; |
| | | public CustomRuleTile tile; |
| | | internal CustomRuleTile tile; |
| | | public int maxSpawnHeight; |
| | | public int minSpawnHeight; |
| | | public Sprite sprite; |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f2e947bf683bb8e419d65be7f14b0679 |
| | | TextureImporter: |
| | | internalIDToNameTable: [] |
| | | externalObjects: {} |
| | | serializedVersion: 12 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 0 |
| | | sRGBTexture: 1 |
| | | linearTexture: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapsPreserveCoverage: 0 |
| | | alphaTestReferenceValue: 0.5 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: 0.25 |
| | | normalMapFilter: 0 |
| | | flipGreenChannel: 0 |
| | | isReadable: 0 |
| | | streamingMipmaps: 0 |
| | | streamingMipmapsPriority: 0 |
| | | vTOnly: 0 |
| | | ignoreMipmapLimit: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 6 |
| | | cubemapConvolution: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: 1 |
| | | maxTextureSize: 2048 |
| | | textureSettings: |
| | | serializedVersion: 2 |
| | | filterMode: 0 |
| | | aniso: 1 |
| | | mipBias: 0 |
| | | wrapU: 1 |
| | | wrapV: 1 |
| | | wrapW: 1 |
| | | nPOTScale: 0 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 1 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: 0.5, y: 0.5} |
| | | spritePixelsToUnits: 16 |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spriteGenerateFallbackPhysicsShape: 1 |
| | | alphaUsage: 1 |
| | | alphaIsTransparency: 1 |
| | | spriteTessellationDetail: -1 |
| | | textureType: 8 |
| | | textureShape: 1 |
| | | singleChannelComponent: 0 |
| | | flipbookRows: 1 |
| | | flipbookColumns: 1 |
| | | maxTextureSizeSet: 0 |
| | | compressionQualitySet: 0 |
| | | textureFormatSet: 0 |
| | | ignorePngGamma: 0 |
| | | applyGammaDecoding: 0 |
| | | swizzle: 50462976 |
| | | cookieLightType: 0 |
| | | platformSettings: |
| | | - serializedVersion: 3 |
| | | buildTarget: DefaultTexturePlatform |
| | | maxTextureSize: 4096 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 0 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | ignorePlatformSupport: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | - serializedVersion: 3 |
| | | buildTarget: Standalone |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | ignorePlatformSupport: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | - serializedVersion: 3 |
| | | buildTarget: Server |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | ignorePlatformSupport: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | spriteSheet: |
| | | serializedVersion: 2 |
| | | sprites: [] |
| | | outline: [] |
| | | physicsShape: [] |
| | | bones: [] |
| | | spriteID: 5e97eb03825dee720800000000000000 |
| | | internalID: 0 |
| | | vertices: [] |
| | | indices: |
| | | edges: [] |
| | | weights: [] |
| | | secondaryTextures: [] |
| | | nameFileIdTable: {} |
| | | mipmapLimitGroupName: |
| | | pSDRemoveMatte: 0 |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | m_DefaultSprite: {fileID: 21300000, guid: 83ee72e0f385a7641b729c9f5c288e74, type: 3} |
| | | m_DefaultGameObject: {fileID: 3549545049718014148, guid: 858e9987645c29748a5b0990923da82f, type: 3} |
| | | m_DefaultColliderType: 1 |
| | | m_TilingRules: |
| | | - m_Id: 0 |
| | | m_Sprites: |
| | | - {fileID: 21300000, guid: 83ee72e0f385a7641b729c9f5c288e74, type: 3} |
| | | m_GameObject: {fileID: 3549545049718014148, guid: 858e9987645c29748a5b0990923da82f, type: 3} |
| | | m_MinAnimationSpeed: 1 |
| | | m_MaxAnimationSpeed: 1 |
| | | m_PerlinScale: 0.5 |
| | | m_Output: 0 |
| | | m_ColliderType: 1 |
| | | m_RandomTransform: 0 |
| | | m_Neighbors: 0200000002000000020000000200000002000000020000000200000002000000 |
| | | m_NeighborPositions: |
| | | - {x: -1, y: 1, z: 0} |
| | | - {x: -1, y: 0, z: 0} |
| | | - {x: -1, y: -1, z: 0} |
| | | - {x: 0, y: -1, z: 0} |
| | | - {x: 1, y: 0, z: 0} |
| | | - {x: 0, y: 1, z: 0} |
| | | - {x: 1, y: 1, z: 0} |
| | | - {x: 1, y: -1, z: 0} |
| | | m_RuleTransform: 0 |
| | | siblings: |
| | | - {fileID: 11400000, guid: 3999614e192b37546a6b710bf5ceb30c, type: 2} |
| | | m_TilingRules: [] |
| | | siblings: [] |