Pull request #53: Origin/feature/berriesInteractions
Merge in CGD/gather-and-defend from origin/feature/berriesInteractions to main * commit '2ec32f883236a3eb4755287737f6dd1830827efc': fixes to berry harvesting - Déplacement des données de la case des buissons de baies; - Correction de la case des buissons pour qu'on puisse mettre des unités dessus. Création et implémentation des baies. Couramment, donne de la nourriture, mais pourra probablement donner des baies plus tard.
This commit is contained in:
commit
b3d11e2afc
@ -245,3 +245,7 @@ MonoBehaviour:
|
|||||||
_position: {x: 0, y: 0}
|
_position: {x: 0, y: 0}
|
||||||
_scale: {x: 1, y: 1}
|
_scale: {x: 1, y: 1}
|
||||||
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
||||||
|
_startPopulation: 5
|
||||||
|
_startFood: 50
|
||||||
|
_startWood: 0
|
||||||
|
_startRock: 0
|
||||||
|
|||||||
@ -197,3 +197,7 @@ MonoBehaviour:
|
|||||||
_position: {x: 0, y: 0}
|
_position: {x: 0, y: 0}
|
||||||
_scale: {x: 1, y: 1}
|
_scale: {x: 1, y: 1}
|
||||||
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
||||||
|
_startPopulation: 5
|
||||||
|
_startFood: 50
|
||||||
|
_startWood: 0
|
||||||
|
_startRock: 0
|
||||||
|
|||||||
@ -195,3 +195,7 @@ MonoBehaviour:
|
|||||||
_position: {x: 0, y: 0}
|
_position: {x: 0, y: 0}
|
||||||
_scale: {x: 1, y: 1}
|
_scale: {x: 1, y: 1}
|
||||||
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
||||||
|
_startPopulation: 5
|
||||||
|
_startFood: 50
|
||||||
|
_startWood: 0
|
||||||
|
_startRock: 0
|
||||||
|
|||||||
@ -225,3 +225,7 @@ MonoBehaviour:
|
|||||||
_position: {x: 0, y: 0}
|
_position: {x: 0, y: 0}
|
||||||
_scale: {x: 1, y: 1}
|
_scale: {x: 1, y: 1}
|
||||||
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
||||||
|
_startPopulation: 5
|
||||||
|
_startFood: 50
|
||||||
|
_startWood: 0
|
||||||
|
_startRock: 0
|
||||||
|
|||||||
@ -181,6 +181,8 @@ MonoBehaviour:
|
|||||||
_scale: {x: 1, y: 1}
|
_scale: {x: 1, y: 1}
|
||||||
- _key: Spawners
|
- _key: Spawners
|
||||||
_tiles:
|
_tiles:
|
||||||
|
- _tile: {fileID: 11400000, guid: 3723ba09738ef6245947ae3ba7978b21, type: 2}
|
||||||
|
_position: {x: -6, y: -1, z: 0}
|
||||||
- _tile: {fileID: 11400000, guid: 4002377ed7e87b34699f126f2b10c703, type: 2}
|
- _tile: {fileID: 11400000, guid: 4002377ed7e87b34699f126f2b10c703, type: 2}
|
||||||
_position: {x: -1, y: -3, z: 0}
|
_position: {x: -1, y: -3, z: 0}
|
||||||
- _tile: {fileID: 11400000, guid: 4002377ed7e87b34699f126f2b10c703, type: 2}
|
- _tile: {fileID: 11400000, guid: 4002377ed7e87b34699f126f2b10c703, type: 2}
|
||||||
@ -201,3 +203,7 @@ MonoBehaviour:
|
|||||||
_position: {x: 0, y: 0}
|
_position: {x: 0, y: 0}
|
||||||
_scale: {x: 1, y: 1}
|
_scale: {x: 1, y: 1}
|
||||||
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
||||||
|
_startPopulation: 5
|
||||||
|
_startFood: 50
|
||||||
|
_startWood: 0
|
||||||
|
_startRock: 0
|
||||||
|
|||||||
@ -164,6 +164,10 @@ MonoBehaviour:
|
|||||||
_position: {x: -7, y: 1, z: 0}
|
_position: {x: -7, y: 1, z: 0}
|
||||||
- _tile: {fileID: 11400000, guid: e74655ccbd41a2b46b1ec9615aba0301, type: 2}
|
- _tile: {fileID: 11400000, guid: e74655ccbd41a2b46b1ec9615aba0301, type: 2}
|
||||||
_position: {x: -6, y: 1, z: 0}
|
_position: {x: -6, y: 1, z: 0}
|
||||||
|
- _tile: {fileID: 11400000, guid: 3723ba09738ef6245947ae3ba7978b21, type: 2}
|
||||||
|
_position: {x: -5, y: -3, z: 0}
|
||||||
|
- _tile: {fileID: 11400000, guid: 3723ba09738ef6245947ae3ba7978b21, type: 2}
|
||||||
|
_position: {x: -5, y: -1, z: 0}
|
||||||
- _tile: {fileID: 11400000, guid: e74655ccbd41a2b46b1ec9615aba0301, type: 2}
|
- _tile: {fileID: 11400000, guid: e74655ccbd41a2b46b1ec9615aba0301, type: 2}
|
||||||
_position: {x: -5, y: 1, z: 0}
|
_position: {x: -5, y: 1, z: 0}
|
||||||
- _tile: {fileID: 11400000, guid: e74655ccbd41a2b46b1ec9615aba0301, type: 2}
|
- _tile: {fileID: 11400000, guid: e74655ccbd41a2b46b1ec9615aba0301, type: 2}
|
||||||
@ -203,3 +207,7 @@ MonoBehaviour:
|
|||||||
_position: {x: 0, y: 0}
|
_position: {x: 0, y: 0}
|
||||||
_scale: {x: 1, y: 1}
|
_scale: {x: 1, y: 1}
|
||||||
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
_waveConfig: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
||||||
|
_startPopulation: 5
|
||||||
|
_startFood: 50
|
||||||
|
_startWood: 0
|
||||||
|
_startRock: 0
|
||||||
|
|||||||
@ -17,6 +17,8 @@ public class DatabaseEditor : Editor
|
|||||||
{
|
{
|
||||||
var targ = target as Database;
|
var targ = target as Database;
|
||||||
|
|
||||||
|
targ.ScriptableObjects.Clear();
|
||||||
|
targ.Prefabs.Clear();
|
||||||
foreach (var folder in targ.Folders)
|
foreach (var folder in targ.Folders)
|
||||||
{
|
{
|
||||||
var path = AssetDatabase.GetAssetPath(folder);
|
var path = AssetDatabase.GetAssetPath(folder);
|
||||||
|
|||||||
@ -424,7 +424,9 @@ MonoBehaviour:
|
|||||||
_resource: 0
|
_resource: 0
|
||||||
- _harvesterPrefab: {fileID: 6962989255644195630}
|
- _harvesterPrefab: {fileID: 6962989255644195630}
|
||||||
_resource: 1
|
_resource: 1
|
||||||
_resourceChoice: 1
|
- _harvesterPrefab: {fileID: 7670155643566295935, guid: 717a063ebb684a748b9f40cac33fab52, type: 3}
|
||||||
|
_resource: 3
|
||||||
|
_resourceNodeType: 1
|
||||||
--- !u!114 &557712884815233717
|
--- !u!114 &557712884815233717
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -1025,9 +1025,11 @@ MonoBehaviour:
|
|||||||
_resource: 2
|
_resource: 2
|
||||||
- _harvesterPrefab: {fileID: 6962989255644195630, guid: 8b50d9afb3bbd204d8dfea3d64f13fa2, type: 3}
|
- _harvesterPrefab: {fileID: 6962989255644195630, guid: 8b50d9afb3bbd204d8dfea3d64f13fa2, type: 3}
|
||||||
_resource: 0
|
_resource: 0
|
||||||
- _harvesterPrefab: {fileID: 7670155643566295935}
|
- _harvesterPrefab: {fileID: 6962989255644195630, guid: 02eb2d787f58e9943a0cb46d0b13e6b8, type: 3}
|
||||||
_resource: 1
|
_resource: 1
|
||||||
_resourceChoice: 1
|
- _harvesterPrefab: {fileID: 7670155643566295935}
|
||||||
|
_resource: 3
|
||||||
|
_resourceNodeType: 3
|
||||||
--- !u!114 &967491981311779556
|
--- !u!114 &967491981311779556
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -407,7 +407,7 @@ MonoBehaviour:
|
|||||||
_hp: 0
|
_hp: 0
|
||||||
_speed: 0
|
_speed: 0
|
||||||
_attack_damage: 0
|
_attack_damage: 0
|
||||||
_attack_interval: 2
|
_attack_interval: 0
|
||||||
_harvesterResourcePairs:
|
_harvesterResourcePairs:
|
||||||
- _harvesterPrefab: {fileID: 5157279992115123224}
|
- _harvesterPrefab: {fileID: 5157279992115123224}
|
||||||
_resource: 2
|
_resource: 2
|
||||||
@ -415,7 +415,9 @@ MonoBehaviour:
|
|||||||
_resource: 0
|
_resource: 0
|
||||||
- _harvesterPrefab: {fileID: 6962989255644195630, guid: 02eb2d787f58e9943a0cb46d0b13e6b8, type: 3}
|
- _harvesterPrefab: {fileID: 6962989255644195630, guid: 02eb2d787f58e9943a0cb46d0b13e6b8, type: 3}
|
||||||
_resource: 1
|
_resource: 1
|
||||||
_resourceChoice: 2
|
- _harvesterPrefab: {fileID: 7670155643566295935, guid: 717a063ebb684a748b9f40cac33fab52, type: 3}
|
||||||
|
_resource: 3
|
||||||
|
_resourceNodeType: 2
|
||||||
--- !u!114 &4198250345843206422
|
--- !u!114 &4198250345843206422
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -508,6 +508,8 @@ MonoBehaviour:
|
|||||||
_resource: 0
|
_resource: 0
|
||||||
- _harvesterPrefab: {fileID: 6962989255644195630, guid: 02eb2d787f58e9943a0cb46d0b13e6b8, type: 3}
|
- _harvesterPrefab: {fileID: 6962989255644195630, guid: 02eb2d787f58e9943a0cb46d0b13e6b8, type: 3}
|
||||||
_resource: 1
|
_resource: 1
|
||||||
|
- _harvesterPrefab: {fileID: 7670155643566295935, guid: 717a063ebb684a748b9f40cac33fab52, type: 3}
|
||||||
|
_resource: 3
|
||||||
_resourceChoice: 0
|
_resourceChoice: 0
|
||||||
--- !u!114 &8773193872037819055
|
--- !u!114 &8773193872037819055
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|||||||
@ -133,7 +133,6 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9dd6bad38b516d64e8e23a5822ca37bb, type: 3}
|
m_Script: {fileID: 11500000, guid: 9dd6bad38b516d64e8e23a5822ca37bb, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
_resourceMakingAmount: 10
|
|
||||||
_resourceChoice: 2
|
_resourceChoice: 2
|
||||||
_endPosition: {x: -2, y: 5}
|
_endPosition: {x: -2, y: 5}
|
||||||
--- !u!1 &6962989256011107503
|
--- !u!1 &6962989256011107503
|
||||||
|
|||||||
@ -1687,6 +1687,158 @@ PrefabInstance:
|
|||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: LevelManager
|
value: LevelManager
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _folders.Array.size
|
||||||
|
value: 4
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.size
|
||||||
|
value: 34
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _folders.Array.data[2]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 102900000, guid: 73ca1afa7b0f7dd4ea39f69cf74f8370, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _folders.Array.data[3]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 102900000, guid: 53e5218fbb04cbd478369e415d099bdb, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[22]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3688217365857929929, guid: b116bc5489ed8524da52c4dbc835640e, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[23]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6208366596957312446, guid: 9b9c2b61b2a2928458af5f15c009b8c4, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[24]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3028288566889208744, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[25]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 80204295746100150, guid: 1be769d6ef642314b8846bed35e7297c, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[26]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 80204295746100150, guid: 2419a879bd4e47d4fa8b30de0fcdde42, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[27]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 2230360378425099702, guid: ece16a59d4dca2246817fbb1b23f17ba, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[28]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 7670155643566295935, guid: 717a063ebb684a748b9f40cac33fab52, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[29]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 4897909026855453892, guid: 3918c7d48763f184a92c7d61380ca258, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[30]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 8433619855353240514, guid: bc81e2a1e8b64884692701c2892f62a4, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[31]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3409838768749337993, guid: 096f5f6b487dccb41a48faf69f87fae9, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[32]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1388419617042242061, guid: 4a2f48781c26ad247b697aa368358f88, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[33]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: f74ea22a786d3c34cbb77e7522a360f8, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.size
|
||||||
|
value: 21
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[3]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: e74655ccbd41a2b46b1ec9615aba0301, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[4]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: e0d57b3c128ba1447920637cdb289530, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[5]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 4aaf448680c7f8a438a9a5861c622a55, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[6]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: a6e34739c9325da4cac4fbaea30d052c, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[7]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: d37561e153d6a6448a03839488fdec5e, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[8]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 7a1313e5c16e74c4ba11a8114b9fd786, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[9]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: b501f7eea1fdfb843853bcba5b30533a, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[10]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 0a9c94eb38c575948992453fc29bcede, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[11]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 458348dd169e806459b7449b7e157d64, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[12]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: f5a11cb6d0d324b47b493042c7615112, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[13]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: a387250a316b97e43be83b85980101e1, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[14]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: ef5a154519b23a34aaded32e86bf7f2f, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[15]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 5f47d74ebc4a8fe439ac6a4fe9ec436f, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[16]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 3723ba09738ef6245947ae3ba7978b21, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[17]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: ec229632b369eb746a30dbfafe3de373, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[18]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 21b0f85f7c746974db1e72f2df646f5d, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[19]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 4c72177270b51eb46872d1665e3a097e, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[20]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: d8140ae36f1b7fd4fb1a57ab3dc69de4, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[21]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: d8140ae36f1b7fd4fb1a57ab3dc69de4, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[22]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: d8140ae36f1b7fd4fb1a57ab3dc69de4, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[23]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: d8140ae36f1b7fd4fb1a57ab3dc69de4, type: 2}
|
||||||
- target: {fileID: 3028288566889208750, guid: 02daecb0115395844b4932445d039051, type: 3}
|
- target: {fileID: 3028288566889208750, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
propertyPath: _gameScene
|
propertyPath: _gameScene
|
||||||
value: Game
|
value: Game
|
||||||
|
|||||||
@ -1204,6 +1204,166 @@ PrefabInstance:
|
|||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: LevelManager
|
value: LevelManager
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.size
|
||||||
|
value: 32
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _folders.Array.data[2]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 102900000, guid: 53e5218fbb04cbd478369e415d099bdb, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[0]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3688217365857929929, guid: b116bc5489ed8524da52c4dbc835640e, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[1]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: 377c7275c0001cc47a6b8926ac57d573, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[2]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: 869a03bba705e8d4485aa73daad773dc, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[3]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1436362432952518814, guid: 8d56b160dedb7f84d830d749372fe8e8, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[4]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6208366596957312446, guid: 9b9c2b61b2a2928458af5f15c009b8c4, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[5]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3028288566889208744, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[6]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 80204295746100150, guid: 1be769d6ef642314b8846bed35e7297c, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[7]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 80204295746100150, guid: 5bbf0d85fa5bb3f4599da79f0a84e3a9, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[8]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 80204295746100150, guid: 2419a879bd4e47d4fa8b30de0fcdde42, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[9]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 5531237550998824024, guid: 6cd87b398e7a0e94580f4fcbe2fd310a, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[10]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: 9b40c232eddfd1b469bea688e3c970c0, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[11]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: e4a4754288971e949a74f90737193702, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[12]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 2230360378425099702, guid: ece16a59d4dca2246817fbb1b23f17ba, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[13]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: 02eb2d787f58e9943a0cb46d0b13e6b8, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[14]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 7670155643566295935, guid: 717a063ebb684a748b9f40cac33fab52, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[15]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 5157279992115123224, guid: 85534a2d6c2add54d864073914646192, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[16]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: 8b50d9afb3bbd204d8dfea3d64f13fa2, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[17]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 809914571062164693, guid: 5497dc5adfbe67341980c9d946816424, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[18]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 4897909026855453892, guid: 3918c7d48763f184a92c7d61380ca258, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[19]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 8433619855353240514, guid: bc81e2a1e8b64884692701c2892f62a4, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[20]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 4052934186652138539, guid: 8560e1f66d452b543a705c8a0f3e22fa, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[21]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3814095509541806390, guid: 9527f3a1482b90a48bb6c62acc70f986, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[22]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 907652127959947826, guid: e20680474d73eee49836ff9cbc6d0b28, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[23]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 907652127959947826, guid: afc444040d3adcf45a882e4882521f5e, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[24]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 4817988606444742093, guid: 306211cf6348ac747a78d89bd72fca3e, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[25]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1893888152770301340, guid: eb25bde5e3c72d34fbc9095e2c83cdb4, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[26]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3409838768749337993, guid: 096f5f6b487dccb41a48faf69f87fae9, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[27]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1388419617042242061, guid: 4a2f48781c26ad247b697aa368358f88, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[28]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 3405186844740662670, guid: 074c072b696214a4ba44ff66e9a7d9a6, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[29]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: a2dc5d9672c10074fa9c35c12f6339c1, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[30]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: 484f0eca1c74ae34694692de56a36739, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _prefabs.Array.data[31]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6962989255644195630, guid: f20569b5452c2b341a95d656b7534b7e, type: 3}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.size
|
||||||
|
value: 8
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[0]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 3723ba09738ef6245947ae3ba7978b21, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[1]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 4002377ed7e87b34699f126f2b10c703, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[2]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 15606c8c503e8164fb69178aa7016f58, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[3]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: 7568f730b2ba3754297a7612452482e2, type: 2}
|
||||||
|
- target: {fileID: 3028288566889208749, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
|
propertyPath: _scriptableObjects.Array.data[4]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 11400000, guid: e0b1d2d816ae5624c99b09a2bebb2a39, type: 2}
|
||||||
- target: {fileID: 3028288566889208750, guid: 02daecb0115395844b4932445d039051, type: 3}
|
- target: {fileID: 3028288566889208750, guid: 02daecb0115395844b4932445d039051, type: 3}
|
||||||
propertyPath: firstLevel
|
propertyPath: firstLevel
|
||||||
value:
|
value:
|
||||||
|
|||||||
@ -6,7 +6,7 @@ public class Harvester : Ally
|
|||||||
{
|
{
|
||||||
[SerializeField] [Tooltip("helps choose the right skin for the harvester depending on resource")]
|
[SerializeField] [Tooltip("helps choose the right skin for the harvester depending on resource")]
|
||||||
private List<HarvesterResourcePair> _harvesterResourcePairs;
|
private List<HarvesterResourcePair> _harvesterResourcePairs;
|
||||||
protected ResourceChoice ResourceChoice => _resourceChoice;
|
protected ResourceNodeType ResourceNodeType => _resourceNodeType;
|
||||||
|
|
||||||
public override Vector2 RangeMultiplier { get; }
|
public override Vector2 RangeMultiplier { get; }
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ public class Harvester : Ally
|
|||||||
public override float AttackSpeedMultiplier { get; }
|
public override float AttackSpeedMultiplier { get; }
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private ResourceChoice _resourceChoice;
|
private ResourceNodeType _resourceNodeType;
|
||||||
public override sealed void Start()
|
public override sealed void Start()
|
||||||
{
|
{
|
||||||
base.Start();
|
base.Start();
|
||||||
@ -36,16 +36,9 @@ public class Harvester : Ally
|
|||||||
var tile = LevelManager.Instance.Get<ResourceTile>(t => t.Position == Position);
|
var tile = LevelManager.Instance.Get<ResourceTile>(t => t.Position == Position);
|
||||||
if (tile == default) return;
|
if (tile == default) return;
|
||||||
|
|
||||||
//get the resource of the tile we're on
|
|
||||||
var yieldPrefab = tile.YieldPrefab;
|
|
||||||
if (!yieldPrefab) return;
|
|
||||||
|
|
||||||
var resourceMaker = yieldPrefab.GetComponent<ResourceMaker>();
|
|
||||||
if (!resourceMaker) return;
|
|
||||||
|
|
||||||
//if we already have the right harvester for the resource, no need to change
|
//if we already have the right harvester for the resource, no need to change
|
||||||
var resourceChoice = resourceMaker.ResourceChoice;
|
var resourceChoice = tile.ResourceNodeType;
|
||||||
if (resourceChoice == this.ResourceChoice) return;
|
if (resourceChoice == this.ResourceNodeType) return;
|
||||||
|
|
||||||
//get the right pair for the resource we're on
|
//get the right pair for the resource we're on
|
||||||
var harvResPair = _harvesterResourcePairs.Find(hrp => hrp.Resource == resourceChoice);
|
var harvResPair = _harvesterResourcePairs.Find(hrp => hrp.Resource == resourceChoice);
|
||||||
|
|||||||
@ -10,8 +10,8 @@ public class HarvesterResourcePair
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private GameObject _harvesterPrefab;
|
private GameObject _harvesterPrefab;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private ResourceChoice _resource;
|
private ResourceNodeType _resource;
|
||||||
|
|
||||||
public GameObject HarvesterPrefab => _harvesterPrefab;
|
public GameObject HarvesterPrefab => _harvesterPrefab;
|
||||||
public ResourceChoice Resource => _resource;
|
public ResourceNodeType Resource => _resource;
|
||||||
}
|
}
|
||||||
@ -26,7 +26,8 @@ public class AnimationEntity : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
if (!_animatorEntity) return;
|
||||||
if (_doSomething && _animatorEntity.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1f)
|
if (_doSomething && _animatorEntity.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1f)
|
||||||
{
|
{
|
||||||
PlayIdleAnim();
|
PlayIdleAnim();
|
||||||
|
|||||||
@ -93,7 +93,7 @@ public abstract class DraggablePlaceholder : MonoBehaviour
|
|||||||
{
|
{
|
||||||
return !LevelManager.Instance.Has<ILevelObject>(obj => obj.Position.IsContainedIn(transform.position))
|
return !LevelManager.Instance.Has<ILevelObject>(obj => obj.Position.IsContainedIn(transform.position))
|
||||||
&& _lvlBoundsCache.Contains(transform.position)
|
&& _lvlBoundsCache.Contains(transform.position)
|
||||||
&& ResourceManager.Instance.EnoughFor(Rock, Wood, Food, 0);
|
&& ResourceManager.Instance.EnoughFor(Rock, Wood, Food);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -9,7 +9,11 @@ public class GameObjectPlacementButton : UnitPlacementButton
|
|||||||
protected override bool CanPlace()
|
protected override bool CanPlace()
|
||||||
{
|
{
|
||||||
var isBuilding = _prefab.GetComponent<Building>();
|
var isBuilding = _prefab.GetComponent<Building>();
|
||||||
return ResourceManager.Instance.EnoughFor(_rock, _wood, _food, isBuilding ? 0 : GlobalConfig.Instance.Current.populationCostPerUnit) && _button.enabled && _canSpawn;
|
var defaultPopCost = GlobalConfig.Instance.Current.populationCostPerUnit;
|
||||||
|
var hasEnoughPopulation = isBuilding || ResourceManager.Instance.EnoughPopulationFor(defaultPopCost);
|
||||||
|
return ResourceManager.Instance.EnoughFor(_rock, _wood, _food)
|
||||||
|
&& hasEnoughPopulation
|
||||||
|
&& _button.enabled && _canSpawn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DraggablePlaceholder Place()
|
protected override DraggablePlaceholder Place()
|
||||||
|
|||||||
@ -12,8 +12,11 @@ public class ObjectPlaceholder : DraggablePlaceholder
|
|||||||
var objsOnPosition = LevelManager.Instance.GetAll<ILevelObject>(obj => obj.Position.IsContainedIn(transform.position));
|
var objsOnPosition = LevelManager.Instance.GetAll<ILevelObject>(obj => obj.Position.IsContainedIn(transform.position));
|
||||||
var positionIsCollidable = objsOnPosition.Exists(obj => obj.IsCollidable);
|
var positionIsCollidable = objsOnPosition.Exists(obj => obj.IsCollidable);
|
||||||
|
|
||||||
|
var defaultUnitCost = GlobalConfig.Instance.Current.populationCostPerUnit;
|
||||||
return !positionIsCollidable
|
return !positionIsCollidable
|
||||||
&& _lvlBoundsCache.Contains(transform.position)
|
&& _lvlBoundsCache.Contains(transform.position)
|
||||||
&& ResourceManager.Instance.EnoughFor(Rock, Wood, Food, Prefab.GetComponent<Building>() ? 0 : 1);
|
&& ResourceManager.Instance.EnoughFor(Rock, Wood, Food)
|
||||||
|
&& (Prefab.GetComponent<Building>()
|
||||||
|
|| ResourceManager.Instance.EnoughPopulationFor(defaultUnitCost));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8,7 +8,7 @@ public class TilePlacementButton : UnitPlacementButton
|
|||||||
|
|
||||||
protected override bool CanPlace()
|
protected override bool CanPlace()
|
||||||
{
|
{
|
||||||
return ResourceManager.Instance.EnoughFor(_rock, _wood, _food, 0) && _button.enabled && _canSpawn;
|
return ResourceManager.Instance.EnoughFor(_rock, _wood, _food) && _button.enabled && _canSpawn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DraggablePlaceholder Place()
|
protected override DraggablePlaceholder Place()
|
||||||
|
|||||||
@ -2,8 +2,15 @@ public class Enum
|
|||||||
{
|
{
|
||||||
public enum ResourceChoice
|
public enum ResourceChoice
|
||||||
{
|
{
|
||||||
Rock,
|
Rock = 0,
|
||||||
Wood,
|
Wood = 1,
|
||||||
Food
|
Food = 2
|
||||||
};
|
};
|
||||||
|
public enum ResourceNodeType
|
||||||
|
{
|
||||||
|
Rock = 0,
|
||||||
|
Forest = 1,
|
||||||
|
Farm = 2,
|
||||||
|
BerryBush = 3
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class Database : SingletonBehaviour<Database>
|
|||||||
|
|
||||||
public void Add(T element) => elements.Add(element);
|
public void Add(T element) => elements.Add(element);
|
||||||
|
|
||||||
|
public void Clear() => elements.Clear();
|
||||||
public IEnumerator<T> GetEnumerator()
|
public IEnumerator<T> GetEnumerator()
|
||||||
{
|
{
|
||||||
return elements.GetEnumerator();
|
return elements.GetEnumerator();
|
||||||
|
|||||||
@ -21,6 +21,11 @@ public class WaveObserver : Singleton<WaveObserver>
|
|||||||
_copyConstantSpawn = new List<int>();
|
_copyConstantSpawn = new List<int>();
|
||||||
_copyGroupSpawn = new List<List<int>>();
|
_copyGroupSpawn = new List<List<int>>();
|
||||||
_groupSpawnTimers = new List<float>();
|
_groupSpawnTimers = new List<float>();
|
||||||
|
if (!_levelConfig)
|
||||||
|
{
|
||||||
|
Debug.LogError("level config was null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach (EnemyType enemy in _levelConfig.ConstantSpawn)
|
foreach (EnemyType enemy in _levelConfig.ConstantSpawn)
|
||||||
{
|
{
|
||||||
_copyConstantSpawn.Add(enemy.Count);
|
_copyConstantSpawn.Add(enemy.Count);
|
||||||
|
|||||||
@ -101,9 +101,4 @@ public class LoadingManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
SceneManager.UnloadSceneAsync(gameObject.scene.name);
|
SceneManager.UnloadSceneAsync(gameObject.scene.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -46,7 +46,6 @@ public class ResourceMaker : MonoBehaviour
|
|||||||
|
|
||||||
if (_isPlaying)
|
if (_isPlaying)
|
||||||
{
|
{
|
||||||
var amount = GlobalConfig.Instance.Current.harvestAmount;
|
|
||||||
_timePassed += Time.deltaTime;
|
_timePassed += Time.deltaTime;
|
||||||
float duration = _timePassed / _desiredTime;
|
float duration = _timePassed / _desiredTime;
|
||||||
duration = duration * duration * (3.0f - 2.0f * duration);
|
duration = duration * duration * (3.0f - 2.0f * duration);
|
||||||
@ -54,12 +53,16 @@ public class ResourceMaker : MonoBehaviour
|
|||||||
if(Vector2.Distance(transform.position,_endPosition) < 0.001f)
|
if(Vector2.Distance(transform.position,_endPosition) < 0.001f)
|
||||||
{
|
{
|
||||||
_isPlaying = false;
|
_isPlaying = false;
|
||||||
AddResourceToInventory(amount);
|
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
AddResourceToInventory(GlobalConfig.Instance.Current.harvestAmount);
|
||||||
|
}
|
||||||
|
|
||||||
public void AddResourceToInventory(int amount)
|
public void AddResourceToInventory(int amount)
|
||||||
{
|
{
|
||||||
switch (_resourceChoice)
|
switch (_resourceChoice)
|
||||||
|
|||||||
@ -116,11 +116,14 @@ public class ResourceManager : Singleton<ResourceManager>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool EnoughFor(int rock, int wood, int food = 0, int population = 1)
|
public bool EnoughFor(int rock, int wood, int food = 0)
|
||||||
{
|
{
|
||||||
return _rockAmount >= rock
|
return _rockAmount >= rock
|
||||||
&& _woodAmount >= wood
|
&& _woodAmount >= wood
|
||||||
&& _foodAmount >= food
|
&& _foodAmount >= food;
|
||||||
&& _currentPopulation + population <= _maximumPopulation;
|
}
|
||||||
|
public bool EnoughPopulationFor(int population = 1)
|
||||||
|
{
|
||||||
|
return _currentPopulation + population <= _maximumPopulation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,10 @@ public class ResourceTile : LevelTile
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
[Tooltip("the prefab of the currency that will be spawned when mining this resource")]
|
[Tooltip("the prefab of the currency that will be spawned when mining this resource")]
|
||||||
private GameObject _yieldPrefab;
|
private GameObject _yieldPrefab;
|
||||||
|
[SerializeField]
|
||||||
|
private Enum.ResourceNodeType _resourceNodeType;
|
||||||
|
|
||||||
|
public Enum.ResourceNodeType ResourceNodeType => _resourceNodeType;
|
||||||
public GameObject YieldPrefab => _yieldPrefab;
|
public GameObject YieldPrefab => _yieldPrefab;
|
||||||
private string YieldPrefabName => _yieldPrefab.name;
|
private string YieldPrefabName => _yieldPrefab.name;
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,6 @@ public class WorldMapManager : MonoBehaviour
|
|||||||
|
|
||||||
public void CallLevelWorld1(int levelToCall)
|
public void CallLevelWorld1(int levelToCall)
|
||||||
{
|
{
|
||||||
string levelToGet = "1-" + levelToCall;
|
|
||||||
if (_buttonList[levelToCall - 1].GetComponent<Image>().sprite.name != "worldmap_level_locked")
|
if (_buttonList[levelToCall - 1].GetComponent<Image>().sprite.name != "worldmap_level_locked")
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetString(LoadingManager.SceneToLoad, _gameScene);
|
PlayerPrefs.SetString(LoadingManager.SceneToLoad, _gameScene);
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Grid:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 86010431647272150}
|
m_GameObject: {fileID: 86010431647272150}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_CellSize: {x: 1, y: 1, z: 0}
|
m_CellSize: {x: 1.45, y: 1.45, z: 0}
|
||||||
m_CellGap: {x: 0, y: 0, z: 0}
|
m_CellGap: {x: 0, y: 0, z: 0}
|
||||||
m_CellLayout: 0
|
m_CellLayout: 0
|
||||||
m_CellSwizzle: 0
|
m_CellSwizzle: 0
|
||||||
@ -117,6 +117,16 @@ Tilemap:
|
|||||||
m_TileObjectToInstantiateIndex: 65535
|
m_TileObjectToInstantiateIndex: 65535
|
||||||
dummyAlignment: 0
|
dummyAlignment: 0
|
||||||
m_AllTileFlags: 0
|
m_AllTileFlags: 0
|
||||||
|
- first: {x: -1, y: -1, z: 0}
|
||||||
|
second:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_TileIndex: 8
|
||||||
|
m_TileSpriteIndex: 8
|
||||||
|
m_TileMatrixIndex: 0
|
||||||
|
m_TileColorIndex: 0
|
||||||
|
m_TileObjectToInstantiateIndex: 65535
|
||||||
|
dummyAlignment: 0
|
||||||
|
m_AllTileFlags: 0
|
||||||
- first: {x: -1, y: 0, z: 0}
|
- first: {x: -1, y: 0, z: 0}
|
||||||
second:
|
second:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@ -195,6 +205,8 @@ Tilemap:
|
|||||||
m_Data: {fileID: 11400000, guid: 7568f730b2ba3754297a7612452482e2, type: 2}
|
m_Data: {fileID: 11400000, guid: 7568f730b2ba3754297a7612452482e2, type: 2}
|
||||||
- m_RefCount: 1
|
- m_RefCount: 1
|
||||||
m_Data: {fileID: 11400000, guid: 15606c8c503e8164fb69178aa7016f58, type: 2}
|
m_Data: {fileID: 11400000, guid: 15606c8c503e8164fb69178aa7016f58, type: 2}
|
||||||
|
- m_RefCount: 1
|
||||||
|
m_Data: {fileID: 11400000, guid: 3723ba09738ef6245947ae3ba7978b21, type: 2}
|
||||||
m_TileSpriteArray:
|
m_TileSpriteArray:
|
||||||
- m_RefCount: 1
|
- m_RefCount: 1
|
||||||
m_Data: {fileID: 21300000, guid: ccca3e050cb082b45af0a099790463f6, type: 3}
|
m_Data: {fileID: 21300000, guid: ccca3e050cb082b45af0a099790463f6, type: 3}
|
||||||
@ -212,8 +224,10 @@ Tilemap:
|
|||||||
m_Data: {fileID: 21300000, guid: 5cf7447a03096c04ead18f1855f01cd7, type: 3}
|
m_Data: {fileID: 21300000, guid: 5cf7447a03096c04ead18f1855f01cd7, type: 3}
|
||||||
- m_RefCount: 1
|
- m_RefCount: 1
|
||||||
m_Data: {fileID: 21300000, guid: 8354a544f4ca3514e87d40d2de9afaee, type: 3}
|
m_Data: {fileID: 21300000, guid: 8354a544f4ca3514e87d40d2de9afaee, type: 3}
|
||||||
|
- m_RefCount: 1
|
||||||
|
m_Data: {fileID: 21300000, guid: 22cdcbd5df3efd74fa4d119fc5836708, type: 3}
|
||||||
m_TileMatrixArray:
|
m_TileMatrixArray:
|
||||||
- m_RefCount: 9
|
- m_RefCount: 10
|
||||||
m_Data:
|
m_Data:
|
||||||
e00: 1
|
e00: 1
|
||||||
e01: 0
|
e01: 0
|
||||||
@ -232,13 +246,13 @@ Tilemap:
|
|||||||
e32: 0
|
e32: 0
|
||||||
e33: 1
|
e33: 1
|
||||||
m_TileColorArray:
|
m_TileColorArray:
|
||||||
- m_RefCount: 9
|
- m_RefCount: 10
|
||||||
m_Data: {r: 1, g: 1, b: 1, a: 1}
|
m_Data: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_TileObjectToInstantiateArray: []
|
m_TileObjectToInstantiateArray: []
|
||||||
m_AnimationFrameRate: 1
|
m_AnimationFrameRate: 1
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_Origin: {x: -1, y: -3, z: 0}
|
m_Origin: {x: -1, y: -4, z: 0}
|
||||||
m_Size: {x: 3, y: 5, z: 1}
|
m_Size: {x: 3, y: 6, z: 1}
|
||||||
m_TileAnchor: {x: 0.5, y: 0.5, z: 0}
|
m_TileAnchor: {x: 0.5, y: 0.5, z: 0}
|
||||||
m_TileOrientation: 0
|
m_TileOrientation: 0
|
||||||
m_TileOrientationMatrix:
|
m_TileOrientationMatrix:
|
||||||
@ -300,14 +314,14 @@ TilemapRenderer:
|
|||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_ChunkSize: {x: 32, y: 32, z: 32}
|
m_ChunkSize: {x: 32, y: 32, z: 32}
|
||||||
m_ChunkCullingBounds: {x: 0, y: 0, z: 0}
|
m_ChunkCullingBounds: {x: 0.22500002, y: 0.22500002, z: 0}
|
||||||
m_MaxChunkCount: 16
|
m_MaxChunkCount: 16
|
||||||
m_MaxFrameAge: 16
|
m_MaxFrameAge: 16
|
||||||
m_SortOrder: 0
|
m_SortOrder: 0
|
||||||
m_Mode: 0
|
m_Mode: 0
|
||||||
m_DetectChunkCullingBounds: 0
|
m_DetectChunkCullingBounds: 0
|
||||||
m_MaskInteraction: 0
|
m_MaskInteraction: 0
|
||||||
--- !u!114 &1109561936470111781
|
--- !u!114 &70335294776359290
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
|||||||
@ -10,10 +10,10 @@ MonoBehaviour:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 84b05f2a26f63da46a1028488482d079, type: 3}
|
m_Script: {fileID: 11500000, guid: 84b05f2a26f63da46a1028488482d079, type: 3}
|
||||||
m_Name: Meat
|
m_Name: BushTile
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
_sprite: {fileID: 21300000, guid: b1e6b8ebeb2e25f4f8c5de93a31dd6a2, type: 3}
|
_sprite: {fileID: 21300000, guid: 22cdcbd5df3efd74fa4d119fc5836708, type: 3}
|
||||||
_isCollidable: 0
|
_isCollidable: 0
|
||||||
_yieldPrefab: {fileID: 6962989255644195630, guid: a2dc5d9672c10074fa9c35c12f6339c1, type: 3}
|
_yieldPrefab: {fileID: 6962989255644195630, guid: a2dc5d9672c10074fa9c35c12f6339c1, type: 3}
|
||||||
_yieldDuration: 5
|
_resourceNodeType: 3
|
||||||
_randomPositionConfig: 0.5
|
_randomPositionConfig: 0.25
|
||||||
@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: a19b3b6859986b449aac7484e064097a
|
guid: 3723ba09738ef6245947ae3ba7978b21
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 0
|
mainObjectFileID: 11400000
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
@ -15,5 +15,5 @@ MonoBehaviour:
|
|||||||
_sprite: {fileID: 21300000, guid: ccca3e050cb082b45af0a099790463f6, type: 3}
|
_sprite: {fileID: 21300000, guid: ccca3e050cb082b45af0a099790463f6, type: 3}
|
||||||
_isCollidable: 0
|
_isCollidable: 0
|
||||||
_yieldPrefab: {fileID: 6962989255644195630, guid: a2dc5d9672c10074fa9c35c12f6339c1, type: 3}
|
_yieldPrefab: {fileID: 6962989255644195630, guid: a2dc5d9672c10074fa9c35c12f6339c1, type: 3}
|
||||||
_yieldDuration: 5
|
_resourceNodeType: 2
|
||||||
_randomPositionConfig: 0.25
|
_randomPositionConfig: 0.25
|
||||||
|
|||||||
@ -15,5 +15,5 @@ MonoBehaviour:
|
|||||||
_sprite: {fileID: 21300000, guid: 43582b3c6b60fd144bc56d8ab3b14349, type: 3}
|
_sprite: {fileID: 21300000, guid: 43582b3c6b60fd144bc56d8ab3b14349, type: 3}
|
||||||
_isCollidable: 0
|
_isCollidable: 0
|
||||||
_yieldPrefab: {fileID: 6962989255644195630, guid: f20569b5452c2b341a95d656b7534b7e, type: 3}
|
_yieldPrefab: {fileID: 6962989255644195630, guid: f20569b5452c2b341a95d656b7534b7e, type: 3}
|
||||||
_yieldDuration: 5
|
_resourceNodeType: 1
|
||||||
_randomPositionConfig: 0.5
|
_randomPositionConfig: 0.5
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user