Browse Source

Shipyard Icons

bolt_update
laurids 3 years ago
parent
commit
2cca186d21
16 changed files with 7470 additions and 1508 deletions
  1. +3
    -147
      Assets/GWConquest/Prefabs/Planet.prefab
  2. +7125
    -1351
      Assets/GWConquest/Scenes/GalaxyMap.unity
  3. +2
    -1
      Assets/GWConquest/Scripts/District.cs
  4. +64
    -0
      Assets/GWConquest/Scripts/Planet.cs
  5. +8
    -1
      Assets/GWConquest/Scripts/PlanetRegistry.cs
  6. +5
    -5
      Assets/GWConquest/Scripts/UI/DistrictIcon.cs
  7. +7
    -3
      Assets/GWConquest/Scripts/UI/ScaleRelativeToText.cs
  8. BIN
      Assets/GWConquest/Textures/Icons/DistrictSpaceStation.png
  9. +128
    -0
      Assets/GWConquest/Textures/Icons/DistrictSpaceStation.png.meta
  10. BIN
      Assets/GWConquest/Textures/Icons/Station 1.png
  11. BIN
      Assets/GWConquest/Textures/Icons/Station 2.png
  12. BIN
      Assets/GWConquest/Textures/Icons/Station 3.png
  13. BIN
      Assets/GWConquest/Textures/Icons/Station 4.png
  14. BIN
      Assets/GWConquest/Textures/Icons/Station 5 Hotheseer.png
  15. +128
    -0
      Assets/GWConquest/Textures/Icons/Station 5 Hotheseer.png.meta
  16. BIN
      Assets/GWConquest/Textures/Icons/Station 5.png

+ 3
- 147
Assets/GWConquest/Prefabs/Planet.prefab View File

@ -29,7 +29,7 @@ Transform:
m_Children:
- {fileID: 3266501631720423375}
m_Father: {fileID: 4678135251219451999}
m_RootOrder: 4
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: -330, z: 0}
--- !u!1 &4678135251219452000
GameObject:
@ -60,8 +60,6 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4678135251998877763}
- {fileID: 5705803185017867045}
- {fileID: 4678135252239284613}
- {fileID: 4678135251355824056}
- {fileID: 7191419555384860655}
@ -97,7 +95,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
textPrefab: {fileID: 0}
spaceZones:
- {fileID: 4678135251998877762}
- {fileID: 4678135252239284612}
groundZones:
- {fileID: 4678135251355824059}
@ -134,7 +131,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4678135251219451999}
m_RootOrder: 3
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4678135251355824059
MonoBehaviour:
@ -151,52 +148,6 @@ MonoBehaviour:
zoneId: 0
attackZone: 1
mainZone: 0
--- !u!1 &4678135251998877765
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4678135251998877763}
- component: {fileID: 4678135251998877762}
m_Layer: 0
m_Name: SpaceMain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4678135251998877763
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4678135251998877765}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4678135251219451999}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4678135251998877762
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4678135251998877765}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59300c3dd14d29d4895f5f18e85d7eb3, type: 3}
m_Name:
m_EditorClassIdentifier:
zoneId: 0
attackZone: 0
mainZone: 1
--- !u!1 &4678135252239284615
GameObject:
m_ObjectHideFlags: 0
@ -226,7 +177,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4678135251219451999}
m_RootOrder: 2
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4678135252239284612
MonoBehaviour:
@ -273,98 +224,3 @@ Transform:
m_Father: {fileID: 7191419555384860655}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 42.538002, y: 28.511002, z: 0}
--- !u!1001 &1690981885650063855
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 4678135251219451999}
m_Modifications:
- target: {fileID: 1355812926097278600, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_Name
value: GroundMain
objectReference: {fileID: 0}
- target: {fileID: 1355812926097278600, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fc3eae9e9964d5446a5c38fbf9a203bb, type: 3}
--- !u!4 &5705803185017867045 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6365986322515139274, guid: fc3eae9e9964d5446a5c38fbf9a203bb,
type: 3}
m_PrefabInstance: {fileID: 1690981885650063855}
m_PrefabAsset: {fileID: 0}

+ 7125
- 1351
Assets/GWConquest/Scenes/GalaxyMap.unity
File diff suppressed because it is too large
View File


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

@ -160,7 +160,8 @@ namespace GWConquest
Civil,
Factory,
Food,
Special
Special,
SpaceStation
}

+ 64
- 0
Assets/GWConquest/Scripts/Planet.cs View File

@ -95,6 +95,7 @@ namespace GWConquest
{
zone.planet = this;
zone.zoneType = ZoneType.Space;
zone.GetComponent<District>()?.Initialize(this);
}
pathfindingGraph = new PathfindingGraph<Zone>(groundZones);
@ -195,6 +196,13 @@ namespace GWConquest
var data = PlanetData;
if(data == null)
{
Debug.LogErrorFormat("No entry found for planet {0}", planetName);
return;
}
/*foreach (Zone z in groundZones)
{
if (!z.attackZone)
@ -313,6 +321,62 @@ namespace GWConquest
}
}
Zone spaceZone = GetMainZone(ZoneType.Space);
bool zoneMismatch = (spaceZone != null && (spaceZone.GetComponent<District>() != null) != data.HasShipyard);
if(zoneMismatch)
{
DestroyImmediate(spaceZone.gameObject);
UnityEditor.ArrayUtility.Remove(ref spaceZones, spaceZone);
}
bool needsNewZone = spaceZone == null || zoneMismatch;
if(needsNewZone)
{
GameObject go;
if(data.HasShipyard)
{
go = UnityEditor.PrefabUtility.InstantiatePrefab(facotryPrefab) as GameObject;
}
else {
go = new GameObject("Space Station");
go.AddComponent<Zone>();
}
spaceZone = go.GetComponent<Zone>();
spaceZone.mainZone = true;
go.name = "Space Station";
go.transform.SetParent(transform);
go.transform.localPosition = Vector3.zero;
go.transform.localRotation = Quaternion.identity;
go.transform.localScale = Vector3.one;
Util.ArrayAppend(ref spaceZones, spaceZone);
}
if(data.HasShipyard)
{
District d = spaceZone.GetComponent<District>();
UnityEditor.Undo.RecordObject(d, "Setting up zones");
d.DistrictType = DistrictType.SpaceStation;
d.DistrictName = planetName + " Station";
DistrictFactory f = spaceZone.GetComponent<DistrictFactory>();
if(f != null)
{
UnityEditor.Undo.RecordObject(f, "Setting up zones");
f.FactoryType = FactoryType.Space;
UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(f);
}
d.SetDefaultSprite();
UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(d);
}
UnityEditor.PrefabUtility.RecordPrefabInstancePropertyModifications(this);
}


+ 8
- 1
Assets/GWConquest/Scripts/PlanetRegistry.cs View File

@ -12,6 +12,9 @@ namespace GWConquest
public string Description;
public string StartPopulation;
public PlanetDistrictData[] DistrictData;
public bool HasShipyard;
public int ShipyardRating;
}
[System.Serializable]
@ -61,12 +64,16 @@ namespace GWConquest
var districtData = LoadDistrictData(data);
int shipyard = data.GetInt("Shipyard");
PlanetData planet = new PlanetData
{
Name = data.GetString("Name"),
Description = data.GetString("Text Info"),
StartPopulation = data.GetString("Population"),
DistrictData = districtData
DistrictData = districtData,
HasShipyard = shipyard > 0,
ShipyardRating = shipyard
};
BoltLog.Info("Loaded planet {0}", planet.Name);


+ 5
- 5
Assets/GWConquest/Scripts/UI/DistrictIcon.cs View File

@ -105,11 +105,11 @@ namespace GWConquest
animator.SetBool("Producing", producing);
}
var hasBattle = district.Zone.HasBattle;
if(animator.GetBool("Battle") != hasBattle)
{
animator.SetBool("Battle", hasBattle);
}
var hasBattle = district.Zone.HasBattle;
if (animator.GetBool("Battle") != hasBattle)
{
animator.SetBool("Battle", hasBattle);
}
}
BattleIcon.SetActive(district.Zone.HasBattle);


+ 7
- 3
Assets/GWConquest/Scripts/UI/ScaleRelativeToText.cs View File

@ -27,9 +27,13 @@ namespace GWConquest
private void Update()
{
Vector2 delta = origSizeDelta;
delta.x = factor * text.preferredWidth + offset;
rt.sizeDelta = delta;
//Vector2 delta = origSizeDelta;
//delta.x = factor * text.preferredWidth + offset;
//rt.sizeDelta = delta;
Vector2 pos = rt.sizeDelta;
pos.x = -0.5f * text.preferredWidth - offset;
rt.sizeDelta = pos;
}
}
}

BIN
Assets/GWConquest/Textures/Icons/DistrictSpaceStation.png View File

Before After
Width: 180  |  Height: 180  |  Size: 1.9 KiB

+ 128
- 0
Assets/GWConquest/Textures/Icons/DistrictSpaceStation.png.meta View File

@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: 8d5ce267321304f4aa619de53dda637e
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 2
mipBias: -100
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: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 2
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/GWConquest/Textures/Icons/Station 1.png View File

Before After
Width: 180  |  Height: 180  |  Size: 1.9 KiB Width: 180  |  Height: 180  |  Size: 1.5 KiB

BIN
Assets/GWConquest/Textures/Icons/Station 2.png View File

Before After
Width: 180  |  Height: 180  |  Size: 1.5 KiB Width: 180  |  Height: 180  |  Size: 1.6 KiB

BIN
Assets/GWConquest/Textures/Icons/Station 3.png View File

Before After
Width: 180  |  Height: 180  |  Size: 1.6 KiB Width: 180  |  Height: 180  |  Size: 1.6 KiB

BIN
Assets/GWConquest/Textures/Icons/Station 4.png View File

Before After
Width: 180  |  Height: 180  |  Size: 1.6 KiB Width: 180  |  Height: 180  |  Size: 1.7 KiB

BIN
Assets/GWConquest/Textures/Icons/Station 5 Hotheseer.png View File

Before After
Width: 180  |  Height: 180  |  Size: 1.9 KiB

+ 128
- 0
Assets/GWConquest/Textures/Icons/Station 5 Hotheseer.png.meta View File

@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: 172640fc5864b844ab9774254c652765
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 2
mipBias: -100
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: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 2
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/GWConquest/Textures/Icons/Station 5.png View File

Before After
Width: 180  |  Height: 180  |  Size: 1.7 KiB Width: 180  |  Height: 180  |  Size: 1.9 KiB

Loading…
Cancel
Save