Browse Source

Planet Exploration Part 1

master
Laurids Jeppe 3 years ago
parent
commit
39da3acb57
13 changed files with 500 additions and 31 deletions
  1. +42
    -1
      Assets/GWConquest/Materials/Planets/Yeesveer.mat
  2. +249
    -4
      Assets/GWConquest/Scenes/GalaxyMap.unity
  3. +128
    -0
      Assets/GWConquest/Scripts/Planet.cs
  4. +1
    -1
      Assets/GWConquest/Scripts/PlanetConnection.cs
  5. +7
    -0
      Assets/GWConquest/Scripts/PlanetPlacement.cs
  6. +18
    -0
      Assets/GWConquest/Scripts/Player.cs
  7. +2
    -0
      Assets/GWConquest/Scripts/ServerCallbacks.cs
  8. +8
    -0
      Assets/GWConquest/Scripts/UI/DebugUI.cs
  9. +9
    -23
      Assets/GWConquest/Scripts/UI/IngameUI.cs
  10. BIN
      Assets/Photon/PhotonBolt/assemblies/bolt.user.dll
  11. BIN
      Assets/Photon/PhotonBolt/assemblies/bolt.user.dll.mdb
  12. +34
    -0
      Assets/Photon/PhotonBolt/project.json
  13. +2
    -2
      Assets/Photon/PhotonBolt/resources/BoltRuntimeSettings.asset

+ 42
- 1
Assets/GWConquest/Materials/Planets/Yeesveer.mat View File

@ -8,7 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Yeesveer
m_Shader: {fileID: 4800000, guid: e22cfb9799549294d9e7d9740c2222d7, type: 3}
m_Shader: {fileID: 4800000, guid: 2b63a18536f01a84ea44b4a20e3d9950, type: 3}
m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _NORMALMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
@ -23,10 +23,18 @@ Material:
m_Texture: {fileID: 2800000, guid: aa0499918eb7fb546bc509eb1a43d03e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Albedo:
m_Texture: {fileID: 2800000, guid: 8c232147410f0e244a51296d83aa7bcf, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 87014c6ae32d60a4299a487ec1f752be, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _CloudsAlpha:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@ -43,10 +51,18 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Emissivecities:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Glossiness:
m_Texture: {fileID: 2800000, guid: d57781f65f38a1741b71cb1f05782549, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LookupSunset:
m_Texture: {fileID: 2800000, guid: 3c94491068797e54b9d16576eeb33a8c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 8c232147410f0e244a51296d83aa7bcf, type: 3}
m_Scale: {x: 1, y: 1}
@ -59,6 +75,10 @@ Material:
m_Texture: {fileID: 2800000, guid: 9a98456ba8ba376499c5321e3c8c5350, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normalmap:
m_Texture: {fileID: 2800000, guid: 87014c6ae32d60a4299a487ec1f752be, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 2800000, guid: 91de6fc0a8829d74ea933f8f3f964b76, type: 3}
m_Scale: {x: 1, y: 1}
@ -67,26 +87,47 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _watermask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AOalbedo: 0.309
- _AOintensity: 2.17
- _AOsmoothness: -1
- _BumpScale: 0.239
- _Citiesoffset: 0
- _Cloudspeed: 1
- _Cutoff: 0.588
- _Desaturation: 0
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EmissionScale: 0
- _EmissionScaleUI: 15
- _Gloss: 0.61
- _Glossiness: 0.563
- _Metallic: 0
- _Mode: 0
- _Normalintensity: 0.23
- _OcclusionStrength: 1
- _Parallax: 0.0094
- _SmoothnessShift: -1
- _SrcBlend: 1
- _Subatmosphereglobalintensity: 2.3
- _Subatmospherepower: 3.01
- _UVSec: 0
- _ZWrite: 1
- __dirty: 1
m_Colors:
- _Albedocolor: {r: 1, g: 1, b: 1, a: 0}
- _AmbiantLightcontrol: {r: 0, g: 0, b: 0, a: 0}
- _Citiescolor: {r: 1, g: 0.815662, b: 0.55899996, a: 0}
- _Color: {r: 0.6102941, g: 0.6102941, b: 0.6102941, a: 1}
- _EmissionColor: {r: 15, g: 15, b: 15, a: 15}
- _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1}
- _Subatmospherecolor: {r: 1, g: 0.7633016, b: 0.53400004, a: 1}
- _cloudscolor: {r: 1, g: 1, b: 1, a: 0}

+ 249
- 4
Assets/GWConquest/Scenes/GalaxyMap.unity View File

@ -20238,6 +20238,185 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 361538868}
m_CullTransparentMesh: 0
--- !u!1001 &361889915
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 587515776}
m_Modifications:
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_Pivot.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchorMin.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_SizeDelta.x
value: 160
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_SizeDelta.y
value: 20
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -112
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -194.6
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_IsOn
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 587515777}
- target: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: UpdateFlags
objectReference: {fileID: 0}
- target: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 7812941609799020086, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_Name
value: ShowAllPlanetsToggle
objectReference: {fileID: 0}
- target: {fileID: 8066966353499113917, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_Text
value: 'Show All Planets
'
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e3a33840ede156a41897af05660eaa8f, type: 3}
--- !u!114 &361889916 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4776345302491507486, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
m_PrefabInstance: {fileID: 361889915}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &361889917 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
m_PrefabInstance: {fileID: 361889915}
m_PrefabAsset: {fileID: 0}
--- !u!1 &362873853
GameObject:
m_ObjectHideFlags: 0
@ -31258,6 +31437,7 @@ RectTransform:
- {fileID: 218888189}
- {fileID: 7239305452121996006}
- {fileID: 2046872097}
- {fileID: 361889917}
- {fileID: 740356799}
- {fileID: 953746576}
m_Father: {fileID: 494226835}
@ -31286,6 +31466,7 @@ MonoBehaviour:
PlayerText: {fileID: 1278702605}
LogBattleEventsToggle: {fileID: 7239305452121996007}
ShowHiddenUnitsToggle: {fileID: 2046872096}
ShowAllPlanetsToggle: {fileID: 361889916}
MoveEnemyUnitsToggle: {fileID: 740356798}
FreeBuildToggle: {fileID: 953746575}
--- !u!1 &590405909
@ -39099,7 +39280,7 @@ PrefabInstance:
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_RootOrder
value: 7
value: 8
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
@ -39174,7 +39355,7 @@ PrefabInstance:
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -195
value: -234.59998
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
@ -41290,6 +41471,18 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 766573527}
m_PrefabAsset: {fileID: 0}
--- !u!114 &766573529 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4693635103355546010, guid: 9ae35d7f911b63f4f95f432141dd5746,
type: 3}
m_PrefabInstance: {fileID: 766573527}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59300c3dd14d29d4895f5f18e85d7eb3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &766573531 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4678135251219452001, guid: 9ae35d7f911b63f4f95f432141dd5746,
@ -50663,7 +50856,7 @@ PrefabInstance:
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_RootOrder
value: 8
value: 9
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
@ -50738,7 +50931,7 @@ PrefabInstance:
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -235
value: -274.59998
objectReference: {fileID: 0}
- target: {fileID: 3488189570041213548, guid: e3a33840ede156a41897af05660eaa8f,
type: 3}
@ -93838,6 +94031,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 236028523}
m_Modifications:
- target: {fileID: 1025142505092412, guid: 7311d170d172b8443ae175801f682aad, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1139380544730900, guid: 7311d170d172b8443ae175801f682aad, type: 3}
propertyPath: m_IsActive
value: 1
@ -103026,6 +103223,54 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1829904043}
m_CullTransparentMesh: 0
--- !u!1 &1830077742
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1830077744}
- component: {fileID: 1830077743}
m_Layer: 0
m_Name: PlayerShips
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1830077743
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1830077742}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e3fbe30dead34c49a8585bf21ae46af, type: 3}
m_Name:
m_EditorClassIdentifier:
unitName: Frigate
unitCount: 6
playerId: 0
zone: {fileID: 766573529}
assignAsLeader: 0
--- !u!4 &1830077744
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1830077742}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1237.9204, y: 739.1835, z: -714.2501}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1834518974
PrefabInstance:
m_ObjectHideFlags: 0


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

@ -58,6 +58,10 @@ namespace GWConquest
public List<Formation> InTransitFormations = new List<Formation>();
public PlanetVisibilityStatus VisibilityStatus = PlanetVisibilityStatus.Hidden;
public float OriginalDesaturation;
public Zone[] GetZones(ZoneType type)
{
switch (type)
@ -166,6 +170,12 @@ namespace GWConquest
State.PlanetName = planetName;
}
var rend = GetComponentsInParent<Renderer>().Where(r => r.material.HasProperty("_Desaturation")).FirstOrDefault();
if(rend != null)
{
OriginalDesaturation = rend.material.GetFloat("_Desaturation");
}
}
}
@ -299,6 +309,18 @@ namespace GWConquest
public void OnFormationsChanged()
{
formationsChangedSinceLastFrame = true;
if(BoltNetwork.IsServer)
{
var currentPlayers = GetAllFormations(ZoneType.Space).Select(f => f.Player).Distinct();
foreach(Player player in currentPlayers)
{
if(!player.Faction.IsAI && GetVisibilityStatus(player) != PlanetVisibilityStatus.Visible)
{
SetPlanetVisible(player);
}
}
}
}
private void FixedUpdate()
@ -347,7 +369,108 @@ namespace GWConquest
}
}
public PlanetVisibilityStatus GetVisibilityStatus(Player player)
{
if(player.VisiblePlanetsList.FirstOrDefault(e => e.Entity == entity) != null)
{
return PlanetVisibilityStatus.Visible;
}
else if(player.KnownPlanetsList.FirstOrDefault(e => e.Entity == entity) != null)
{
return PlanetVisibilityStatus.Known;
}
else {
return PlanetVisibilityStatus.Hidden;
}
}
public static void UpdateVisibilityStatus()
{
foreach(var planet in Planet.AllPlanets)
{
planet.VisibilityStatus = planet.GetVisibilityStatus(Player.CurrentPlayer);
planet.UpdatePlanetRenderer();
}
foreach(var conn in FindObjectsOfType<PlanetConnection>())
{
if(!conn.IsPreConnection)
{
if(IngameUI.PlanetViewEnabled)
{
conn.GetComponent<LineRenderer>().enabled = false;
}
else if(conn.planet1.VisibilityStatus == PlanetVisibilityStatus.Visible || conn.planet2.VisibilityStatus == PlanetVisibilityStatus.Visible)
{
conn.GetComponent<LineRenderer>().enabled = true;
}
else {
conn.GetComponent<LineRenderer>().enabled = false;
}
}
}
}
public void SetPlanetVisible(Player player)
{
if(VisibilityStatus != PlanetVisibilityStatus.Visible)
{
player.VisiblePlanetsList.Add(entity);
foreach(var cpe in ConnectedPlanetsList)
{
var otherPlanet = cpe.Entity.GetComponent<Planet>();
if(otherPlanet.VisibilityStatus == PlanetVisibilityStatus.Hidden)
{
player.KnownPlanetsList.Add(otherPlanet.entity);
}
}
}
}
public void UpdatePlanetRenderer()
{
if((VisibilityStatus == PlanetVisibilityStatus.Hidden && !DebugUI.ShowAllPlanets)
|| (IngameUI.PlanetViewEnabled && IngameUI.Instance.PlanetView.selectedPlanet != this))
{
foreach(Renderer r in GetComponentsInChildren<Renderer>())
{
r.enabled = false;
}
foreach(Collider c in GetComponentsInChildren<Collider>())
{
c.enabled = false;
}
indicatorUI.gameObject.SetActive(false);
}
else {
foreach(Renderer r in GetComponentsInChildren<Renderer>())
{
r.enabled = true;
if(r.material.HasProperty("_Desaturation"))
{
if(VisibilityStatus == PlanetVisibilityStatus.Known)
{
r.material.SetFloat("_Desaturation", 1f);
}
else
{
r.material.SetFloat("_Desaturation", OriginalDesaturation);
}
}
}
foreach(Collider c in GetComponentsInChildren<Collider>())
{
c.enabled = true;
}
indicatorUI.gameObject.SetActive(true);
}
}
#if UNITY_EDITOR
@ -605,4 +728,9 @@ namespace GWConquest
#endif
}
public enum PlanetVisibilityStatus
{
Hidden, Known, Visible
}
}

+ 1
- 1
Assets/GWConquest/Scripts/PlanetConnection.cs View File

@ -59,7 +59,7 @@ namespace GWConquest
lineRenderer.startColor = Util.UpdateColorRGB(lineRenderer.startColor, color1);
lineRenderer.endColor = Util.UpdateColorRGB(lineRenderer.endColor, color2);
if(player1 != null && player2 != null && player1 == player2)
if(lineRenderer.enabled && player1 != null && player2 != null && player1 == player2)
{
var distance = Vector3.Distance(planet1.transform.position, planet2.transform.position);
var runtime = distance / QuadSpeed;


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

@ -92,6 +92,13 @@ namespace GWConquest
float scale = planet.State.PrefabScale * prefab.transform.localScale.x;
sphereGO.transform.localScale = scale * Vector3.one;
var rend = planet.GetComponentsInParent<Renderer>().Where(r => r.material.HasProperty("_Desaturation")).FirstOrDefault();
if(rend != null)
{
planet.OriginalDesaturation = rend.material.GetFloat("_Desaturation");
}
}
public PlanetConnection SpawnPlanetConnection(Planet planet1, Planet planet2)


+ 18
- 0
Assets/GWConquest/Scripts/Player.cs View File

@ -38,6 +38,9 @@ namespace GWConquest
get => State.PlayerId;
}
public EntityList KnownPlanetsList;
public EntityList VisiblePlanetsList;
public override void Attached()
{
Debug.Log("Attaching player...");
@ -46,8 +49,21 @@ namespace GWConquest
{
State.PlayerId = PlayerList.IndexOf(this);
}
KnownPlanetsList = new EntityList(State, "KnownPlanetsList");
VisiblePlanetsList = new EntityList(State, "VisiblePlanetsList");
State.AddCallback("KnownPlanetsList", () => {
Planet.UpdateVisibilityStatus();
});
State.AddCallback("VisiblePlanetsList", () => {
Planet.UpdateVisibilityStatus();
});
}
public override void Detached()
{
PlayerList.Remove(this);
@ -96,6 +112,8 @@ namespace GWConquest
{
d.ControllingPlayer = this;
}
p.SetPlanetVisible(this);
}
}
}


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

@ -43,6 +43,8 @@ namespace GWConquest
z.CheckBattleStart();
}
Planet.SetupPlanetPathfinding();
GameManager.EntitiesLoaded = true;
LoadingScreen.Dismiss();


+ 8
- 0
Assets/GWConquest/Scripts/UI/DebugUI.cs View File

@ -9,6 +9,7 @@ namespace GWConquest
{
public static bool LogBattleEvents = false;
public static bool ShowHiddenUnits = false;
public static bool ShowAllPlanets = false;
public static bool MoveEnemyUnits = false;
public static bool FreeBuild = false;
@ -20,6 +21,7 @@ namespace GWConquest
public Toggle LogBattleEventsToggle;
public Toggle ShowHiddenUnitsToggle;
public Toggle ShowAllPlanetsToggle;
public Toggle MoveEnemyUnitsToggle;
public Toggle FreeBuildToggle;
@ -70,8 +72,14 @@ namespace GWConquest
{
LogBattleEvents = LogBattleEventsToggle.isOn;
ShowHiddenUnits = ShowHiddenUnitsToggle.isOn;
ShowAllPlanets = ShowAllPlanetsToggle.isOn;
MoveEnemyUnits = MoveEnemyUnitsToggle.isOn;
FreeBuild = FreeBuildToggle.isOn;
foreach(Planet planet in Planet.AllPlanets)
{
planet.UpdatePlanetRenderer();
}
}
}
}


+ 9
- 23
Assets/GWConquest/Scripts/UI/IngameUI.cs View File

@ -194,25 +194,17 @@ namespace GWConquest
PlanetView.gameObject.SetActive(true);
PlanetView.SelectPlanet(planet);
foreach(Planet p in Planet.AllPlanets)
{
if(p != planet)
{
foreach(Renderer r in p.GetComponentsInChildren<Renderer>())
{
r.enabled = false;
}
}
p.indicatorUI.gameObject.SetActive(false);
}
if(planet.BackgroundMusic != null)
{
SoundEffects.Instance.PlayMusic(planet.BackgroundMusic);
}
PlanetViewEnabled = true;
foreach(Planet p in Planet.AllPlanets)
{
p.UpdatePlanetRenderer();
}
}
}
@ -223,15 +215,6 @@ namespace GWConquest
PlanetView.HideUI();
PlanetView.gameObject.SetActive(false);
foreach(Planet p in Planet.AllPlanets)
{
foreach (Renderer r in p.GetComponentsInChildren<Renderer>())
{
r.enabled = true;
}
p.indicatorUI.gameObject.SetActive(true);
}
GWCamera camera = FindObjectOfType<GWCamera>();
camera.ResetCameraTransform();
@ -253,7 +236,10 @@ namespace GWConquest
viewedPlanet = null;
PlanetViewEnabled = false;
foreach(Planet p in Planet.AllPlanets)
{
p.UpdatePlanetRenderer();
}
}


BIN
Assets/Photon/PhotonBolt/assemblies/bolt.user.dll View File


BIN
Assets/Photon/PhotonBolt/assemblies/bolt.user.dll.mdb View File


+ 34
- 0
Assets/Photon/PhotonBolt/project.json View File

@ -671,6 +671,40 @@
"ExtrapolationMaxFrames": 9,
"SnapMagnitude": 10.0
}
},
{
"Name": "KnownPlanetsList",
"Enabled": true,
"Expanded": true,
"ReplicationMode": 1,
"Priority": 1,
"PropertyType": {
"$type": "Photon.Bolt.Compiler.PropertyTypeProtocolToken, bolt.compiler"
},
"AssetSettings": {
"$type": "Photon.Bolt.Compiler.PropertyStateSettings, bolt.compiler",
"ExtrapolationErrorTolerance": 0.25,
"_ExtrapolationCorrectionFrames": 6,
"ExtrapolationMaxFrames": 9,
"SnapMagnitude": 10.0
}
},
{
"Name": "VisiblePlanetsList",
"Enabled": true,
"Expanded": true,
"ReplicationMode": 1,
"Priority": 1,
"PropertyType": {
"$type": "Photon.Bolt.Compiler.PropertyTypeProtocolToken, bolt.compiler"
},
"AssetSettings": {
"$type": "Photon.Bolt.Compiler.PropertyStateSettings, bolt.compiler",
"ExtrapolationErrorTolerance": 0.25,
"_ExtrapolationCorrectionFrames": 6,
"ExtrapolationMaxFrames": 9,
"SnapMagnitude": 10.0
}
}
],
"PacketMaxBits": 512,


+ 2
- 2
Assets/Photon/PhotonBolt/resources/BoltRuntimeSettings.asset View File

@ -50,10 +50,10 @@ MonoBehaviour:
debugStartPort: 54321
debugBuildMode: 1
debugStartMapName: GalaxyMap
debugPlayAsServer: 0
debugPlayAsServer: 1
showDebugInfo: 0
overrideTimeScale: 1
debugEditorMode: 2
debugEditorMode: 1
consoleToggleKey: 9
consoleVisibleByDefault: 0
compilationWarnLevel: 4


Loading…
Cancel
Save