FUCK YEAH GALAXIES

This commit is contained in:
hyperion51 2020-03-28 05:18:57 +00:00
commit 1898fffe76
59 changed files with 1713 additions and 823 deletions

View file

@ -18,5 +18,6 @@ public class DragHandler : MonoBehaviour
Camera.transform.position -= (Vector3)((Vector2) newPosition - _previousPosition);
}
Camera.orthographicSize *= 1 + Input.mouseScrollDelta.y * Scaling;
}
}

View file

@ -19,13 +19,14 @@ public class LoginScreen : MonoBehaviour
void Start()
{
CultClient.Connect(Server.text);
Error.text = " ";
LoginButton.CurrentState = FlatButtonState.Selected;
CultClient.AddMessageListener<LoginSuccessMessage>(success => SceneManager.LoadScene("Main"));
CultClient.OnError += s => Error.text = s;
RegisterButton.OnClick += _ =>
{
if(!CultClient.Connected)
CultClient.Connect(Server.text);
if (_registering)
{
CultClient.Register(Email.text, Username.text, Password.text);
@ -42,6 +43,8 @@ public class LoginScreen : MonoBehaviour
};
LoginButton.OnClick += _ =>
{
if(!CultClient.Connected)
CultClient.Connect(Server.text);
if (_registering)
{
_registering = false;

View file

@ -57,8 +57,8 @@ Material:
m_Offset: {x: 0, y: 0}
m_Floats:
- Distortion: 0.5
- Gain: 0.33
- Gather: -0.25
- Gain: 0.1
- Gather: -0.5
- GatherWavelength: 1
- NoiseAmplitude: 0.5
- NoiseFrequency: 0.2
@ -66,7 +66,7 @@ Material:
- NoiseLacunarity: 2.75
- NoiseOffset: 1
- NoisePosition: 0
- Parallax: 0.1
- Parallax: 0
- ParallaxLacunarity: 2
- ScrollSpeed: 1
- Speed: 5

BIN
Assets/Resources/Test.asset (Stored with Git LFS)

Binary file not shown.

View file

@ -10119,7 +10119,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
Camera: {fileID: 519420031}
Scaling: 0
Scaling: -0.025
--- !u!4 &565356062
Transform:
m_ObjectHideFlags: 0
@ -10141,7 +10141,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 565356060}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f60c7818169f95468915fbca3ef4773, type: 3}
m_Name:
@ -11095,7 +11095,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
TabGroup: {fileID: 143833105}
TabButton: {fileID: 618245060}
TabButton: {fileID: 646091942}
--- !u!1 &602701097
GameObject:
m_ObjectHideFlags: 0
@ -21646,7 +21646,7 @@ MonoBehaviour:
GalaxyZonePrototype: {fileID: 559120531}
GalaxyZoneLinkPrototype: {fileID: 899487252}
GalaxyBackground: {fileID: 1938745697}
GalaxyScale: 1000
GalaxyScale: 100
ZoneObjectPrototype: {fileID: 1007041026}
PlanetSprite: {fileID: 2800000, guid: 0d2acbd593b7fd349b0b26b4844733ef, type: 3}
GasGiantSprite: {fileID: 2800000, guid: 39505115515c61f4db3c5c5397a5ba49, type: 3}

View file

@ -756,7 +756,7 @@ PrefabInstance:
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 63.004997
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
@ -2232,7 +2232,7 @@ PrefabInstance:
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 54.465
objectReference: {fileID: 0}
- target: {fileID: 878382121558056004, guid: 2758dfa2744d7ad4d8877545189d116e,
type: 3}

View file

@ -121,10 +121,10 @@ public static class CultClient {
{
case LoginSuccessMessage loginSuccess:
_token = loginSuccess.Session;
return;
break;
case ErrorMessage error:
OnError?.Invoke(error.Error);
return;
break;
}
}

View file

@ -280,7 +280,8 @@ public class GalaxyEditor : Editor
{
ID = starIDs[star],
Name = starIDs[star].ToString().Substring(0, 8),
Wormholes = star.Links.Select(i => starIDs[galaxy.MapData.Stars[i]]).ToList()
Wormholes = star.Links.Select(i => starIDs[galaxy.MapData.Stars[i]]).ToList(),
Position = star.Position
}).Run(_connection);
}

View file

@ -94,6 +94,8 @@ public static class Extensions
yield break;
}
yield return type;
// return all implemented or inherited interfaces
foreach (var i in type.GetInterfaces())
{

View file

@ -24,7 +24,7 @@ public class StrategyGameManager : MonoBehaviour
private DatabaseCache _cache;
private GameContext _context;
private Dictionary<Guid, GalaxyResponseZone> _galaxy;
private GalaxyResponseMessage _galaxy;
private TabButton _currentTab;
private bool _galaxyPopulated;
@ -33,58 +33,61 @@ public class StrategyGameManager : MonoBehaviour
PrimaryTabGroup.OnTabChange += button =>
{
_currentTab = button;
if (button == GalaxyTabButton)
if (button == GalaxyTabButton && !_galaxyPopulated)
{
PopulateGalaxy();
}
};
CultClient.AddMessageListener<GalaxyResponseMessage>(galaxy =>
{
_galaxy = galaxy.Zones.ToDictionary(z=>z.ZoneID);
_galaxy = galaxy;
if (_currentTab == GalaxyTabButton && !_galaxyPopulated)
{
_galaxyPopulated = true;
GalaxyBackground.transform.localScale = Vector3.one * GalaxyScale;
var galaxyMat = GalaxyBackground.material;
galaxyMat.SetFloat("Arms", galaxy.GlobalData.Arms);
galaxyMat.SetFloat("Twist", galaxy.GlobalData.Twist);
galaxyMat.SetFloat("TwistPower", galaxy.GlobalData.TwistPower);
galaxyMat.SetFloat("SpokeOffset", galaxy.StarDensity.SpokeOffset);
galaxyMat.SetFloat("SpokeScale", galaxy.StarDensity.SpokeScale);
galaxyMat.SetFloat("CoreBoost", galaxy.StarDensity.CoreBoost);
galaxyMat.SetFloat("CoreBoostOffset", galaxy.StarDensity.CoreBoostOffset);
galaxyMat.SetFloat("CoreBoostPower", galaxy.StarDensity.CoreBoostPower);
galaxyMat.SetFloat("EdgeReduction", galaxy.StarDensity.EdgeReduction);
galaxyMat.SetFloat("NoisePosition", galaxy.StarDensity.NoisePosition);
galaxyMat.SetFloat("NoiseAmplitude", galaxy.StarDensity.NoiseAmplitude);
galaxyMat.SetFloat("NoiseOffset", galaxy.StarDensity.NoiseOffset);
galaxyMat.SetFloat("NoiseGain", galaxy.StarDensity.NoiseGain);
galaxyMat.SetFloat("NoiseLacunarity", galaxy.StarDensity.NoiseLacunarity);
galaxyMat.SetFloat("NoiseFrequency", galaxy.StarDensity.NoiseFrequency);
var linkedZones = new List<Guid>();
foreach (var zone in galaxy.Zones)
{
var instance = GalaxyZonePrototype.Instantiate<Transform>();
instance.position = float3((Vector2) zone.Position - Vector2.one * (GalaxyScale * .5f),0) * GalaxyScale;
foreach (var linkedZone in zone.Links.Where(l=>linkedZones.Contains(l)))
{
var link = GalaxyZoneLinkPrototype.Instantiate<Transform>();
var diff = _galaxy[linkedZone].Position - zone.Position;
link.position = instance.position + Vector3.forward*.1f;
link.rotation = Quaternion.Euler(0,0,atan2(diff.y, diff.x) * Mathf.Rad2Deg);
link.localScale = new Vector3(length(diff) * GalaxyScale, 1, 1);
}
}
PopulateGalaxy();
}
});
CultClient.Send(new GalaxyRequestMessage());
}
void Update()
void PopulateGalaxy()
{
_galaxyPopulated = true;
GalaxyBackground.transform.localScale = Vector3.one * GalaxyScale;
var galaxyMat = GalaxyBackground.material;
galaxyMat.SetFloat("Arms", _galaxy.GlobalData.Arms);
galaxyMat.SetFloat("Twist", _galaxy.GlobalData.Twist);
galaxyMat.SetFloat("TwistPower", _galaxy.GlobalData.TwistPower);
galaxyMat.SetFloat("SpokeOffset", _galaxy.StarDensity.SpokeOffset);
galaxyMat.SetFloat("SpokeScale", _galaxy.StarDensity.SpokeScale);
galaxyMat.SetFloat("CoreBoost", _galaxy.StarDensity.CoreBoost);
galaxyMat.SetFloat("CoreBoostOffset", _galaxy.StarDensity.CoreBoostOffset);
galaxyMat.SetFloat("CoreBoostPower", _galaxy.StarDensity.CoreBoostPower);
galaxyMat.SetFloat("EdgeReduction", _galaxy.StarDensity.EdgeReduction);
galaxyMat.SetFloat("NoisePosition", _galaxy.StarDensity.NoisePosition);
galaxyMat.SetFloat("NoiseAmplitude", _galaxy.StarDensity.NoiseAmplitude);
galaxyMat.SetFloat("NoiseOffset", _galaxy.StarDensity.NoiseOffset);
galaxyMat.SetFloat("NoiseGain", _galaxy.StarDensity.NoiseGain);
galaxyMat.SetFloat("NoiseLacunarity", _galaxy.StarDensity.NoiseLacunarity);
galaxyMat.SetFloat("NoiseFrequency", _galaxy.StarDensity.NoiseFrequency);
var zones = _galaxy.Zones.ToDictionary(z=>z.ZoneID);
var linkedZones = new List<Guid>();
foreach (var zone in _galaxy.Zones)
{
linkedZones.Add(zone.ZoneID);
var instance = GalaxyZonePrototype.Instantiate<Transform>();
instance.position = float3((Vector2) zone.Position - Vector2.one * .5f,0) * GalaxyScale;
instance.GetComponent<GalaxyZone>().Label.text = zone.Name;
foreach (var linkedZone in zone.Links.Where(l=>!linkedZones.Contains(l)))
{
var link = GalaxyZoneLinkPrototype.Instantiate<Transform>();
var diff = zones[linkedZone].Position - zone.Position;
link.position = instance.position + Vector3.forward*.1f;
link.rotation = Quaternion.Euler(0,0,atan2(diff.y, diff.x) * Mathf.Rad2Deg);
link.localScale = new Vector3(length(diff) * GalaxyScale, 1, 1);
}
}
}
}

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -4,47 +4,21 @@ C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netco
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Economy.Server.runtimeconfig.dev.json
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Economy.Server.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Economy.Server.pdb
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Grpc.Core.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Grpc.Core.Api.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\MagicOnion.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\MagicOnion.Abstractions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\MagicOnion.Hosting.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\MessagePack.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\MessagePack.Annotations.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Bcl.AsyncInterfaces.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.Abstractions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.Binder.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.CommandLine.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.EnvironmentVariables.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.FileExtensions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.Json.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.UserSecrets.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.DependencyInjection.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.DependencyInjection.Abstractions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.FileProviders.Abstractions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.FileProviders.Physical.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.FileSystemGlobbing.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Hosting.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Hosting.Abstractions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.Abstractions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.Configuration.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.Console.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.Debug.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.EventLog.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.EventSource.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Options.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Options.ConfigurationExtensions.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Primitives.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\System.Diagnostics.EventLog.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\runtimes\linux\native\libgrpc_csharp_ext.x64.so
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\runtimes\linux\native\libgrpc_csharp_ext.x86.so
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\runtimes\osx\native\libgrpc_csharp_ext.x64.dylib
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\runtimes\osx\native\libgrpc_csharp_ext.x86.dylib
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\runtimes\win\native\grpc_csharp_ext.x64.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\runtimes\win\native\grpc_csharp_ext.x86.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Diagnostics.EventLog.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Economy.Shared.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Economy.Shared.pdb
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\obj\Debug\netcoreapp3.1\Economy.Server.csprojAssemblyReference.cache
@ -53,3 +27,16 @@ C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\obj\Debug\netco
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\obj\Debug\netcoreapp3.1\Economy.Server.csproj.CopyComplete
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\obj\Debug\netcoreapp3.1\Economy.Server.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\obj\Debug\netcoreapp3.1\Economy.Server.pdb
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Isopoh.Cryptography.Argon2.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Isopoh.Cryptography.Blake2b.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Isopoh.Cryptography.SecureArray.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Remotion.Linq.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Serilog.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Serilog.Extensions.Logging.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\Serilog.Sinks.File.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\System.ComponentModel.Annotations.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\System.Reactive.Linq.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\System.Runtime.CompilerServices.Unsafe.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\System.Reactive.dll
C:\Users\rwvens\Documents\GitHub\Aetheria-Economy\Economy.Server\bin\Debug\netcoreapp3.1\System.Reactive.xml

Binary file not shown.

Binary file not shown.

Binary file not shown.