Generating and Displaying Zones

This commit is contained in:
hyperion51 2020-03-29 04:19:24 +01:00
commit f756c5fe6a
67 changed files with 1343 additions and 826 deletions

View file

@ -9,11 +9,6 @@
<e p="Assembly-CSharp-firstpass.csproj" t="IncludeRecursive" />
<e p="Assembly-CSharp.csproj" t="IncludeRecursive" />
<e p="Assets" t="Include">
<e p="ClickableCollider.cs" t="Include" />
<e p="ClickRaycaster.cs" t="Include" />
<e p="DragHandler.cs" t="Include" />
<e p="GalaxyZone.cs" t="Include" />
<e p="LoginScreen.cs" t="Include" />
<e p="Plugins" t="Include">
<e p="AsyncAwaitUtil" t="Include">
<e p="Source" t="Include">
@ -56,8 +51,6 @@
</e>
</e>
<e p="Scripts" t="Include">
<e p="BackgroundRenderer.cs" t="Include" />
<e p="ClickCatcher.cs" t="Include" />
<e p="CultClient.cs" t="Include" />
<e p="Editor" t="Include">
<e p="DatabaseInspector.cs" t="Include" />
@ -66,9 +59,7 @@
<e p="GalaxyEditor.cs" t="Include" />
<e p="SerializerTestWindow.cs" t="Include" />
</e>
<e p="FlatButton.cs" t="Include" />
<e p="Galaxy.cs" t="Include" />
<e p="Icons.cs" t="Include" />
<e p="InitialSettings.cs" t="Include" />
<e p="MarkovNameGenerator.cs" t="Include" />
<e p="NIH" t="Include">
@ -665,8 +656,6 @@
</e>
<e p="XKCDColors.cs" t="Include" />
</e>
<e p="Orbit.cs" t="Include" />
<e p="PropertiesPanel.cs" t="Include" />
<e p="Prototype.cs" t="Include" />
<e p="ServerShared" t="Include">
<e p="ActionCollection.cs" t="Include" />
@ -1095,29 +1084,42 @@
</e>
</e>
</e>
<e p="OrbitInstance.cs" t="Include" />
<e p="Ship.cs" t="Include" />
<e p="ZoneData.cs" t="Include" />
<e p="ZoneGenerator.cs" t="Include" />
</e>
<e p="TabActivator.cs" t="Include" />
<e p="TabButton.cs" t="Include" />
<e p="TabGroup.cs" t="Include" />
<e p="StrategyGameManager.cs" t="Include" />
<e p="Targetable.cs" t="Include" />
<e p="UI" t="Include">
<e p="BackgroundRenderer.cs" t="Include" />
<e p="ClickableCollider.cs" t="Include" />
<e p="ClickCatcher.cs" t="Include" />
<e p="ClickRaycaster.cs" t="Include" />
<e p="DragHandler.cs" t="Include" />
<e p="FlatButton.cs" t="Include" />
<e p="GalaxyZone.cs" t="Include" />
<e p="Icons.cs" t="Include" />
<e p="LoginScreen.cs" t="Include" />
<e p="PropertiesPanel.cs" t="Include" />
<e p="TabActivator.cs" t="Include" />
<e p="TabButton.cs" t="Include" />
<e p="TabGroup.cs" t="Include" />
<e p="ZoneObject.cs" t="Include" />
<e p="ZoneRenderer.cs" t="Include" />
</e>
<e p="UnityExtensions.cs" t="Include" />
<e p="UnityFormatters.cs" t="Include" />
<e p="ZoneRenderer.cs" t="Include" />
</e>
<e p="Shaders" t="Include">
<e p="AdditiveUI.shader" t="Include" />
<e p="Background.shader" t="Include" />
<e p="Clouds.shader" t="Include" />
<e p="CubicPulseBrush.shader" t="Include" />
<e p="GalaxyMap.shader" t="Include" />
<e p="Isolines.shader" t="Include" />
<e p="PowerBrush.shader" t="Include" />
<e p="SimplexBrush.shader" t="Include" />
</e>
<e p="StrategyGameManager.cs" t="Include" />
<e p="TextMesh Pro" t="Include">
<e p="Fonts" t="Include">
<e p="LiberationSans - OFL.txt" t="Include" />
@ -1146,7 +1148,6 @@
<e p="EmojiOne Attribution.txt" t="Include" />
</e>
</e>
<e p="ZoneObject.cs" t="Include" />
</e>
<e p="Economy.Shared.Unity.csproj" t="IncludeRecursive" />
<e p="MessagePack.csproj" t="IncludeRecursive" />

View file

@ -429,7 +429,6 @@
</e>
</e>
</e>
<e p="Assets\Scripts\ServerShared\OrbitInstance.cs" t="Include" />
<e p="Assets\Scripts\ServerShared\Ship.cs" t="Include" />
<e p="Assets\Scripts\ServerShared\ZoneData.cs" t="Include" />
<e p="Assets\Scripts\ServerShared\ZoneGenerator.cs" t="Include" />

View file

@ -60,17 +60,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\ClickableCollider.cs" />
<Compile Include="Assets\ClickRaycaster.cs" />
<Compile Include="Assets\DragHandler.cs" />
<Compile Include="Assets\GalaxyZone.cs" />
<Compile Include="Assets\LoginScreen.cs" />
<Compile Include="Assets\Scripts\BackgroundRenderer.cs" />
<Compile Include="Assets\Scripts\ClickCatcher.cs" />
<Compile Include="Assets\Scripts\CultClient.cs" />
<Compile Include="Assets\Scripts\FlatButton.cs" />
<Compile Include="Assets\Scripts\Galaxy.cs" />
<Compile Include="Assets\Scripts\Icons.cs" />
<Compile Include="Assets\Scripts\InitialSettings.cs" />
<Compile Include="Assets\Scripts\MarkovNameGenerator.cs" />
<Compile Include="Assets\Scripts\NIH\LinqFaster\Aggregate.cs" />
@ -391,18 +382,26 @@
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityWinRTBridge\Thread.cs" />
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityWinRTBridge\ThreadPoolScheduler_UnityWinRT.cs" />
<Compile Include="Assets\Scripts\NIH\XKCDColors.cs" />
<Compile Include="Assets\Scripts\Orbit.cs" />
<Compile Include="Assets\Scripts\PropertiesPanel.cs" />
<Compile Include="Assets\Scripts\Prototype.cs" />
<Compile Include="Assets\Scripts\TabActivator.cs" />
<Compile Include="Assets\Scripts\TabButton.cs" />
<Compile Include="Assets\Scripts\TabGroup.cs" />
<Compile Include="Assets\Scripts\StrategyGameManager.cs" />
<Compile Include="Assets\Scripts\Targetable.cs" />
<Compile Include="Assets\Scripts\UI\BackgroundRenderer.cs" />
<Compile Include="Assets\Scripts\UI\ClickableCollider.cs" />
<Compile Include="Assets\Scripts\UI\ClickCatcher.cs" />
<Compile Include="Assets\Scripts\UI\ClickRaycaster.cs" />
<Compile Include="Assets\Scripts\UI\DragHandler.cs" />
<Compile Include="Assets\Scripts\UI\FlatButton.cs" />
<Compile Include="Assets\Scripts\UI\GalaxyZone.cs" />
<Compile Include="Assets\Scripts\UI\Icons.cs" />
<Compile Include="Assets\Scripts\UI\LoginScreen.cs" />
<Compile Include="Assets\Scripts\UI\PropertiesPanel.cs" />
<Compile Include="Assets\Scripts\UI\TabActivator.cs" />
<Compile Include="Assets\Scripts\UI\TabButton.cs" />
<Compile Include="Assets\Scripts\UI\TabGroup.cs" />
<Compile Include="Assets\Scripts\UI\ZoneObject.cs" />
<Compile Include="Assets\Scripts\UI\ZoneRenderer.cs" />
<Compile Include="Assets\Scripts\UnityExtensions.cs" />
<Compile Include="Assets\Scripts\UnityFormatters.cs" />
<Compile Include="Assets\Scripts\ZoneRenderer.cs" />
<Compile Include="Assets\StrategyGameManager.cs" />
<Compile Include="Assets\ZoneObject.cs" />
<None Include="Assets\Shaders\AdditiveUI.shader" />
<None Include="Assets\Shaders\Background.shader" />
<None Include="Assets\TextMesh Pro\Resources\Shaders\TMP_SDF-Surface-Mobile.shader" />
@ -419,6 +418,7 @@
<None Include="Assets\Shaders\GalaxyMap.shader" />
<None Include="Assets\TextMesh Pro\Resources\Shaders\TMP_Bitmap-Mobile.shader" />
<None Include="Assets\Scripts\NIH\GPU Noise\SimplexNoiseGrad2D.cginc" />
<None Include="Assets\Shaders\Clouds.shader" />
<None Include="Assets\Scripts\NIH\UniRx\ReadMe.txt" />
<None Include="Assets\TextMesh Pro\Resources\Shaders\TMP_SDF Overlay.shader" />
<None Include="Assets\TextMesh Pro\Fonts\LiberationSans - OFL.txt" />

View file

@ -1,18 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClickRaycaster : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View file

@ -1,9 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClickableCollider : MonoBehaviour
{
public event Action<ClickableCollider> OnClick;
}

View file

@ -0,0 +1,97 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Background 1
m_Shader: {fileID: 4800000, guid: 118cb8aabcab89b4fbd939f5c9b71d91, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
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}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- Distortion: 0.5
- FadeDistance: 100
- Gain: 0.1
- Gather: -0.5
- GatherWavelength: 1
- NoiseAmplitude: 0.7
- NoiseFrequency: 0.15
- NoiseGain: 0.75
- NoiseLacunarity: 3
- NoiseOffset: 0
- NoisePosition: 0
- Parallax: -0.05
- ParallaxLacunarity: 2
- ScrollSpeed: 1
- Speed: 2
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Frequency: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- ParallaxDirection: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 0.357, g: 0.15959999, b: 0.018199999, a: 1}
- _Color1: {r: 0, g: 0.2587719, b: 0.5, a: 1}
- _Color2: {r: 0.25, g: 0.11145834, b: 0.012500003, a: 1}
- _Color3: {r: 0.1, g: 0.099829406, b: 0.010000003, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5b7dd00e8f1f14a41b62d3bd79204a91
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -8,7 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Background
m_Shader: {fileID: 4800000, guid: 7a1e6fc0f6159b44eacd456c2a308968, type: 3}
m_Shader: {fileID: 4800000, guid: 118cb8aabcab89b4fbd939f5c9b71d91, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
@ -57,19 +57,20 @@ Material:
m_Offset: {x: 0, y: 0}
m_Floats:
- Distortion: 0.5
- FadeDistance: 100
- Gain: 0.1
- Gather: -0.5
- GatherWavelength: 1
- NoiseAmplitude: 0.5
- NoiseFrequency: 0.2
- NoiseGain: 0.66
- NoiseLacunarity: 2.75
- NoiseOffset: 1
- NoiseAmplitude: 0.8
- NoiseFrequency: 0.1
- NoiseGain: 0.75
- NoiseLacunarity: 3
- NoiseOffset: 0.28
- NoisePosition: 0
- Parallax: 0
- Parallax: -0.05
- ParallaxLacunarity: 2
- ScrollSpeed: 1
- Speed: 5
- Speed: 2
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
@ -88,8 +89,8 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- ParallaxDirection: {r: 0.3442049, g: -0.57971084, b: -10, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- ParallaxDirection: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 0.07913792, g: 0.23741385, b: 0.315, a: 1}
- _Color1: {r: 0, g: 0.2587719, b: 0.5, a: 1}
- _Color2: {r: 0.25, g: 0.11145834, b: 0.012500003, a: 1}
- _Color3: {r: 0.1, g: 0.099829406, b: 0.010000003, a: 1}

View file

@ -58,7 +58,7 @@ Material:
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _Depth: 91.9
- _Depth: 32.69
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1

View file

@ -60,13 +60,13 @@ Material:
- _AngleWidth: 0.0001
- _BumpScale: 1
- _Cutoff: 0.5
- _DangerSteepness: 1.5
- _DangerSteepness: 0.02
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightRange: 150.2
- _HeightRange: 37.3
- _LineFade: 30
- _LineWidth: 0.0001
- _Metallic: 0

View file

@ -0,0 +1,438 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5321404118521994134
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5321404118521994135}
- component: {fileID: 5321404118521994133}
m_Layer: 0
m_Name: Planet
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5321404118521994135
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404118521994134}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5.38, y: 0.81, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5321404120083801960}
- {fileID: 5321404118931821940}
- {fileID: 5321404119494867799}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5321404118521994133
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404118521994134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 17a379c98cd100d4c8548e22c676d246, type: 3}
m_Name:
m_EditorClassIdentifier:
GravityMesh: {fileID: 5321404120083801962}
Icon: {fileID: 5321404118931821941}
Label: {fileID: 5321404119494867796}
--- !u!1 &5321404118931821943
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5321404118931821940}
- component: {fileID: 5321404118931821938}
- component: {fileID: 5321404118931821941}
- component: {fileID: 5321404118931821936}
- component: {fileID: 5321404118931821939}
m_Layer: 0
m_Name: Icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5321404118931821940
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404118931821943}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.05}
m_LocalScale: {x: 0.75, y: 0.75, z: 1}
m_Children: []
m_Father: {fileID: 5321404118521994135}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5321404118931821938
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404118931821943}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5321404118931821941
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404118931821943}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 524c72939685743438cb17ce839664e7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!64 &5321404118931821936
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404118931821943}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &5321404118931821939
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404118931821943}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 52538a3309c36fc4583c964a1c0b705f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5321404119494867798
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5321404119494867799}
- component: {fileID: 5321404119494867795}
- component: {fileID: 5321404119494867794}
- component: {fileID: 5321404119494867797}
- component: {fileID: 5321404119494867796}
m_Layer: 0
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5321404119494867799
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404119494867798}
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: 5321404118521994135}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1, y: 1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!23 &5321404119494867795
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404119494867798}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 21677577810600300, guid: ef74c4c30ca5ced4489f28b914006aad, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &5321404119494867794
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404119494867798}
m_Mesh: {fileID: 0}
--- !u!222 &5321404119494867797
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404119494867798}
m_CullTransparentMesh: 0
--- !u!114 &5321404119494867796
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404119494867798}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Regular Name
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: ef74c4c30ca5ced4489f28b914006aad, type: 2}
m_sharedMaterial: {fileID: 21677577810600300, guid: ef74c4c30ca5ced4489f28b914006aad,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 2
m_fontSizeBase: 2
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 258
m_characterSpacing: 1.38
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 0
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_VertexBufferAutoSizeReduction: 1
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 5321404119494867796}
characterCount: 13
spriteCount: 0
spaceCount: 2
wordCount: 2
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_hasFontAssetChanged: 0
m_renderer: {fileID: 5321404119494867795}
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_maskType: 0
--- !u!1 &5321404120083801964
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5321404120083801960}
- component: {fileID: 5321404120083801963}
- component: {fileID: 5321404120083801962}
m_Layer: 8
m_Name: Gravity Well
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5321404120083801960
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404120083801964}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 5321404118521994135}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5321404120083801963
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404120083801964}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5321404120083801962
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5321404120083801964}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 44a8bbb89acb4e34c9f41a9da5842bb4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f9521191d31952a42a76632d158de0d3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View file

@ -3975,7 +3975,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 214380291}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.08, y: -0.027, z: 1}
m_LocalPosition: {x: -5.2, y: -3.6, z: 1}
m_LocalScale: {x: 30, y: 30, z: 1}
m_Children: []
m_Father: {fileID: 0}
@ -5354,7 +5354,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 462.6, y: -2.5999756}
m_AnchoredPosition: {x: 462.6, y: -2.5998535}
m_SizeDelta: {x: 4, y: 48.7}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &262489563
@ -5447,7 +5447,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 2.0001068, y: -2.5999756}
m_AnchoredPosition: {x: 2.0001068, y: -2.5998535}
m_SizeDelta: {x: 4, y: 48.7}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &264974601
@ -6236,7 +6236,7 @@ RectTransform:
m_Children:
- {fileID: 784574043}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -6941,83 +6941,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 366836206}
m_CullTransparentMesh: 0
--- !u!1 &368096481
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 368096482}
- component: {fileID: 368096484}
- component: {fileID: 368096483}
m_Layer: 0
m_Name: Icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &368096482
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 368096481}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.75, y: 0.75, z: 1}
m_Children: []
m_Father: {fileID: 1007041025}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &368096483
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 368096481}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 524c72939685743438cb17ce839664e7, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &368096484
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 368096481}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &369099758
GameObject:
m_ObjectHideFlags: 0
@ -7621,7 +7544,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
FollowCamera: {fileID: 519420031}
BackgroundMaterial: {fileID: 2100000, guid: 90cead50364300d47bb35194fb52c117, type: 2}
GravityTexture: {fileID: 0}
GravityRenderer: {fileID: 1956833085}
--- !u!114 &408552539
@ -7692,7 +7614,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &411438443
GameObject:
@ -8032,7 +7954,7 @@ Transform:
- {fileID: 1007041025}
- {fileID: 2031261069}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &435654368
MonoBehaviour:
@ -9215,6 +9137,7 @@ GameObject:
- component: {fileID: 515449813}
- component: {fileID: 515449812}
- component: {fileID: 515449811}
- component: {fileID: 515449814}
m_Layer: 0
m_Name: Background
m_TagString: Untagged
@ -9230,7 +9153,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 515449809}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0.05}
m_LocalScale: {x: 1.5, y: 1.5, z: 1}
m_Children: []
m_Father: {fileID: 559120530}
@ -9295,6 +9218,18 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 515449809}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &515449814
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 515449809}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 52538a3309c36fc4583c964a1c0b705f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &515809179
GameObject:
m_ObjectHideFlags: 0
@ -9534,7 +9469,7 @@ Camera:
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
far clip plane: 20
field of view: 60
orthographic: 1
orthographic size: 5
@ -9580,6 +9515,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
Background: {fileID: 214380294}
Background2: {fileID: 1671511697}
--- !u!1 &523371071
GameObject:
m_ObjectHideFlags: 0
@ -10104,7 +10040,6 @@ GameObject:
- component: {fileID: 559120530}
- component: {fileID: 559120531}
- component: {fileID: 559120532}
- component: {fileID: 559120533}
m_Layer: 0
m_Name: Zone
m_TagString: Untagged
@ -10156,18 +10091,6 @@ MonoBehaviour:
Background: {fileID: 515449812}
Icon: {fileID: 1873099343}
Label: {fileID: 258993626}
--- !u!114 &559120533
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 559120529}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 52538a3309c36fc4583c964a1c0b705f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &565356060
GameObject:
m_ObjectHideFlags: 0
@ -10212,7 +10135,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &565356063
MonoBehaviour:
@ -11160,7 +11083,7 @@ Transform:
- {fileID: 899487251}
- {fileID: 559120530}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &597171595
MonoBehaviour:
@ -13160,7 +13083,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &650710352
GameObject:
@ -15735,9 +15658,11 @@ GameObject:
- component: {fileID: 784574044}
- component: {fileID: 784574046}
- component: {fileID: 784574045}
- component: {fileID: 784574048}
- component: {fileID: 784574047}
m_Layer: 5
m_Name: Root
m_TagString: Untagged
m_TagString: UIBackground
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -15799,6 +15724,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ba30ab714c5cf6943957d3e4ae549c84, type: 3}
m_Name:
m_EditorClassIdentifier:
RayCamera: {fileID: 519420031}
--- !u!114 &784574046
MonoBehaviour:
m_ObjectHideFlags: 0
@ -15811,12 +15737,41 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 20fa7724865c6b04097615292a325dfe, type: 3}
m_Name:
m_EditorClassIdentifier:
OnEnter:
m_PersistentCalls:
m_Calls: []
OnExit:
--- !u!114 &784574047
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 784574042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &784574048
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 784574042}
m_CullTransparentMesh: 0
--- !u!1 &798747641
GameObject:
m_ObjectHideFlags: 0
@ -18479,7 +18434,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 477.6, y: -49.35}
m_AnchoredPosition: {x: 477.6, y: -49.350098}
m_SizeDelta: {x: 4, y: -1.3000488}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &972057236
@ -19086,68 +19041,12 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1001885219}
m_CullTransparentMesh: 0
--- !u!1 &1007041024
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1007041025}
- component: {fileID: 1007041027}
- component: {fileID: 1007041026}
m_Layer: 0
m_Name: Planet
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1007041025
--- !u!4 &1007041025 stripped
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
m_PrefabInstance: {fileID: 5321404119125844374}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1007041024}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5.38, y: 0.81, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1496237822}
- {fileID: 368096482}
- {fileID: 2046909121}
m_Father: {fileID: 435654367}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1007041026
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1007041024}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1281fe44325f9b548aa42dc331b17266, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1007041027
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1007041024}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 17a379c98cd100d4c8548e22c676d246, type: 3}
m_Name:
m_EditorClassIdentifier:
GravityMesh: {fileID: 1496237820}
Icon: {fileID: 368096483}
Label: {fileID: 2046909122}
--- !u!1 &1008092833
GameObject:
m_ObjectHideFlags: 0
@ -21747,11 +21646,12 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1126386499}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1c1faf0a46b9cf24498cd5ec93c34c71, type: 3}
m_Name:
m_EditorClassIdentifier:
Camera: {fileID: 519420031}
PrimaryTabGroup: {fileID: 143833105}
GalaxyTabButton: {fileID: 646091942}
ZoneTabButton: {fileID: 618245060}
@ -21759,7 +21659,9 @@ MonoBehaviour:
GalaxyZoneLinkPrototype: {fileID: 899487252}
GalaxyBackground: {fileID: 1938745697}
GalaxyScale: 100
ZoneObjectPrototype: {fileID: 1007041026}
ZoneObjectPrefab: {fileID: 5321404118521994133, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
ZoneRoot: {fileID: 435654367}
PlanetSprite: {fileID: 2800000, guid: 0d2acbd593b7fd349b0b26b4844733ef, type: 3}
GasGiantSprite: {fileID: 2800000, guid: 39505115515c61f4db3c5c5397a5ba49, type: 3}
OrbitalSprite: {fileID: 2800000, guid: 97bce58bfe43bfa40870ca062cfb7ec1, type: 3}
@ -21767,6 +21669,11 @@ MonoBehaviour:
WormholeSprite: {fileID: 2800000, guid: 6d0b27330fdcc8347b1e09a2d17a0673, type: 3}
SelectedColor: {r: 1, g: 0.44583336, b: 0.050000012, a: 1}
UnselectedColor: {r: 0.20084397, g: 0.5982815, b: 0.797, a: 1}
ZoneSizeScale: 0.01
ZoneMassScale: 0.5
ZoneMassPower: 0.333
ZoneOrbitSpeed: 10
ZoneBackground: {fileID: 1956833085}
--- !u!4 &1126386501
Transform:
m_ObjectHideFlags: 0
@ -21779,7 +21686,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1142252850
GameObject:
@ -28181,83 +28088,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4ec4ae0999e1b814cbb86e167df3c039, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1496237818
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1496237822}
- component: {fileID: 1496237821}
- component: {fileID: 1496237820}
m_Layer: 8
m_Name: Gravity Well
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &1496237820
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1496237818}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 44a8bbb89acb4e34c9f41a9da5842bb4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1496237821
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1496237818}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1496237822
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1496237818}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 1007041025}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1496468282
PrefabInstance:
m_ObjectHideFlags: 0
@ -31820,6 +31650,83 @@ MonoBehaviour:
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
--- !u!1 &1671511694
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1671511697}
- component: {fileID: 1671511696}
- component: {fileID: 1671511695}
m_Layer: 0
m_Name: Background (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &1671511695
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1671511694}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 5b7dd00e8f1f14a41b62d3bd79204a91, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1671511696
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1671511694}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1671511697
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1671511694}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -5.2, y: -3.6, z: 0.5}
m_LocalScale: {x: 30, y: 30, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1688360938
GameObject:
m_ObjectHideFlags: 0
@ -35356,7 +35263,7 @@ GameObject:
- component: {fileID: 1847575591}
- component: {fileID: 1847575590}
m_Layer: 5
m_Name: Image
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -35815,7 +35722,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1873099340}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0.025}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 559120530}
@ -37270,7 +37177,7 @@ Transform:
m_GameObject: {fileID: 1938745695}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.5}
m_LocalScale: {x: 20, y: 20, z: 1}
m_LocalScale: {x: 50, y: 50, z: 1}
m_Children: []
m_Father: {fileID: 597171594}
m_RootOrder: 0
@ -39314,7 +39221,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!199 &2031261067
ParticleSystemRenderer:
serializedVersion: 6
@ -44195,211 +44102,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2041331255}
m_CullTransparentMesh: 0
--- !u!1 &2046909120
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2046909121}
- component: {fileID: 2046909125}
- component: {fileID: 2046909124}
- component: {fileID: 2046909123}
- component: {fileID: 2046909122}
m_Layer: 0
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2046909121
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046909120}
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: 1007041025}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1, y: 1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2046909122
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046909120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Regular Name
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: ef74c4c30ca5ced4489f28b914006aad, type: 2}
m_sharedMaterial: {fileID: 21677577810600300, guid: ef74c4c30ca5ced4489f28b914006aad,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 2
m_fontSizeBase: 2
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 258
m_characterSpacing: 1.38
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 0
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_VertexBufferAutoSizeReduction: 1
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 2046909122}
characterCount: 13
spriteCount: 0
spaceCount: 2
wordCount: 2
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_hasFontAssetChanged: 0
m_renderer: {fileID: 2046909125}
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_maskType: 0
--- !u!222 &2046909123
CanvasRenderer:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046909120}
m_CullTransparentMesh: 0
--- !u!33 &2046909124
MeshFilter:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046909120}
m_Mesh: {fileID: 0}
--- !u!23 &2046909125
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046909120}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 21677577810600300, guid: ef74c4c30ca5ced4489f28b914006aad, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2051420756
GameObject:
m_ObjectHideFlags: 0
@ -45585,6 +45287,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2146497157}
m_CullTransparentMesh: 0
--- !u!1001 &5321404119125844374
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 435654367}
m_Modifications:
- target: {fileID: 5321404118521994134, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_Name
value: Planet
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994134, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalPosition.x
value: 5.38
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.81
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404118521994135, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5321404119494867794, guid: f9521191d31952a42a76632d158de0d3,
type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f9521191d31952a42a76632d158de0d3, type: 3}
--- !u!1001 &7785480703375542971
PrefabInstance:
m_ObjectHideFlags: 0

View file

@ -1,70 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
// TODO: USE THIS EVERYWHERE
using static Unity.Mathematics.math;
public class Orbit : MonoBehaviour
{
public Transform Target;
public float Period;
public bool ApplyOrbitRotation = false;
public float Phase;
public float Distance;
public bool CalculatePosition;
//private float _period;
// Use this for initialization
void Start ()
{
if (Target == null)
{
enabled = false;
return;
}
var diff = Target.position - transform.position;
Distance = !CalculatePosition ? Distance : diff.magnitude;
Phase = !CalculatePosition ? Phase : Mathf.Atan2(-diff.x, -diff.z);
if (Mathf.Approximately(Period,0))
{
Period = diff.sqrMagnitude / 100;
}
}
// Update is called once per frame
void Update ()
{
if (Target == null)
{
enabled = false;
Debug.Log("Orbit script updating without target. HOW DOES THIS HAPPEN?!");
return;
}
var time = Time.time;//(GameManager.Instance!=null ? GameManager.Instance.ServerTime : Time.time);
// var p = _phase + time / (Period / (Mathf.PI * 2));
var pos = OrbitInstance.Evaluate(Phase + time / Period);
transform.position = new Vector3(Target.position.x + Distance * pos.x,
transform.position.y,
Target.position.z + Distance * pos.y);
var rot = transform.localRotation.eulerAngles;
if(ApplyOrbitRotation)
transform.rotation = Quaternion.Euler(rot.x,(rot.y*Mathf.Deg2Rad-Time.fixedDeltaTime * Period) * Mathf.Rad2Deg,rot.z);
}
void Parent(Transform parent)
{
Target = parent;
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9f1a6147e441c0847b784d31a9f6b315
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,20 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using static Unity.Mathematics.math;
public class OrbitInstance
{
private OrbitData _data;
public OrbitInstance(OrbitData data)
{
_data = data;
}
public static float2 Evaluate(float phase)
{
phase *= (PI * 2);
return new float2(sin(phase), cos(phase));
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: fc9a1d6d35b2ac14eb8c1092432ae217
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -4,6 +4,7 @@ using System.Collections.Generic;
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;
using static Unity.Mathematics.math;
[RethinkTable("Galaxy")]
[MessagePackObject]
@ -28,6 +29,12 @@ public class ZoneData : DatabaseEntry, INamedEntry
[JsonProperty("orbits")] [Key(6)]
public List<Guid> Orbits = new List<Guid>();
[JsonProperty("radius")] [Key(7)]
public float Radius = 2000;
[JsonProperty("visited")] [Key(8)]
public bool Visited;
[IgnoreMember] public string EntryName
{
get => Name;
@ -86,6 +93,9 @@ public class PlanetData : DatabaseEntry, INamedEntry
[JsonProperty("zone")] [Key(4)]
public Guid Zone;
[JsonProperty("radius")] [Key(5)]
public float GravityRadius;
[IgnoreMember] public string EntryName
{
get => Name;
@ -99,7 +109,7 @@ public class PlanetData : DatabaseEntry, INamedEntry
public class OrbitData : DatabaseEntry
{
[JsonProperty("parent")] [Key(1)]
public Guid? Parent;
public Guid Parent;
[JsonProperty("distance")] [Key(2)]
public float Distance;
@ -112,4 +122,10 @@ public class OrbitData : DatabaseEntry
[JsonProperty("zone")] [Key(5)]
public Guid Zone;
public static float2 Evaluate(float phase)
{
phase *= (PI * 2);
return new float2(sin(phase), cos(phase));
}
}

View file

@ -159,7 +159,7 @@ public class Planet
var p0 = new float2(0, dist);
// Position of second child
var p1 = OrbitInstance.Evaluate(1.0f / vertices) * dist;
var p1 = OrbitData.Evaluate(1.0f / vertices) * dist;
// Maximum child distance is half the distance to the neighbor minus the neighbor's radius
var p0ChildDist = distance(p0, p1) * proportion - Context.PlanetRadius(sharedMass * (1 - proportion));
@ -217,10 +217,13 @@ public class Planet
masses[i] = masses[i] / massTotal * Mass * massFraction;
// Map child distances to range between minimum and maximum
var oldDistances = (float[]) distances.Clone();
for (var i = 0; i < count; i++)
distances[i] = lerp(ChildDistanceMinimum, ChildDistanceMaximum,
(oldDistances[i] - oldDistances[0]) / (oldDistances[count - 1] - oldDistances[0])) + Context.PlanetRadius(masses[i]);
if (count > 1)
{
var oldDistances = (float[]) distances.Clone();
for (var i = 0; i < count; i++)
distances[i] = lerp(ChildDistanceMinimum, ChildDistanceMaximum,
(oldDistances[i] - oldDistances[0]) / (oldDistances[count - 1] - oldDistances[0])) + Context.PlanetRadius(masses[i]);
}
for (var i = 0; i < count; i++)
{

View file

@ -0,0 +1,243 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Unity.Mathematics;
using static Unity.Mathematics.math;
using float2 = Unity.Mathematics.float2;
public class StrategyGameManager : MonoBehaviour
{
public Camera Camera;
public TabGroup PrimaryTabGroup;
public TabButton GalaxyTabButton;
public TabButton ZoneTabButton;
public Prototype GalaxyZonePrototype;
public Prototype GalaxyZoneLinkPrototype;
public MeshRenderer GalaxyBackground;
public float GalaxyScale;
public ZoneObject ZoneObjectPrefab;
public Transform ZoneRoot;
public Texture2D PlanetSprite;
public Texture2D GasGiantSprite;
public Texture2D OrbitalSprite;
public Texture2D SunSprite;
public Texture2D WormholeSprite;
public Color SelectedColor;
public Color UnselectedColor;
public float ZoneSizeScale = .01f;
public float ZoneMassScale = .01f;
public float ZoneMassPower = .5f;
public float ZoneOrbitSpeed = 10;
public MeshRenderer ZoneBackground;
private DatabaseCache _cache;
private GameContext _context;
private GalaxyResponseMessage _galaxy;
private TabButton _currentTab;
private bool _galaxyPopulated;
private Guid _populatedZone;
private Guid _selectedZone;
private GalaxyZone _selectedGalaxyZone;
private ZoneResponseMessage _zoneResponse;
private Dictionary<Guid, GalaxyResponseZone> _galaxyResponseZones;
private Dictionary<Guid, ZoneObject> _zoneObjects = new Dictionary<Guid, ZoneObject>();
private List<ZoneObject> _wormholes = new List<ZoneObject>();
private Dictionary<Guid, float2> _orbitPositions = new Dictionary<Guid, float2>();
private Vector3 _galaxyCameraPos = -Vector3.forward;
private float _galaxyOrthoSize = 50;
void Start()
{
_cache = new DatabaseCache();
// Request galaxy description from the server
CultClient.Send(new GalaxyRequestMessage());
// Listen for the server's galaxy description
CultClient.AddMessageListener<GalaxyResponseMessage>(galaxy =>
{
_galaxy = galaxy;
_galaxyResponseZones = _galaxy.Zones.ToDictionary(z => z.ZoneID);
_cache.Add(_galaxy.GlobalData, true);
_context = new GameContext(_cache);
if (_currentTab == GalaxyTabButton && !_galaxyPopulated) PopulateGalaxy();
});
// Listen for zone descriptions from the server
CultClient.AddMessageListener<ZoneResponseMessage>(zone =>
{
_zoneResponse = zone;
// Cache zone data and contents
_cache.Add(zone.Zone);
foreach (var entry in zone.Contents) _cache.Add(entry);
if (_currentTab == ZoneTabButton && _populatedZone != zone.Zone.ID) PopulateZone();
});
PrimaryTabGroup.OnTabChange += button =>
{
_currentTab = button;
if (_currentTab == GalaxyTabButton)
{
if (!_galaxyPopulated) PopulateGalaxy();
Camera.transform.position = _galaxyCameraPos;
Camera.orthographicSize = _galaxyOrthoSize;
}
if (_currentTab == ZoneTabButton)
{
if (_populatedZone != _selectedZone && _zoneResponse?.Zone.ID == _selectedZone)
PopulateZone();
Camera.transform.position = -Vector3.forward;
}
};
}
private void Update()
{
if (_currentTab == GalaxyTabButton)
{
_galaxyCameraPos = Camera.transform.position;
_galaxyOrthoSize = Camera.orthographicSize;
}
if (_currentTab == ZoneTabButton && _populatedZone == _selectedZone)
{
_orbitPositions.Clear();
foreach (var planet in _zoneObjects)
{
var planetData = _cache.Get<PlanetData>(planet.Key);
planet.Value.transform.position = (Vector2) GetOrbitPosition(planetData.Orbit) * ZoneSizeScale;
}
}
}
// Determine orbital position recursively, caching parent positions to avoid repeated calculations
private float2 GetOrbitPosition(Guid orbit)
{
// Root orbit is fixed at center
if(orbit==Guid.Empty)
return float2.zero;
if (!_orbitPositions.ContainsKey(orbit))
{
var orbitData = _cache.Get<OrbitData>(orbit);
_orbitPositions[orbit] = GetOrbitPosition(orbitData.Parent) + (orbitData.Period < .01f ? float2.zero :
OrbitData.Evaluate(Time.time * ZoneOrbitSpeed / orbitData.Period + orbitData.Phase) *
orbitData.Distance);
}
var position = _orbitPositions[orbit];
if (float.IsNaN(position.x))
{
Debug.Log("Orbit position is NaN, something went very wrong!");
return float2.zero;
}
return _orbitPositions[orbit];
}
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;
var instanceZone = instance.GetComponent<GalaxyZone>();
instanceZone.Label.text = zone.Name;
instanceZone.Background.GetComponent<ClickableCollider>().OnClick += (_, pointer) =>
{
if (_selectedGalaxyZone != null)
_selectedGalaxyZone.Background.material.SetColor("_TintColor", UnselectedColor);
if(_selectedZone != zone.ZoneID)
CultClient.Send(new ZoneRequestMessage{ZoneID = zone.ZoneID});
_selectedZone = zone.ZoneID;
_selectedGalaxyZone = instanceZone;
_selectedGalaxyZone.Background.material.SetColor("_TintColor", SelectedColor);
_selectedZone = zone.ZoneID;
// If the user double clicks on a zone, switch to the zone tab
if(pointer.clickCount == 2) ZoneTabButton.OnPointerClick(pointer);
};
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);
}
}
}
void PopulateZone()
{
// Delete all the existing zone contents
foreach (var zoneObject in _zoneObjects.Values) Destroy(zoneObject.gameObject);//zoneObject.GetComponent<Prototype>().ReturnToPool();
_zoneObjects.Clear();
foreach (var zoneObject in _wormholes) Destroy(zoneObject.gameObject); //zoneObject.GetComponent<Prototype>().ReturnToPool();
_wormholes.Clear();
_populatedZone = _selectedZone;
float zoneDepth = 0;
foreach (var entry in _zoneResponse.Contents)
{
if (entry is PlanetData planet)
{
var planetObject = Instantiate(ZoneObjectPrefab, ZoneRoot);
_zoneObjects[planet.ID] = planetObject;
planetObject.Label.text = planet.Name;
planetObject.GravityMesh.gameObject.SetActive(true);
planetObject.GravityMesh.transform.localScale = Vector3.one * (planet.GravityRadius * 2 * ZoneSizeScale);
var depth = pow(planet.Mass, ZoneMassPower) * ZoneMassScale;
if (depth > zoneDepth)
zoneDepth = depth;
planetObject.GravityMesh.material.SetFloat("_Depth", depth);
planetObject.Icon.material.SetTexture("_MainTex",
planet.Mass > _context.GlobalData.SunMass ? SunSprite :
planet.Mass > _context.GlobalData.GasGiantMass ? GasGiantSprite :
PlanetSprite);
}
}
ZoneBackground.material.SetFloat("_HeightRange", zoneDepth);
foreach (var wormhole in _zoneResponse.Zone.Wormholes)
{
var otherZone = _galaxyResponseZones[wormhole];
var wormholeObject = Instantiate(ZoneObjectPrefab);
_wormholes.Add(wormholeObject);
var direction = otherZone.Position - _zoneResponse.Zone.Position;
wormholeObject.transform.position = (Vector2) (normalize(direction) * _zoneResponse.Zone.Radius * .95f * ZoneSizeScale);
wormholeObject.GravityMesh.gameObject.SetActive(false);
wormholeObject.Icon.material.SetTexture("_MainTex", WormholeSprite);
wormholeObject.Label.text = otherZone.Name;
}
}
}

8
Assets/Scripts/UI.meta Normal file
View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: af274c1630940f246869637f44bc484e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -6,11 +6,13 @@ using UnityEngine;
public class BackgroundRenderer : MonoBehaviour
{
public Transform Background;
public Transform Background2;
// public float RotationSpeed1 = 1;
// public float RotationSpeed2 = 1;
private Camera _camera;
private float _ratio;
private Material _material;
private Material _material2;
private float _depth;
private void Start()
@ -18,14 +20,16 @@ public class BackgroundRenderer : MonoBehaviour
_camera = GetComponent<Camera>();
_depth = Background.position.z;
_material = Background.GetComponent<MeshRenderer>().material;
_material2 = Background2.GetComponent<MeshRenderer>().material;
}
private void OnPreRender()
{
_material.SetVector("ParallaxDirection", transform.position);
_ratio = (float) Screen.height / Screen.width;
Background.position = new Vector3(transform.position.x, transform.position.y, _depth);
_material2.SetVector("ParallaxDirection", transform.position);
_ratio = (float) Screen.width / Screen.height;
Background2.position = Background.position = new Vector3(transform.position.x, transform.position.y, _depth);
var size = _camera.orthographicSize;
Background.localScale = new Vector3(size * 4, size * 4 * _ratio, 1);
Background2.localScale = Background.localScale = new Vector3(size * 2 * _ratio, size * 2, 1);
}
}

View file

@ -7,14 +7,12 @@ using UnityEngine.EventSystems;
public class ClickCatcher : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler
{
public bool EnableMouse => PointerIsInside && !_catching;
//public bool EnableMouse => PointerIsInside && !_catching;
public bool PointerIsInside { get; private set; }
public PointerEnterEvent OnEnter = new PointerEnterEvent();
public PointerExitEvent OnExit = new PointerExitEvent();
private bool _catching;
private UnityEvent _catchClick;
public event Action<PointerEventData> OnEnter;
public event Action<PointerEventData> OnExit;
public event Action<PointerEventData> OnClick;
public static ClickCatcher Background
{
@ -27,43 +25,23 @@ public class ClickCatcher : MonoBehaviour, IPointerEnterHandler, IPointerExitHan
}
private static ClickCatcher _background;
public UnityEvent Catch()
{
_catching = true;
_catchClick = new UnityEvent();
return _catchClick;
}
public void Release()
{
_catching = false;
}
public void OnPointerEnter(PointerEventData eventData)
{
//Debug.Log("Pointer Entered");
OnEnter.Invoke();
OnEnter?.Invoke(eventData);
PointerIsInside = true;
}
public void OnPointerExit(PointerEventData eventData)
{
//Debug.Log("Pointer Exited");
OnExit.Invoke();
OnExit?.Invoke(eventData);
PointerIsInside = false;
}
public void OnPointerClick(PointerEventData eventData)
{
if (!_catching) return;
_catchClick.Invoke();
_catching = false;
OnClick?.Invoke(eventData);
}
[Serializable]
public class PointerEnterEvent : UnityEvent { }
[Serializable]
public class PointerExitEvent : UnityEvent { }
}

View file

@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClickRaycaster : MonoBehaviour
{
public Camera RayCamera;
private ClickCatcher _clickCatcher;
void Start()
{
_clickCatcher = GetComponent<ClickCatcher>();
_clickCatcher.OnClick += pointer =>
{
RaycastHit hit;
Physics.Raycast(RayCamera.ScreenPointToRay(pointer.position), out hit);
if (hit.collider != null)
{
var clickable = hit.collider.GetComponent<ClickableCollider>();
if (clickable != null)
clickable.Click(pointer);
}
};
}
}

View file

@ -0,0 +1,12 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ClickableCollider : MonoBehaviour
{
public event Action<ClickableCollider, PointerEventData> OnClick;
public void Click(PointerEventData eventData) => OnClick?.Invoke(this, eventData);
}

View file

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static Unity.Mathematics.math;
public class DragHandler : MonoBehaviour
{
@ -18,6 +19,11 @@ public class DragHandler : MonoBehaviour
Camera.transform.position -= (Vector3)((Vector2) newPosition - _previousPosition);
}
Camera.orthographicSize *= 1 + Input.mouseScrollDelta.y * Scaling;
if (abs(Input.mouseScrollDelta.y) > .01f)
{
var previousPosition = Camera.ScreenToWorldPoint(Input.mousePosition);
Camera.orthographicSize *= 1 + Input.mouseScrollDelta.y * Scaling;
Camera.transform.position -= Camera.ScreenToWorldPoint(Input.mousePosition) - previousPosition;
}
}
}

View file

@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
@ -60,4 +61,25 @@ public class LoginScreen : MonoBehaviour
}
};
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Tab) || Input.GetKeyDown(KeyCode.Return))
{
if (Server.isFocused)
{
if(_registering)
Email.Select();
else EmailUsername.Select();
}
else if (EmailUsername.isFocused)
Password.Select();
else if (Email.isFocused)
Username.Select();
else if (Username.isFocused)
Password.Select();
else if (Password.isFocused && Input.GetKeyDown(KeyCode.Return))
(_registering ? RegisterButton : LoginButton).OnPointerClick(null);
}
}
}

View file

@ -6,7 +6,6 @@ using UnityEngine;
public class ZoneRenderer : MonoBehaviour
{
public Camera FollowCamera;
public Material BackgroundMaterial;
public RenderTexture GravityTexture;
public MeshRenderer GravityRenderer;
@ -26,7 +25,7 @@ public class ZoneRenderer : MonoBehaviour
{
_resX = Screen.width;
_resY = Screen.height;
_ratio = (float) _resY / _resX;
_ratio = (float) _resX / _resY;
if (GravityTexture != null)
{
GravityTexture?.Release();
@ -34,11 +33,12 @@ public class ZoneRenderer : MonoBehaviour
GravityTexture = new RenderTexture(_resX, _resY, 0, RenderTextureFormat.RFloat);
}
BackgroundMaterial.mainTexture = GravityTexture;
GravityRenderer.material.mainTexture = GravityTexture;
var size = _camera.orthographicSize = FollowCamera.orthographicSize;
GravityRenderer.transform.position = new Vector3(transform.position.x, transform.position.y, 0);
var size = _camera.orthographicSize;
GravityRenderer.transform.localScale = new Vector3(size * 4, size * 4 * _ratio, 1);
GravityRenderer.transform.localScale = new Vector3(size * 2 * _ratio, size * 2, 1);
_camera.targetTexture = GravityTexture;
}

View file

@ -0,0 +1,92 @@
Shader "Unlit/Clouds"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
NoisePosition("NoisePosition", Float) = 0.5
NoiseAmplitude("NoiseAmplitude", Float) = 0.5
NoiseOffset("NoiseOffset", Float) = 0.5
NoiseGain("NoiseGain", Float) = 1
NoiseLacunarity("NoiseLacunarity", Float) = 2
NoiseFrequency("NoiseFrequency", Float) = 1
ParallaxLacunarity("ParallaxLacunarity", Float) = 2
ParallaxDirection("ParallaxDirection", Vector) = (0,0,0,0)
Parallax("Parallax", Float) = 1
Speed("Speed", Float) = 1
FadeDistance("FadeDistance", Float) = 100
}
SubShader
{
Tags { "RenderType"="Transparent" }
Cull Off Lighting Off ZWrite Off
Blend One One
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "Assets/Scripts/NIH/GPU Noise/SimplexNoise3D.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
half4 _Color;
float NoisePosition;
float NoiseAmplitude;
float NoiseOffset;
float NoiseGain;
float NoiseLacunarity;
float NoiseFrequency;
float ParallaxLacunarity;
float3 ParallaxDirection;
float Parallax;
float Speed;
float FadeDistance;
// fractal sum, range -1.0 - 1.0
float fbm(float3 p)
{
float freq = NoiseFrequency, amp = .5;
float parallax = Parallax;
float sum = 0;
for(int i = 0; i < 6; i++)
{
sum += snoise(p * freq + Parallax * ParallaxDirection) * amp;
parallax /= ParallaxLacunarity;
freq *= NoiseLacunarity;
amp *= NoiseGain;
}
return (sum + NoiseOffset)*NoiseAmplitude;
}
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = mul (unity_ObjectToWorld, v.vertex).xy;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float3 p = float3(i.uv,_Time.x*Speed);
float noise = saturate((1-abs(snoise(p*NoiseFrequency/2))) * fbm(p));
return noise * _Color * (1-length(i.uv)/FadeDistance);
}
ENDCG
}
}
}

View file

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 118cb8aabcab89b4fbd939f5c9b71d91
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View file

@ -84,7 +84,7 @@
float planmag = length(plan);
float dangerblend = smoothstep(0,_DangerSteepness * 600, planmag * _ScreenParams.y);
float dangerblend = smoothstep(0,_DangerSteepness * 600, planmag * _ScreenParams.y / unity_OrthoParams.y);
// Loop over isolines, computing a pseudo distance field for a number of height values
float spacing = _HeightRange / 20;

View file

@ -1,109 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Unity.Mathematics;
using static Unity.Mathematics.math;
public class StrategyGameManager : MonoBehaviour
{
public TabGroup PrimaryTabGroup;
public TabButton GalaxyTabButton;
public TabButton ZoneTabButton;
public Prototype GalaxyZonePrototype;
public Prototype GalaxyZoneLinkPrototype;
public MeshRenderer GalaxyBackground;
public float GalaxyScale;
public Prototype ZoneObjectPrototype;
public Texture2D PlanetSprite;
public Texture2D GasGiantSprite;
public Texture2D OrbitalSprite;
public Texture2D SunSprite;
public Texture2D WormholeSprite;
public Color SelectedColor;
public Color UnselectedColor;
private DatabaseCache _cache;
private GameContext _context;
private GalaxyResponseMessage _galaxy;
private TabButton _currentTab;
private bool _galaxyPopulated;
private Guid _selectedZone;
private GalaxyZone _selectedGalaxyZone;
private ZoneResponseMessage _zone;
private Dictionary<Guid, ZoneObject> _zoneObjects = new Dictionary<Guid, ZoneObject>();
void Start()
{
PrimaryTabGroup.OnTabChange += button =>
{
_currentTab = button;
if (button == GalaxyTabButton && !_galaxyPopulated)
{
PopulateGalaxy();
}
};
CultClient.AddMessageListener<GalaxyResponseMessage>(galaxy =>
{
_galaxy = galaxy;
if (_currentTab == GalaxyTabButton && !_galaxyPopulated)
{
_context = new GameContext();
PopulateGalaxy();
}
});
CultClient.Send(new GalaxyRequestMessage());
}
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;
var instanceZone = instance.GetComponent<GalaxyZone>();
instanceZone.Label.text = zone.Name;
instance.GetComponent<ClickableCollider>().OnClick += _ =>
{
if (_selectedGalaxyZone != null)
_selectedGalaxyZone.Background.material.SetColor("_TintColor", UnselectedColor);
_selectedGalaxyZone = instanceZone;
_selectedGalaxyZone.Background.material.SetColor("_TintColor", SelectedColor);
_selectedZone = zone.ZoneID;
};
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);
}
}
}
}

View file

@ -77,8 +77,22 @@ namespace ChatApp.Server
cache.OnDataInsertLocal += async entry =>
{
var table = entry.GetType().GetCustomAttribute<RethinkTableAttribute>()?.TableName ?? "Other";
var result = await R.Db("Aetheria").Table(table).Insert(entry).RunAsync(connection);
_logger.Log(LogLevel.Information, $"Inserted entry to RethinkDB: {entry.ID} result: {result}");
var inserted = false;
for (int i = 0; i < 5 && !inserted; i++)
{
try
{
var result = await R.Db("Aetheria").Table(table).Insert(entry).RunAsync(connection);
_logger.Log(LogLevel.Information, $"Inserted entry to RethinkDB: {entry.ID} result: {result}");
inserted = true;
}
catch (Exception e)
{
_logger.LogError(e,e.Message);
}
}
if(!inserted)
_logger.LogError("Failed to insert after 5 attempts!");
};
cache.OnDataDeleteLocal += async entry =>
@ -126,9 +140,9 @@ namespace ChatApp.Server
var zone = cache.Get<ZoneData>(zoneRequest.ZoneID);
// Zone has not been populated, generate the contents now!
if (!zone.Planets.Any())
if (!zone.Visited)
{
var planets = ZoneGenerator.GenerateEntities(context, zone, 100000, 2000);
var planets = ZoneGenerator.GenerateEntities(context, zone, 100000, zone.Radius);
// Create collections to map between zone generator output and database entries
var orbitMap = new Dictionary<Planet, OrbitData>();
@ -154,7 +168,7 @@ namespace ChatApp.Server
foreach (var data in orbitData)
data.Parent = orbitInverseMap[data].Parent != null
? orbitMap[orbitInverseMap[data].Parent].ID
: (Guid?) null;
: Guid.Empty;
foreach (var data in orbitData) cache.Add(data);
@ -165,7 +179,8 @@ namespace ChatApp.Server
Mass = planet.Mass,
ID = Guid.NewGuid(),
Orbit = orbitMap[planet].ID,
Zone = zone.ID
Zone = zone.ID,
GravityRadius = planet.ChildDistanceMaximum * 1.5f
};
planetDatum.Name = planetDatum.ID.ToString().Substring(0, 8);
return planetDatum;
@ -175,6 +190,7 @@ namespace ChatApp.Server
zone.Planets = planetData.Select(pd => pd.ID).ToList();
zone.Orbits = orbitData.Select(od => od.ID).ToList();
zone.Visited = true;
cache.Add(zone);
}
zoneRequest.Peer.Send(

View file

@ -202,14 +202,14 @@ using Microsoft.Extensions.Logging;
_database.Add(SessionData(message.Peer));
});
Observable.Timer(DateTimeOffset.Now, TimeSpan.FromSeconds(30)).Subscribe(_ =>
{
foreach (var s in _sessions.ToArray())
{
if (DateTime.Now.Subtract(s.Value.LastUpdate).TotalSeconds > s.Value.DurationSeconds)
_sessions.Remove(s.Key);
}
});
// Observable.Timer(DateTimeOffset.Now, TimeSpan.FromSeconds(30)).Subscribe(_ =>
// {
// foreach (var s in _sessions.ToArray())
// {
// if (DateTime.Now.Subtract(s.Value.LastUpdate).TotalSeconds > s.Value.DurationSeconds)
// _sessions.Remove(s.Key);
// }
// });
Logger.LogInformation("LiteNetLib is now open to new connections. Please be gentle.");
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -435,7 +435,6 @@
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Utils\QueryHelper.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Utils\StringHelper.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Utils\TaskHelper.cs" />
<Compile Include="Assets\Scripts\ServerShared\OrbitInstance.cs" />
<Compile Include="Assets\Scripts\ServerShared\Ship.cs" />
<Compile Include="Assets\Scripts\ServerShared\ZoneData.cs" />
<Compile Include="Assets\Scripts\ServerShared\ZoneGenerator.cs" />

Binary file not shown.

Binary file not shown.

BIN
ProjectSettings/TagManager.asset (Stored with Git LFS)

Binary file not shown.