Browse Source

Random Districts Part 1

master
laurids 2 years ago
parent
commit
7df36e91c2
3 changed files with 107 additions and 71 deletions
  1. +41
    -69
      Assets/GWConquest/Scenes/GalaxyMap.unity
  2. +0
    -2
      Assets/GWConquest/Scripts/District.cs
  3. +66
    -0
      Assets/GWConquest/Scripts/PlanetPlacement.cs

+ 41
- 69
Assets/GWConquest/Scenes/GalaxyMap.unity View File

@ -342,7 +342,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 14
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -2558,7 +2558,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &40190439
MonoBehaviour:
@ -5092,7 +5091,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District II
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &86848884
MonoBehaviour:
@ -5308,7 +5306,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 11
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -5662,7 +5660,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 9
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -7758,7 +7756,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District II
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &113413690
MonoBehaviour:
@ -9245,7 +9242,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District I
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &131868900
MonoBehaviour:
@ -11810,7 +11806,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 11
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -13071,7 +13067,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &214596037
MonoBehaviour:
@ -15400,7 +15395,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 9
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -16459,7 +16454,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -17669,7 +17664,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 84ab639475a53d14fb7cc01f622b3b22, type: 3}
DistrictName: Special District
Description:
IsCityDistrict: 0
DistrictType: 3
--- !u!114 &302288826
MonoBehaviour:
@ -17921,7 +17915,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 9
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -18987,7 +18981,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 84ab639475a53d14fb7cc01f622b3b22, type: 3}
DistrictName: Special District
Description:
IsCityDistrict: 0
DistrictType: 3
--- !u!114 &322489094
MonoBehaviour:
@ -19508,7 +19501,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 11
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -20083,7 +20076,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &353074288
MonoBehaviour:
@ -22599,7 +22591,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 9
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -23508,7 +23500,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 12
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -29510,7 +29502,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -30813,7 +30805,7 @@ PrefabInstance:
- target: {fileID: 4096209424460686482, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_SizeDelta.x
value: 13
value: 12.521121
objectReference: {fileID: 0}
- target: {fileID: 4096209424460686482, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
@ -30934,7 +30926,7 @@ PrefabInstance:
- target: {fileID: 4411086135142167815, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -65.8
value: -65.32112
objectReference: {fileID: 0}
- target: {fileID: 5945601791339210574, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
@ -35803,7 +35795,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 14
value: 11
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -36376,7 +36368,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -42027,7 +42019,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &755114448
MonoBehaviour:
@ -43226,7 +43217,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &769496622
MonoBehaviour:
@ -43750,7 +43740,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District II
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &776571280
MonoBehaviour:
@ -46343,7 +46332,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District III
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &829595064
MonoBehaviour:
@ -47610,7 +47598,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 84ab639475a53d14fb7cc01f622b3b22, type: 3}
DistrictName: Special District
Description:
IsCityDistrict: 0
DistrictType: 3
--- !u!114 &853110023
MonoBehaviour:
@ -48700,7 +48687,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &884239768
MonoBehaviour:
@ -50209,7 +50195,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 9
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -50457,7 +50443,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 11
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -55708,7 +55694,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -59639,7 +59625,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 14
value: 12
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -60436,7 +60422,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 13
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -61247,7 +61233,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 8cc0e0c4f06ba004fb7ba3358f07744f, type: 3}
DistrictName: Agri-District I
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1091417642
MonoBehaviour:
@ -65195,7 +65180,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1147370008
MonoBehaviour:
@ -66112,7 +66096,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 84ab639475a53d14fb7cc01f622b3b22, type: 3}
DistrictName: Special District
Description:
IsCityDistrict: 0
DistrictType: 3
--- !u!114 &1166148167
MonoBehaviour:
@ -67617,7 +67600,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -68371,7 +68354,7 @@ PrefabInstance:
- target: {fileID: 4096209424460686482, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_SizeDelta.x
value: 13
value: 12.521121
objectReference: {fileID: 0}
- target: {fileID: 4096209424460686483, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
@ -68422,7 +68405,7 @@ PrefabInstance:
- target: {fileID: 4411086135142167815, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 65.87012
value: 65.391235
objectReference: {fileID: 0}
- target: {fileID: 5945601791339210574, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
@ -68483,7 +68466,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1213153681
MonoBehaviour:
@ -69116,7 +69098,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1229600187
MonoBehaviour:
@ -69748,7 +69729,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 15
value: 12
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -71173,7 +71154,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 84ab639475a53d14fb7cc01f622b3b22, type: 3}
DistrictName: Special District
Description:
IsCityDistrict: 0
DistrictType: 3
--- !u!114 &1267657457
MonoBehaviour:
@ -72777,7 +72757,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 16
value: 13
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -81394,7 +81374,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District II
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1409165553
MonoBehaviour:
@ -81611,7 +81590,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 8cc0e0c4f06ba004fb7ba3358f07744f, type: 3}
DistrictName: Agri-District II
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1412114075
MonoBehaviour:
@ -82003,6 +81981,12 @@ MonoBehaviour:
MaxDustScale: 1.5
MinDustSaturation: 0
MaxDustSaturation: 0.3
districtSettings:
MaxDistricts: 4
MinDistricts: 1
FactoryChance: 0.3
FoodChance: 0.3
MaxDistrictRadius: 0.5
AvailableNames: []
--- !u!4 &1422402912
Transform:
@ -83584,7 +83568,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 9
value: 8
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -85351,7 +85335,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -86482,7 +86466,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 84ab639475a53d14fb7cc01f622b3b22, type: 3}
DistrictName: Special District
Description:
IsCityDistrict: 0
DistrictType: 3
--- !u!114 &1497715127
MonoBehaviour:
@ -87960,7 +87943,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 12
value: 11
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -92983,7 +92966,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District II
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1658452144
MonoBehaviour:
@ -96041,7 +96023,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1724478289
MonoBehaviour:
@ -97831,7 +97812,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District I
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1758196033
MonoBehaviour:
@ -98507,7 +98487,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 14
value: 11
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -105573,7 +105553,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1798405256
MonoBehaviour:
@ -107710,7 +107689,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: 84ab639475a53d14fb7cc01f622b3b22, type: 3}
DistrictName: Special District
Description:
IsCityDistrict: 0
DistrictType: 3
--- !u!114 &1846341752
MonoBehaviour:
@ -111108,7 +111086,7 @@ PrefabInstance:
- target: {fileID: 4096209424460686482, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_SizeDelta.x
value: 13
value: 12.521121
objectReference: {fileID: 0}
- target: {fileID: 4096209424460686482, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
@ -111234,7 +111212,7 @@ PrefabInstance:
- target: {fileID: 4411086135142167815, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -65.8
value: -65.32112
objectReference: {fileID: 0}
- target: {fileID: 5945601791339210574, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
@ -111737,7 +111715,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1924742659
MonoBehaviour:
@ -112290,7 +112267,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 10
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -112567,7 +112544,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1947037425
MonoBehaviour:
@ -112821,7 +112797,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District I
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1952294460
MonoBehaviour:
@ -113630,7 +113605,7 @@ PrefabInstance:
- target: {fileID: 2523886465982048557, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 9
objectReference: {fileID: 0}
- target: {fileID: 2646379100319094857, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
@ -115277,7 +115252,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District I
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &1976539134
MonoBehaviour:
@ -118589,7 +118563,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District I
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &2042552056
MonoBehaviour:
@ -122881,7 +122854,6 @@ MonoBehaviour:
DefaultSprite: {fileID: 21300000, guid: bd93e35d8eadb9844adef76ee7beacee, type: 3}
DistrictName: Agri-District
Description:
IsCityDistrict: 0
DistrictType: 2
--- !u!114 &2141017712
MonoBehaviour:
@ -124308,7 +124280,7 @@ PrefabInstance:
- target: {fileID: 4096209424460686482, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_SizeDelta.x
value: 13
value: 12.521121
objectReference: {fileID: 0}
- target: {fileID: 4096209424460686483, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
@ -124333,7 +124305,7 @@ PrefabInstance:
- target: {fileID: 4411086135142167815, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 65.87012
value: 65.391235
objectReference: {fileID: 0}
- target: {fileID: 5945601791339210574, guid: ada9ee8cb263a4e4ba2f5874cfe9098d,
type: 3}


+ 0
- 2
Assets/GWConquest/Scripts/District.cs View File

@ -15,8 +15,6 @@ namespace GWConquest
public string Description;
public bool IsCityDistrict;
public DistrictType DistrictType = DistrictType.Civil;
public Zone Zone { get; private set; }


+ 66
- 0
Assets/GWConquest/Scripts/PlanetPlacement.cs View File

@ -87,6 +87,20 @@ namespace GWConquest
public AsteroidSettings asteroidSettings = new AsteroidSettings();
[System.Serializable]
public class DistrictSettings
{
public int MaxDistricts;
public int MinDistricts;
public float FactoryChance;
public float FoodChance;
public float MaxDistrictRadius;
}
public DistrictSettings districtSettings = new DistrictSettings();
public List<string> AvailableNames = new List<string>();
private string DrawName()
@ -125,6 +139,12 @@ namespace GWConquest
nextZoneId++;
}
var numDistricts = Random.Range(districtSettings.MinDistricts, districtSettings.MaxDistricts);
for(int i = 0; i < numDistricts; i++)
{
SpawnDistrict(planet, ref nextZoneId);
}
return planet;
}
@ -144,6 +164,52 @@ namespace GWConquest
SpawnAsteroids(planet);
}
public void SpawnDistrict(Planet planet, ref int nextZoneId)
{
PrefabId prefabID;
DistrictType type;
if(Random.value <= districtSettings.FactoryChance)
{
prefabID = BoltPrefabs.Factory;
type = DistrictType.Factory;
}
else if(Random.value <= districtSettings.FoodChance / (1f - districtSettings.FactoryChance))
{
prefabID = BoltPrefabs.District;
type = DistrictType.Food;
}
else {
prefabID = BoltPrefabs.Factory;
type = DistrictType.Civil;
}
BoltLog.Info("Spawning district of type {0} on planet {1}", type, planet.name);
var point2D = Random.insideUnitCircle * districtSettings.MaxDistrictRadius;
var districtPos = new Vector3(point2D.x, Mathf.Sqrt(1f - point2D.x*point2D.x - point2D.y*point2D.y), point2D.y);
var coll = planet.GetComponentInChildren<SphereCollider>();
districtPos *= coll.radius * coll.transform.lossyScale.x;
var cameraPos = planet.planetCameraTransform.position;
districtPos = Quaternion.FromToRotation(Vector3.up, cameraPos - planet.transform.position) * districtPos;
districtPos += planet.transform.position;
var go = BoltNetwork.Instantiate(prefabID, districtPos, Quaternion.identity);
go.transform.SetParent(planet.transform);
var district = go.GetComponent<District>();
district.DistrictType = type;
var zone = go.GetComponent<Zone>();
zone.SetZoneId(nextZoneId);
zone.zoneType = ZoneType.Ground;
nextZoneId++;
}
public void SpawnAsteroids(Planet planet)
{
var parentTrans = planet.AsteroidsTransform;


Loading…
Cancel
Save