First Flight

Added MPL license headers
SectorRenderer renders entities in sector, manages particle systems for ship thrusters
Thrusters apply torque based on orientation and position relative to ship center of mass
GameManager controls the player ship's thrusters
Player can dock with station if they are near
This commit is contained in:
Reinier Vens 2020-12-22 03:13:43 +00:00
commit c4be204cd0
172 changed files with 6753 additions and 779 deletions

View file

@ -1417,7 +1417,6 @@
</e>
<e p="Attributes.cs" t="Include" />
<e p="Behaviors" t="Include">
<e p="Afterburner.cs" t="Include" />
<e p="Behaviors.cs" t="Include" />
<e p="Controller.cs" t="Include" />
<e p="Cooldown.cs" t="Include" />
@ -2031,6 +2030,7 @@
<e p="EmojiOne Attribution.txt" t="Include" />
</e>
</e>
<e p="UnityHelpers.cs" t="Include" />
</e>
<e p="Economy.Shared.Unity.csproj" t="IncludeRecursive" />
<e p="MessagePack.csproj" t="IncludeRecursive" />

View file

@ -539,6 +539,7 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Geometry\OverlapRemoval\OverlapRemovalGlobalConfiguration.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Layout\Incremental\Multipole\MultipoleCoefficients.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\DataStructures\GenericBinaryHeapPriorityQueue.cs" />
<Compile Include="Assets\InventoryCell.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\DebugHelpers\Timer.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Core\Layout\RectangleObstacle.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Layout\Layered\DataBase.cs" />
@ -684,7 +685,7 @@
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Rectilinear\BasicReflectionEvent.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Layout\Layered\IntEdge.cs" />
<Compile Include="Assets\Scripts\NIH\MSAGL\Routing\Spline\Bundling\PointPairOrder.cs" />
<Compile Include="Assets\InventoryCell.cs" />
<Compile Include="Assets\UnityHelpers.cs" />
<None Include="Assets\TextMesh Pro\Resources\Shaders\TMPro.cginc" />
<None Include="Assets\TextMesh Pro\Resources\Shaders\TMP_SDF-Mobile Overlay.shader" />
<None Include="Assets\Shaders\Clouds.shader" />

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UniRx.Triggers;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -15,7 +19,7 @@ public class InventoryMenu : MonoBehaviour
public ActionGameManager GameManager;
public RectTransform DragParent;
private int _currentPanel;
private int _currentPanel = -1;
private int2 _selectedPosition;
private InventoryPanel _selectedPanel;
@ -105,9 +109,6 @@ public class InventoryMenu : MonoBehaviour
panel.OnDragAsObservable().Subscribe(data =>
{
if (_dragItem == null) return;
var scroll = data.PointerEventData.scrollDelta.y;
if(scroll != 0)
Debug.Log($"Scrolling {scroll}!");
for (var i = 0; i < _dragCells.Length; i++)
_dragCells[i].position = new Vector3(
data.PointerEventData.position.x + _dragOffsets[i].x,
@ -155,7 +156,7 @@ public class InventoryMenu : MonoBehaviour
{
if (_dragItem == null) return;
Debug.Log($"Pointer entered {data.Position}");
// Debug.Log($"Pointer entered {data.Position}");
// if(panel != _originalPanel)
// _originalPanel.RefreshCells();

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -0,0 +1,78 @@
%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: Dithered Particle Trail
m_Shader: {fileID: 4800000, guid: 46776b9fa35a437448f683f31b04d68d, 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: 2800000, guid: 1d6eba2a167939a468c00fda35723dd0, type: 3}
m_Scale: {x: 0, y: 1}
m_Offset: {x: 0.5, 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:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _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:
- _Color: {r: 31.999996, g: 31.999996, b: 31.999996, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9c20b9ccbbbb1b14cb5729e0c8460cd9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,78 @@
%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: Dithered Particle
m_Shader: {fileID: 4800000, guid: 46776b9fa35a437448f683f31b04d68d, 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: 2800000, guid: 1d6eba2a167939a468c00fda35723dd0, type: 3}
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _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:
- _Color: {r: 191.74902, g: 191.74902, b: 191.74902, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6af0f423a2567be43b16d152d2b60e0c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -22,7 +22,7 @@ Material:
- _BumpMap:
m_Texture: {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541,
type: 3}
m_Scale: {x: 8, y: 8}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
@ -43,7 +43,7 @@ Material:
- _MainTex:
m_Texture: {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156,
type: 3}
m_Scale: {x: 8, y: 8}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156,

View file

@ -64,7 +64,7 @@ Material:
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Emission: 15
- _Emission: 0
- _EmissionFresnel: 1
- _EmissionRoughnessFresnelPower: 0.5
- _GlossMapScale: 1

View file

@ -82,7 +82,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Scale: 1
- _Scale: 4.652392
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -37,7 +41,7 @@ public class MenuPanel : MonoBehaviour
TabChanged?.Invoke(tab);
}
void Start()
void Awake()
{
foreach (var tabButton in TabButtons.GetComponentsInChildren<MenuTabButton>())
{

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;

BIN
Assets/Models/Djinni.fbx (Stored with Git LFS)

Binary file not shown.

View file

@ -63,7 +63,7 @@ ModelImporter:
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
useFileScale: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 1

View file

@ -51,6 +51,7 @@ MonoBehaviour:
Body: {fileID: 7852221720971737229}
GravityWell: {fileID: 7852221720969441484}
Icon: {fileID: 7852221720964551246}
Generator: {fileID: 0}
SunMaterial: {fileID: 7852221720971737234}
GravityWaves: {fileID: 7852221720741322894}
FogTint: {fileID: 7852221720816817929}
@ -507,7 +508,7 @@ Light:
m_Type: 2
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Intensity: 0.333
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208

View file

@ -177,7 +177,7 @@
"path": "<Pointer>/delta",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse;Touch",
"groups": ";Keyboard&Mouse",
"action": "Look",
"isComposite": false,
"isPartOfComposite": false
@ -221,7 +221,7 @@
"path": "<Touchscreen>/primaryTouch/tap",
"interactions": "",
"processors": "",
"groups": ";Touch",
"groups": "",
"action": "Fire",
"isComposite": false,
"isPartOfComposite": false
@ -318,22 +318,6 @@
"processors": "",
"interactions": ""
},
{
"name": "TrackedDevicePosition",
"type": "PassThrough",
"id": "b297afa0-f417-4a48-aaa1-36a6efd36190",
"expectedControlType": "Vector3",
"processors": "",
"interactions": ""
},
{
"name": "TrackedDeviceOrientation",
"type": "PassThrough",
"id": "1a877e6d-221e-4815-a289-aa93412c8d87",
"expectedControlType": "Quaternion",
"processors": "",
"interactions": ""
},
{
"name": "Drag",
"type": "Value",
@ -652,17 +636,6 @@
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "5693e57a-238a-46ed-b5ae-e64e6e574302",
"path": "<Touchscreen>/touch*/position",
"interactions": "",
"processors": "",
"groups": "Touch",
"action": "Point",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "4faf7dc9-b979-4210-aa8c-e808e1ef89f5",
@ -685,28 +658,6 @@
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "47c2a644-3ebc-4dae-a106-589b7ca75b59",
"path": "<Touchscreen>/touch*/press",
"interactions": "",
"processors": "",
"groups": "Touch",
"action": "Click",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "bb9e6b34-44bf-4381-ac63-5aa15d19f677",
"path": "<XRController>/trigger",
"interactions": "",
"processors": "",
"groups": "XR",
"action": "Click",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "38c99815-14ea-4617-8627-164d27641299",
@ -740,28 +691,6 @@
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77",
"path": "<XRController>/devicePosition",
"interactions": "",
"processors": "",
"groups": "XR",
"action": "TrackedDevicePosition",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "23e01e3a-f935-4948-8d8b-9bcac77714fb",
"path": "<XRController>/deviceRotation",
"interactions": "",
"processors": "",
"groups": "XR",
"action": "TrackedDeviceOrientation",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "618fb60f-5dc7-47ec-8dbf-fdc3d4c515a1",
@ -794,6 +723,14 @@
"expectedControlType": "Button",
"processors": "",
"interactions": ""
},
{
"name": "Dock",
"type": "Button",
"id": "d6e65ce8-149c-4009-ac38-66144cca311a",
"expectedControlType": "Button",
"processors": "",
"interactions": ""
}
],
"bindings": [
@ -818,6 +755,17 @@
"action": "Inventory",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "3279cef8-8bd1-49f2-984a-637d1f8522f6",
"path": "<Keyboard>/#(C)",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Dock",
"isComposite": false,
"isPartOfComposite": false
}
]
}
@ -850,17 +798,6 @@
}
]
},
{
"name": "Touch",
"bindingGroup": "Touch",
"devices": [
{
"devicePath": "<Touchscreen>",
"isOptional": false,
"isOR": false
}
]
},
{
"name": "Joystick",
"bindingGroup": "Joystick",
@ -871,17 +808,6 @@
"isOR": false
}
]
},
{
"name": "XR",
"bindingGroup": "XR",
"devices": [
{
"devicePath": "<XRController>",
"isOptional": false,
"isOR": false
}
]
}
]
}

View file

@ -370,17 +370,17 @@ PrefabInstance:
- target: {fileID: -8679921383154817045, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.x
value: 1547.9908
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.y
value: 799.0965
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.z
value: -2571.4744
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
@ -422,11 +422,161 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalScale.x
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalScale.y
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalScale.z
value: 0.01
objectReference: {fileID: 0}
- target: {fileID: -7872498167539782088, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -7524481783092393800, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.z
value: -877.3
objectReference: {fileID: 0}
- target: {fileID: -7524481783092393800, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 29
objectReference: {fileID: 0}
- target: {fileID: -6625146999956858958, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 18
objectReference: {fileID: 0}
- target: {fileID: -5992302138083467718, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.x
value: -315.1107
objectReference: {fileID: 0}
- target: {fileID: -5992302138083467718, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 26
objectReference: {fileID: 0}
- target: {fileID: -5603237755662813462, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -5109641318820812241, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.x
value: 208
objectReference: {fileID: 0}
- target: {fileID: -5109641318820812241, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 23
objectReference: {fileID: 0}
- target: {fileID: -4599178800458827326, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -3773429692478549711, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -3760179345625366292, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -3660698809900281034, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 20
objectReference: {fileID: 0}
- target: {fileID: -3189018373145680014, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -2722337163479603264, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -2433966980311775918, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: -1282338954517755048, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 19
objectReference: {fileID: 0}
- target: {fileID: -932530484554465105, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 17
objectReference: {fileID: 0}
- target: {fileID: 29156028926690448, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 484028901997670921, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.z
value: -877.2999
objectReference: {fileID: 0}
- target: {fileID: 484028901997670921, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 28
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_Name
value: Djinni
objectReference: {fileID: 0}
- target: {fileID: 1165945915133145555, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 21
objectReference: {fileID: 0}
- target: {fileID: 1386762414290949414, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.x
value: -237.9511
objectReference: {fileID: 0}
- target: {fileID: 1386762414290949414, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 25
objectReference: {fileID: 0}
- target: {fileID: 1425118031933698329, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1529174336690980893, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.z
value: -877.3001
objectReference: {fileID: 0}
- target: {fileID: 1529174336690980893, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 27
objectReference: {fileID: 0}
- target: {fileID: 2115218557376454651, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_Materials.Array.data[0]
@ -437,7 +587,7 @@ PrefabInstance:
type: 3}
propertyPath: m_Materials.Array.data[1]
value:
objectReference: {fileID: 3720744386649352057, guid: 1c858fec5b74c7c46b1712494192b6b5,
objectReference: {fileID: 3720744386649352057, guid: b2bec4b400153d745b2915f1c43e5c96,
type: 3}
- target: {fileID: 2115218557376454651, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
@ -477,6 +627,36 @@ PrefabInstance:
propertyPath: m_Materials.Array.data[8]
value:
objectReference: {fileID: 2100000, guid: b9036e605cc538943a8c7bec97257e87, type: 2}
- target: {fileID: 3513264515266565276, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3530730053176866719, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5341322951705801481, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5520988019811293425, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 16
objectReference: {fileID: 0}
- target: {fileID: 5810462305269633799, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.z
value: 554.7372
objectReference: {fileID: 0}
- target: {fileID: 5810462305269633799, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 24
objectReference: {fileID: 0}
- target: {fileID: 6947464325843983966, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_Materials.Array.data[0]
@ -488,6 +668,41 @@ PrefabInstance:
propertyPath: m_Materials.Array.data[1]
value:
objectReference: {fileID: 2100000, guid: 616adaf59c64a444f8249cc7cf13c527, type: 2}
- target: {fileID: 7420549073466142295, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7728892125702877259, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7996040519124296810, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_LocalPosition.x
value: 315
objectReference: {fileID: 0}
- target: {fileID: 7996040519124296810, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 22
objectReference: {fileID: 0}
- target: {fileID: 8736633465395181397, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8984464628394765956, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 15
objectReference: {fileID: 0}
- target: {fileID: 9104515542559788959, guid: caefaa8e0cbce524f97eb0db4be80a98,
type: 3}
propertyPath: m_RootOrder
value: 14
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3}
--- !u!4 &9106854767781449910 stripped

File diff suppressed because it is too large Load diff

View file

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

View file

@ -23,7 +23,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5347824108838409208}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
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:
@ -93,6 +93,21 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7b7796ac88cf0724ca09bddf817828f1,
type: 3}
propertyPath: m_LocalScale.x
value: 3
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7b7796ac88cf0724ca09bddf817828f1,
type: 3}
propertyPath: m_LocalScale.y
value: 3
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 7b7796ac88cf0724ca09bddf817828f1,
type: 3}
propertyPath: m_LocalScale.z
value: 3
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 7b7796ac88cf0724ca09bddf817828f1,
type: 3}
propertyPath: m_Name

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

Binary file not shown.

BIN
Assets/Resources/Sprites/Mote.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,118 @@
fileFormatVersion: 2
guid: 1d6eba2a167939a468c00fda35723dd0
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -408,10 +408,10 @@ RectTransform:
m_Father: {fileID: 1783772015}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 736.58, y: -40}
m_SizeDelta: {x: 329.91, y: 56}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &101395091
MonoBehaviour:
@ -929,7 +929,7 @@ Transform:
- {fileID: 488792361}
- {fileID: 970624070}
m_Father: {fileID: 1665127616}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &218215087
GameObject:
@ -1561,6 +1561,139 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &359038938
GameObject:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 359038939}
- component: {fileID: 359038943}
- component: {fileID: 359038942}
- component: {fileID: 359038941}
- component: {fileID: 359038940}
m_Layer: 0
m_Name: cm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &359038939
Transform:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 359038938}
m_LocalRotation: {x: -0.2677866, y: 0.37796336, z: -0.115197934, w: 0.87872833}
m_LocalPosition: {x: 0.27700424, y: 0.74153686, z: 4.1357794}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 393266592}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &359038940
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 359038938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6ad980451443d70438faac0bc6c235a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackedObjectOffset: {x: 0, y: 0, z: 0}
m_LookaheadTime: 0
m_LookaheadSmoothing: 0
m_LookaheadIgnoreY: 0
m_XDamping: 2
m_YDamping: 2
m_ZDamping: 2
m_TargetMovementOnly: 1
m_ScreenX: 0.66
m_ScreenY: 0.55
m_CameraDistance: 70
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_DeadZoneDepth: 0
m_UnlimitedSoftZone: 0
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: 0
m_CenterOnActivate: 1
m_GroupFramingMode: 2
m_AdjustmentMode: 0
m_GroupFramingSize: 0.8
m_MaxDollyIn: 5000
m_MaxDollyOut: 5000
m_MinimumDistance: 1
m_MaximumDistance: 5000
m_MinimumFOV: 3
m_MaximumFOV: 60
m_MinimumOrthoSize: 1
m_MaximumOrthoSize: 5000
--- !u!114 &359038941
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 359038938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4044717213e31446939f7bd49c896ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackedObjectOffset: {x: 0, y: 0, z: 0}
m_LookaheadTime: 1
m_LookaheadSmoothing: 3
m_LookaheadIgnoreY: 0
m_HorizontalDamping: 5
m_VerticalDamping: 5
m_ScreenX: 0.33
m_ScreenY: 0.33
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: -0.000000037252903
m_CenterOnActivate: 1
--- !u!114 &359038942
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 359038938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68bb026fafb42b14791938953eaace77, type: 3}
m_Name:
m_EditorClassIdentifier:
m_NoiseProfile: {fileID: 11400000, guid: 46965f9cbaf525742a6da4c2172a99cd, type: 2}
m_PivotOffset: {x: 0, y: 0, z: 0}
m_AmplitudeGain: 0.25
m_FrequencyGain: 0.5
mNoiseOffsets: {x: 0, y: 0, z: 0}
--- !u!114 &359038943
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 359038938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &375660864
PrefabInstance:
m_ObjectHideFlags: 0
@ -1751,6 +1884,73 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 375660864}
m_PrefabAsset: {fileID: 0}
--- !u!1 &393266591
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 393266592}
- component: {fileID: 393266593}
m_Layer: 0
m_Name: Docked Rig
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &393266592
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 393266591}
m_LocalRotation: {x: -0, y: -0.9228971, z: -0, w: 0.3850468}
m_LocalPosition: {x: 53.6, y: 0, z: 21}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 359038939}
m_Father: {fileID: 1665127616}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: -134.707, z: 0}
--- !u!114 &393266593
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 393266591}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e653bab7fb20e499bda25e1b646fea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ExcludedPropertiesInInspector:
- m_Script
m_LockStageInInspector:
m_StreamingVersion: 20170927
m_Priority: 10
m_StandbyUpdate: 2
m_LookAt: {fileID: 0}
m_Follow: {fileID: 0}
m_Lens:
FieldOfView: 60
OrthographicSize: 5
NearClipPlane: 0.3
FarClipPlane: 1000
Dutch: 0
LensShift: {x: 0, y: 0}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0
m_OnCameraLive:
m_PersistentCalls:
m_Calls: []
m_LegacyBlendHint: 0
m_ComponentOwner: {fileID: 359038939}
--- !u!1 &460484048
GameObject:
m_ObjectHideFlags: 0
@ -3602,7 +3802,7 @@ Transform:
- {fileID: 1075335641}
- {fileID: 166261017}
m_Father: {fileID: 1665127616}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &861158450
GameObject:
@ -3943,7 +4143,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 887677621}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e653bab7fb20e499bda25e1b646fea, type: 3}
m_Name:
@ -3960,7 +4160,7 @@ MonoBehaviour:
FieldOfView: 60
OrthographicSize: 5
NearClipPlane: 0.3
FarClipPlane: 1000
FarClipPlane: 8192
Dutch: 0
LensShift: {x: 0, y: 0}
m_Transitions:
@ -3979,7 +4179,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 887677621}
m_LocalRotation: {x: -0, y: -0.9228971, z: -0, w: 0.3850468}
m_LocalPosition: {x: 0, y: 0, z: -2.5}
m_LocalPosition: {x: 53.6, y: 0, z: 21}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1319157835}
@ -4020,10 +4220,10 @@ RectTransform:
m_Father: {fileID: 1783772015}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 974.955, y: -40}
m_SizeDelta: {x: 146.84, y: 56}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &931657852
MonoBehaviour:
@ -4210,7 +4410,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1665127616}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &937280109
MonoBehaviour:
@ -4524,11 +4724,14 @@ MonoBehaviour:
m_EditorClassIdentifier:
Settings: {fileID: 11400000, guid: cd2344e2001a37544aab0960c164d4ff, type: 2}
SectorRenderer: {fileID: 1009503731}
TopDownCamera: {fileID: 887677622}
DockCamera: {fileID: 393266593}
FollowCamera: {fileID: 887677622}
GameplayUI: {fileID: 346000246}
Menu: {fileID: 1726632268}
Inventory: {fileID: 1997243495}
Sensitivity:
x: -0.005
y: 0.0025
--- !u!4 &1009503730
Transform:
m_ObjectHideFlags: 0
@ -4541,7 +4744,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1009503731
MonoBehaviour:
@ -4851,7 +5054,7 @@ Transform:
- {fileID: 1108843909}
- {fileID: 1647230682}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1075335640
GameObject:
@ -5345,8 +5548,8 @@ GameObject:
- component: {fileID: 1319157835}
- component: {fileID: 1319157839}
- component: {fileID: 1319157836}
- component: {fileID: 1319157838}
- component: {fileID: 1319157837}
- component: {fileID: 1319157838}
m_Layer: 0
m_Name: cm
m_TagString: Untagged
@ -5386,6 +5589,33 @@ MonoBehaviour:
m_FrequencyGain: 0.5
mNoiseOffsets: {x: 0, y: 0, z: 0}
--- !u!114 &1319157837
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1319157834}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4044717213e31446939f7bd49c896ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackedObjectOffset: {x: 0, y: 0, z: 0}
m_LookaheadTime: 0
m_LookaheadSmoothing: 0
m_LookaheadIgnoreY: 0
m_HorizontalDamping: 0.5
m_VerticalDamping: 0.5
m_ScreenX: 0.5
m_ScreenY: 0.5
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: 0
m_CenterOnActivate: 1
--- !u!114 &1319157838
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
@ -5401,13 +5631,13 @@ MonoBehaviour:
m_LookaheadTime: 0
m_LookaheadSmoothing: 0
m_LookaheadIgnoreY: 0
m_XDamping: 1
m_YDamping: 1
m_ZDamping: 1
m_XDamping: 0
m_YDamping: 0
m_ZDamping: 0
m_TargetMovementOnly: 1
m_ScreenX: 0.666
m_ScreenY: 0.666
m_CameraDistance: 70
m_ScreenX: 0.64
m_ScreenY: 0.81
m_CameraDistance: 30
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_DeadZoneDepth: 0
@ -5415,7 +5645,7 @@ MonoBehaviour:
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: 0
m_BiasY: -0.000000074505806
m_CenterOnActivate: 1
m_GroupFramingMode: 2
m_AdjustmentMode: 0
@ -5428,33 +5658,6 @@ MonoBehaviour:
m_MaximumFOV: 60
m_MinimumOrthoSize: 1
m_MaximumOrthoSize: 5000
--- !u!114 &1319157838
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1319157834}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4044717213e31446939f7bd49c896ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackedObjectOffset: {x: 0, y: 0, z: 0}
m_LookaheadTime: 1
m_LookaheadSmoothing: 3
m_LookaheadIgnoreY: 0
m_HorizontalDamping: 5
m_VerticalDamping: 5
m_ScreenX: 0.33
m_ScreenY: 0.33
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: -0.000000037252903
m_CenterOnActivate: 1
--- !u!114 &1319157839
MonoBehaviour:
m_ObjectHideFlags: 3
@ -6226,7 +6429,7 @@ Transform:
- {fileID: 1537342002}
- {fileID: 39508928}
m_Father: {fileID: 1665127616}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1547889400
MonoBehaviour:
@ -7193,13 +7396,14 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 887677623}
- {fileID: 393266592}
- {fileID: 2115559090}
- {fileID: 937280108}
- {fileID: 1547889399}
- {fileID: 199435031}
- {fileID: 826773974}
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1698810627
GameObject:
@ -7431,7 +7635,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1726632265
RectTransform:
m_ObjectHideFlags: 0
@ -8491,7 +8695,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2107503125
PrefabInstance:
@ -8964,11 +9168,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2115559087}
m_LocalRotation: {x: -0, y: -0.9228971, z: -0, w: 0.3850468}
m_LocalPosition: {x: 0, y: 0, z: -2.5}
m_LocalPosition: {x: 53.6, y: 0, z: 21}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1665127616}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 10.742, y: -15.218, z: 0}
--- !u!114 &2115559091
MonoBehaviour:
@ -12716,95 +12920,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2352149241950064197}
m_CullTransparentMesh: 0
--- !u!1001 &2820167578929834581
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2353559640203777757, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalScale.x
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2353559640203777757, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalScale.y
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2353559640203777757, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalScale.z
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5347824108838409208, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_Name
value: Zenith
objectReference: {fileID: 0}
- target: {fileID: 5347824108838409208, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7719100217559641643, guid: cc23690c99435cc4db51e05d523d273d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cc23690c99435cc4db51e05d523d273d, type: 3}
--- !u!114 &7399108072567155888
MonoBehaviour:
m_ObjectHideFlags: 0
@ -13176,77 +13291,3 @@ MonoBehaviour:
m_FlexibleWidth: 9999
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1001 &8784470447332018199
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8442521443025013260, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_Name
value: Djinni
objectReference: {fileID: 0}
- target: {fileID: 8442521443025013260, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalPosition.x
value: 1547.9908
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalPosition.y
value: 799.0965
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalPosition.z
value: -2571.4744
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9106854767781449910, guid: 79024f635e46f5546b670b58b07fa037,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 79024f635e46f5546b670b58b07fa037, type: 3}

Binary file not shown.

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
@ -19,20 +23,27 @@ public class ActionGameManager : MonoBehaviour
public GameSettings Settings;
public SectorRenderer SectorRenderer;
// public MapView MapView;
public CinemachineVirtualCamera TopDownCamera;
public CinemachineVirtualCamera DockCamera;
public CinemachineVirtualCamera FollowCamera;
public GameObject GameplayUI;
public MenuPanel Menu;
public InventoryMenu Inventory;
public float2 Sensitivity;
//public PlayerInput Input;
// private CinemachineFramingTransposer _transposer;
// private CinemachineComposer _composer;
private DirectoryInfo _filePath;
private bool _editMode;
private float _time;
private AetheriaInput _input;
private int _zoomLevelIndex;
private Ship _currentShip;
private ShipInput _shipInput;
private float2 _shipYawPitch;
private float3 _viewDirection;
private Transform _lookAt;
public List<Ship> PlayerShips { get; } = new List<Ship>();
public DatabaseCache ItemData { get; private set; }
@ -42,6 +53,10 @@ public class ActionGameManager : MonoBehaviour
void Start()
{
// _transposer = DockCamera.GetCinemachineComponent<CinemachineFramingTransposer>();
// _composer = DockCamera.GetCinemachineComponent<CinemachineComposer>();
_lookAt = new GameObject().transform;
ConsoleController.MessageReceiver = this;
_filePath = new DirectoryInfo(Application.dataPath).Parent.CreateSubdirectory("GameData");
ItemData = new DatabaseCache();
@ -62,6 +77,7 @@ public class ActionGameManager : MonoBehaviour
);
Zone = new Zone(Settings.PlanetSettings, zonePack);
SectorRenderer.ItemManager = ItemManager;
SectorRenderer.LoadZone(Zone);
_input = new AetheriaInput();
@ -80,10 +96,14 @@ public class ActionGameManager : MonoBehaviour
{
if (Menu.gameObject.activeSelf && Menu.CurrentTab == MenuTab.Map)
{
Cursor.lockState = CursorLockMode.Locked;
_input.Player.Enable();
Menu.gameObject.SetActive(false);
return;
}
Cursor.lockState = CursorLockMode.None;
_input.Player.Disable();
Menu.ShowTab(MenuTab.Map);
};
@ -91,14 +111,24 @@ public class ActionGameManager : MonoBehaviour
{
if (Menu.gameObject.activeSelf && Menu.CurrentTab == MenuTab.Inventory)
{
Cursor.lockState = CursorLockMode.Locked;
_input.Player.Enable();
Menu.gameObject.SetActive(false);
return;
}
Cursor.lockState = CursorLockMode.None;
_input.Player.Disable();
Menu.ShowTab(MenuTab.Inventory);
};
ConsoleController.AddCommand("editmode", _ => ToggleEditMode());
_input.Global.Dock.performed += context =>
{
if (_currentShip.Parent == null) Dock();
else Undock();
};
// ConsoleController.AddCommand("editmode", _ => ToggleEditMode());
ConsoleController.AddCommand("savezone", args =>
{
if (args.Length > 0)
@ -118,23 +148,27 @@ public class ActionGameManager : MonoBehaviour
var dockingBayData = ItemData.GetAll<DockingBayData>().First();
var dockingBay = ItemManager.CreateInstance(dockingBayData, 1, 1) as EquippableItem;
station.TryEquip(dockingBay);
var dockingCargo = station.DockingBays.First();
var thrusterData = ItemData.GetAll<GearData>().First(x => x.HardpointType == HardpointType.Thruster && x.Shape.Height == 1);
for (int i = 0; i < 8; i++)
{
dockingCargo.TryStore(ItemManager.CreateInstance(thrusterData, .5f, 1));
}
var reactorData = ItemData.GetAll<GearData>().First(x => x.HardpointType == HardpointType.Reactor && x.Shape.Height == 2);
dockingCargo.TryStore(ItemManager.CreateInstance(reactorData, .5f, 1));
station.Active = true;
var hullType = ItemData.GetAll<HullData>().First(x=>x.HullType==HullType.Ship);
var shipHull = ItemManager.CreateInstance(hullType, 0, 1) as EquippableItem;
var ship = new Ship(ItemManager, Zone, shipHull);
PlayerShips.Add(ship);
_currentShip = ship;
var dockingCargo = station.DockingBays.First();
var thrusterData = ItemData.GetAll<GearData>().First(x => x.HardpointType == HardpointType.Thruster && x.Shape.Height == 1);
for (int i = 0; i < 8; i++)
{
ship.TryEquip(ItemManager.CreateInstance(thrusterData, .5f, 1) as EquippableItem);
//dockingCargo.TryStore(ItemManager.CreateInstance(thrusterData, .5f, 1));
}
var reactorData = ItemData.GetAll<GearData>().First(x => x.HardpointType == HardpointType.Reactor && x.Shape.Height == 2);
ship.TryEquip(ItemManager.CreateInstance(reactorData, .5f, 1) as EquippableItem);
//dockingCargo.TryStore(ItemManager.CreateInstance(reactorData, .5f, 1));
Dock();
// MapButton.onClick.AddListener(() =>
@ -150,7 +184,8 @@ public class ActionGameManager : MonoBehaviour
public void Dock()
{
foreach (var entity in Zone.Entities)
if (_currentShip.Parent != null) return;
foreach (var entity in Zone.Entities.ToArray())
{
if (lengthsq(entity.Position - _currentShip.Position) <
Settings.GameplaySettings.DockingDistance * Settings.GameplaySettings.DockingDistance)
@ -158,22 +193,51 @@ public class ActionGameManager : MonoBehaviour
var bay = entity.TryDock(_currentShip);
if (bay != null)
{
DockCamera.enabled = true;
FollowCamera.enabled = false;
_currentShip.Active = false;
var orbital = (OrbitalEntity) entity;
DockCamera.Follow = SectorRenderer.Orbitals[orbital];
var parentOrbit = Zone.Orbits[orbital.OrbitData].Data.Parent;
var parentPlanet = SectorRenderer.Planets[Zone.Planets.FirstOrDefault(p => p.Value.Orbit == parentOrbit).Key];
DockCamera.LookAt = parentPlanet.Body.transform;
Menu.ShowTab(MenuTab.Inventory);
Inventory.GetPanel.Display(bay);
Inventory.GetPanel.Display(_currentShip);
_shipInput = null;
Cursor.lockState = CursorLockMode.None;
_input.Player.Disable();
}
}
}
}
public void Undock()
{
if (_currentShip.Parent == null) return;
if (_currentShip.Parent.TryUndock(_currentShip))
{
Menu.gameObject.SetActive(false);
_currentShip.Active = true;
_shipInput = new ShipInput(_input.Player, _currentShip);
DockCamera.enabled = false;
FollowCamera.enabled = true;
FollowCamera.LookAt = _lookAt;
FollowCamera.Follow = SectorRenderer.Ships[_currentShip].Transform;
Cursor.lockState = CursorLockMode.Locked;
_input.Player.Enable();
}
}
public void SaveZone() => File.WriteAllBytes(
Path.Combine(_filePath.FullName, $"{Zone.Data.Name}.zone"), MessagePackSerializer.Serialize(Zone.Pack()));
public void ToggleEditMode()
{
_editMode = !_editMode;
FollowCamera.gameObject.SetActive(!_editMode);
TopDownCamera.gameObject.SetActive(_editMode);
}
// public void ToggleEditMode()
// {
// _editMode = !_editMode;
// FollowCamera.gameObject.SetActive(!_editMode);
// TopDownCamera.gameObject.SetActive(_editMode);
// }
public IEnumerable<EquippedCargoBay> AvailableCargoBays()
{
@ -205,8 +269,64 @@ public class ActionGameManager : MonoBehaviour
{
_time += Time.deltaTime;
ItemManager.Time = Time.time;
if(_shipInput!=null)
{
var look = _input.Player.Look.ReadValue<Vector2>();
_shipYawPitch = float2(_shipYawPitch.x + look.x * Sensitivity.x, clamp(_shipYawPitch.y + look.y * Sensitivity.y, -.45f * PI, .45f * PI));
_viewDirection = mul(float3(0, 0, 1), Unity.Mathematics.float3x3.Euler(float3(_shipYawPitch.yx, 0), RotationOrder.YXZ));
_lookAt.position = SectorRenderer.Ships[_currentShip].Transform.position + (Vector3) _viewDirection * 100;
_shipInput.DesiredOrientation = _viewDirection.xz;
_shipInput.Update();
}
}
Zone.Update(_time, Time.deltaTime);
SectorRenderer.Time = _time;
}
}
public class ShipInput
{
private AetheriaInput.PlayerActions _input;
private Ship _ship;
private Thruster[] _allThrusters;
private Thruster[] _forwardThrusters;
private Thruster[] _reverseThrusters;
private Thruster[] _rightThrusters;
private Thruster[] _leftThrusters;
private Thruster[] _clockwiseThrusters;
private Thruster[] _counterClockwiseThrusters;
public float2 DesiredOrientation { get; set; }
public float DesiredPitch { get; set; }
public ShipInput(AetheriaInput.PlayerActions input, Ship ship)
{
_input = input;
_ship = ship;
_allThrusters = ship.GetBehaviors<Thruster>().ToArray();
_forwardThrusters = _allThrusters.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.Reversed).ToArray();
_reverseThrusters = _allThrusters.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.None).ToArray();
_rightThrusters = _allThrusters.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.CounterClockwise).ToArray();
_leftThrusters = _allThrusters.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.Clockwise).ToArray();
_counterClockwiseThrusters = _allThrusters.Where(x => x.Torque < -.05f).ToArray();
_clockwiseThrusters = _allThrusters.Where(x => x.Torque > .05f).ToArray();
}
public void Update()
{
var move = _input.Move.ReadValue<Vector2>();
foreach (var thruster in _allThrusters) thruster.Axis = 0;
foreach (var thruster in _rightThrusters) thruster.Axis += move.x;
foreach (var thruster in _leftThrusters) thruster.Axis += -move.x;
foreach (var thruster in _forwardThrusters) thruster.Axis += move.y;
foreach (var thruster in _reverseThrusters) thruster.Axis += -move.y;
var deltaRot = dot(normalize(DesiredOrientation), normalize(_ship.Direction).Rotate(ItemRotation.Clockwise));
if (abs(deltaRot) < .01) deltaRot = 0;
deltaRot = pow(abs(deltaRot), .5f) * sign(deltaRot);
foreach (var thruster in _clockwiseThrusters) thruster.Axis += deltaRot;
foreach (var thruster in _counterClockwiseThrusters) thruster.Axis += -deltaRot;
}
}

View file

@ -190,7 +190,7 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""path"": ""<Pointer>/delta"",
""interactions"": """",
""processors"": """",
""groups"": "";Keyboard&Mouse;Touch"",
""groups"": "";Keyboard&Mouse"",
""action"": ""Look"",
""isComposite"": false,
""isPartOfComposite"": false
@ -234,7 +234,7 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""path"": ""<Touchscreen>/primaryTouch/tap"",
""interactions"": """",
""processors"": """",
""groups"": "";Touch"",
""groups"": """",
""action"": ""Fire"",
""isComposite"": false,
""isPartOfComposite"": false
@ -331,22 +331,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""processors"": """",
""interactions"": """"
},
{
""name"": ""TrackedDevicePosition"",
""type"": ""PassThrough"",
""id"": ""b297afa0-f417-4a48-aaa1-36a6efd36190"",
""expectedControlType"": ""Vector3"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""TrackedDeviceOrientation"",
""type"": ""PassThrough"",
""id"": ""1a877e6d-221e-4815-a289-aa93412c8d87"",
""expectedControlType"": ""Quaternion"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""Drag"",
""type"": ""Value"",
@ -665,17 +649,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""5693e57a-238a-46ed-b5ae-e64e6e574302"",
""path"": ""<Touchscreen>/touch*/position"",
""interactions"": """",
""processors"": """",
""groups"": ""Touch"",
""action"": ""Point"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""4faf7dc9-b979-4210-aa8c-e808e1ef89f5"",
@ -698,28 +671,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""47c2a644-3ebc-4dae-a106-589b7ca75b59"",
""path"": ""<Touchscreen>/touch*/press"",
""interactions"": """",
""processors"": """",
""groups"": ""Touch"",
""action"": ""Click"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""bb9e6b34-44bf-4381-ac63-5aa15d19f677"",
""path"": ""<XRController>/trigger"",
""interactions"": """",
""processors"": """",
""groups"": ""XR"",
""action"": ""Click"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""38c99815-14ea-4617-8627-164d27641299"",
@ -753,28 +704,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""7236c0d9-6ca3-47cf-a6ee-a97f5b59ea77"",
""path"": ""<XRController>/devicePosition"",
""interactions"": """",
""processors"": """",
""groups"": ""XR"",
""action"": ""TrackedDevicePosition"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""23e01e3a-f935-4948-8d8b-9bcac77714fb"",
""path"": ""<XRController>/deviceRotation"",
""interactions"": """",
""processors"": """",
""groups"": ""XR"",
""action"": ""TrackedDeviceOrientation"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""618fb60f-5dc7-47ec-8dbf-fdc3d4c515a1"",
@ -807,6 +736,14 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""Dock"",
""type"": ""Button"",
""id"": ""d6e65ce8-149c-4009-ac38-66144cca311a"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """"
}
],
""bindings"": [
@ -831,6 +768,17 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""action"": ""Inventory"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""3279cef8-8bd1-49f2-984a-637d1f8522f6"",
""path"": ""<Keyboard>/#(C)"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Dock"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
@ -863,17 +811,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
}
]
},
{
""name"": ""Touch"",
""bindingGroup"": ""Touch"",
""devices"": [
{
""devicePath"": ""<Touchscreen>"",
""isOptional"": false,
""isOR"": false
}
]
},
{
""name"": ""Joystick"",
""bindingGroup"": ""Joystick"",
@ -884,17 +821,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""isOR"": false
}
]
},
{
""name"": ""XR"",
""bindingGroup"": ""XR"",
""devices"": [
{
""devicePath"": ""<XRController>"",
""isOptional"": false,
""isOR"": false
}
]
}
]
}");
@ -914,13 +840,12 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
m_UI_ScrollWheel = m_UI.FindAction("ScrollWheel", throwIfNotFound: true);
m_UI_MiddleClick = m_UI.FindAction("MiddleClick", throwIfNotFound: true);
m_UI_RightClick = m_UI.FindAction("RightClick", throwIfNotFound: true);
m_UI_TrackedDevicePosition = m_UI.FindAction("TrackedDevicePosition", throwIfNotFound: true);
m_UI_TrackedDeviceOrientation = m_UI.FindAction("TrackedDeviceOrientation", throwIfNotFound: true);
m_UI_Drag = m_UI.FindAction("Drag", throwIfNotFound: true);
// Global
m_Global = asset.FindActionMap("Global", throwIfNotFound: true);
m_Global_MapToggle = m_Global.FindAction("Map Toggle", throwIfNotFound: true);
m_Global_Inventory = m_Global.FindAction("Inventory", throwIfNotFound: true);
m_Global_Dock = m_Global.FindAction("Dock", throwIfNotFound: true);
}
public void Dispose()
@ -1035,8 +960,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
private readonly InputAction m_UI_ScrollWheel;
private readonly InputAction m_UI_MiddleClick;
private readonly InputAction m_UI_RightClick;
private readonly InputAction m_UI_TrackedDevicePosition;
private readonly InputAction m_UI_TrackedDeviceOrientation;
private readonly InputAction m_UI_Drag;
public struct UIActions
{
@ -1050,8 +973,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
public InputAction @ScrollWheel => m_Wrapper.m_UI_ScrollWheel;
public InputAction @MiddleClick => m_Wrapper.m_UI_MiddleClick;
public InputAction @RightClick => m_Wrapper.m_UI_RightClick;
public InputAction @TrackedDevicePosition => m_Wrapper.m_UI_TrackedDevicePosition;
public InputAction @TrackedDeviceOrientation => m_Wrapper.m_UI_TrackedDeviceOrientation;
public InputAction @Drag => m_Wrapper.m_UI_Drag;
public InputActionMap Get() { return m_Wrapper.m_UI; }
public void Enable() { Get().Enable(); }
@ -1086,12 +1007,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
@RightClick.started -= m_Wrapper.m_UIActionsCallbackInterface.OnRightClick;
@RightClick.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnRightClick;
@RightClick.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnRightClick;
@TrackedDevicePosition.started -= m_Wrapper.m_UIActionsCallbackInterface.OnTrackedDevicePosition;
@TrackedDevicePosition.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnTrackedDevicePosition;
@TrackedDevicePosition.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnTrackedDevicePosition;
@TrackedDeviceOrientation.started -= m_Wrapper.m_UIActionsCallbackInterface.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnTrackedDeviceOrientation;
@Drag.started -= m_Wrapper.m_UIActionsCallbackInterface.OnDrag;
@Drag.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnDrag;
@Drag.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnDrag;
@ -1123,12 +1038,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
@RightClick.started += instance.OnRightClick;
@RightClick.performed += instance.OnRightClick;
@RightClick.canceled += instance.OnRightClick;
@TrackedDevicePosition.started += instance.OnTrackedDevicePosition;
@TrackedDevicePosition.performed += instance.OnTrackedDevicePosition;
@TrackedDevicePosition.canceled += instance.OnTrackedDevicePosition;
@TrackedDeviceOrientation.started += instance.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.performed += instance.OnTrackedDeviceOrientation;
@TrackedDeviceOrientation.canceled += instance.OnTrackedDeviceOrientation;
@Drag.started += instance.OnDrag;
@Drag.performed += instance.OnDrag;
@Drag.canceled += instance.OnDrag;
@ -1142,12 +1051,14 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
private IGlobalActions m_GlobalActionsCallbackInterface;
private readonly InputAction m_Global_MapToggle;
private readonly InputAction m_Global_Inventory;
private readonly InputAction m_Global_Dock;
public struct GlobalActions
{
private @AetheriaInput m_Wrapper;
public GlobalActions(@AetheriaInput wrapper) { m_Wrapper = wrapper; }
public InputAction @MapToggle => m_Wrapper.m_Global_MapToggle;
public InputAction @Inventory => m_Wrapper.m_Global_Inventory;
public InputAction @Dock => m_Wrapper.m_Global_Dock;
public InputActionMap Get() { return m_Wrapper.m_Global; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
@ -1163,6 +1074,9 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
@Inventory.started -= m_Wrapper.m_GlobalActionsCallbackInterface.OnInventory;
@Inventory.performed -= m_Wrapper.m_GlobalActionsCallbackInterface.OnInventory;
@Inventory.canceled -= m_Wrapper.m_GlobalActionsCallbackInterface.OnInventory;
@Dock.started -= m_Wrapper.m_GlobalActionsCallbackInterface.OnDock;
@Dock.performed -= m_Wrapper.m_GlobalActionsCallbackInterface.OnDock;
@Dock.canceled -= m_Wrapper.m_GlobalActionsCallbackInterface.OnDock;
}
m_Wrapper.m_GlobalActionsCallbackInterface = instance;
if (instance != null)
@ -1173,6 +1087,9 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
@Inventory.started += instance.OnInventory;
@Inventory.performed += instance.OnInventory;
@Inventory.canceled += instance.OnInventory;
@Dock.started += instance.OnDock;
@Dock.performed += instance.OnDock;
@Dock.canceled += instance.OnDock;
}
}
}
@ -1195,15 +1112,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
return asset.controlSchemes[m_GamepadSchemeIndex];
}
}
private int m_TouchSchemeIndex = -1;
public InputControlScheme TouchScheme
{
get
{
if (m_TouchSchemeIndex == -1) m_TouchSchemeIndex = asset.FindControlSchemeIndex("Touch");
return asset.controlSchemes[m_TouchSchemeIndex];
}
}
private int m_JoystickSchemeIndex = -1;
public InputControlScheme JoystickScheme
{
@ -1213,15 +1121,6 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
return asset.controlSchemes[m_JoystickSchemeIndex];
}
}
private int m_XRSchemeIndex = -1;
public InputControlScheme XRScheme
{
get
{
if (m_XRSchemeIndex == -1) m_XRSchemeIndex = asset.FindControlSchemeIndex("XR");
return asset.controlSchemes[m_XRSchemeIndex];
}
}
public interface IPlayerActions
{
void OnMove(InputAction.CallbackContext context);
@ -1239,13 +1138,12 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
void OnScrollWheel(InputAction.CallbackContext context);
void OnMiddleClick(InputAction.CallbackContext context);
void OnRightClick(InputAction.CallbackContext context);
void OnTrackedDevicePosition(InputAction.CallbackContext context);
void OnTrackedDeviceOrientation(InputAction.CallbackContext context);
void OnDrag(InputAction.CallbackContext context);
}
public interface IGlobalActions
{
void OnMapToggle(InputAction.CallbackContext context);
void OnInventory(InputAction.CallbackContext context);
void OnDock(InputAction.CallbackContext context);
}
}

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Mathematics;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -165,10 +169,16 @@ public class DatabaseInspector : EditorWindow
else if (type == typeof(bool)) field.SetValue(obj, Inspect(field.Name.SplitCamelCase(), (bool) value));
else if (type == typeof(string))
{
if (inspectable is InspectableUnityObjectAttribute unityObjectAttribute)
{
var inspectMethod = typeof(DatabaseInspector).GetMethod("InspectUnityObject");
var generic = inspectMethod.MakeGenericMethod(unityObjectAttribute.ObjectType);
field.SetValue(obj, generic.Invoke(this, new[] {value}));
}
if(inspectable is InspectablePrefabAttribute)
field.SetValue(obj, InspectGameObject(field.Name.SplitCamelCase(), (string) value));
field.SetValue(obj, InspectUnityObject<GameObject>(field.Name.SplitCamelCase(), (string) value));
else if(inspectable is InspectableTextureAttribute)
field.SetValue(obj, InspectTexture(field.Name.SplitCamelCase(), (string) value));
field.SetValue(obj, InspectUnityObject<Texture2D>(field.Name.SplitCamelCase(), (string) value));
else
field.SetValue(obj, Inspect(field.Name.SplitCamelCase(), (string) value, inspectable is InspectableTextAttribute));
}
@ -660,21 +670,12 @@ public class DatabaseInspector : EditorWindow
return index == 0 ? null : types[index - 1];
}
public string InspectGameObject(string label, string value)
public string InspectUnityObject<T>(string label, string value) where T : Object
{
using (var h = new HorizontalScope())
{
GUILayout.Label(label, GUILayout.Width(width));
return AssetDatabase.GetAssetPath(ObjectField(AssetDatabase.LoadAssetAtPath<GameObject>(value), typeof(GameObject), false));
}
}
public string InspectTexture(string label, string value)
{
using (var h = new HorizontalScope())
{
GUILayout.Label(label, GUILayout.Width(width));
return AssetDatabase.GetAssetPath(ObjectField(AssetDatabase.LoadAssetAtPath<Texture2D>(value), typeof(Texture2D), false));
return AssetDatabase.GetAssetPath(ObjectField(AssetDatabase.LoadAssetAtPath<T>(value), typeof(T), false));
}
}

View file

@ -1,4 +1,7 @@
// TODO: USE THIS EVERYWHERE
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using System.IO;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using System.Linq;
using MIConvexHull;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using UnityEngine;

View file

@ -47,6 +47,7 @@ public class Prototype : MonoBehaviour {
var instanceIdx = _instancePool.Count-1;
instance = _instancePool[instanceIdx];
_instancePool.RemoveAt(instanceIdx);
instance.transform.SetAsLastSibling();
}
// Instantiate fresh instance

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -8,6 +12,7 @@ using UnityEngine;
using static Unity.Mathematics.math;
using Unity.Mathematics;
using UnityEngine.Serialization;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
public class SectorRenderer : MonoBehaviour
@ -27,6 +32,8 @@ public class SectorRenderer : MonoBehaviour
public int AsteroidSpritesheetWidth = 4;
public int AsteroidSpritesheetHeight = 4;
public LODHandler LODHandler;
[Header("Tour")]
public bool Tour;
public float TourSwitchTime = 5f;
public float TourFollowDistance = 30f;
@ -46,8 +53,14 @@ public class SectorRenderer : MonoBehaviour
public Texture2D PlanetoidIcon;
public Texture2D PlanetIcon;
[HideInInspector]
public Dictionary<OrbitalEntity, Transform> Orbitals = new Dictionary<OrbitalEntity, Transform>();
[HideInInspector]
public Dictionary<Ship, ShipInstance> Ships = new Dictionary<Ship, ShipInstance>();
[HideInInspector]
public Dictionary<Guid, PlanetObject> Planets = new Dictionary<Guid, PlanetObject>();
private Dictionary<Guid, AsteroidBeltUI> _beltObjects = new Dictionary<Guid, AsteroidBeltUI>();
private Dictionary<Guid, PlanetObject> _planets = new Dictionary<Guid, PlanetObject>();
private Dictionary<Guid, InstancedMesh[]> _beltMeshes = new Dictionary<Guid, InstancedMesh[]>();
private Dictionary<Guid, Matrix4x4[][]> _beltMatrices = new Dictionary<Guid, Matrix4x4[][]>();
private Dictionary<Guid, float3[]> _beltAsteroidPositions = new Dictionary<Guid, float3[]>();
@ -61,6 +74,8 @@ public class SectorRenderer : MonoBehaviour
private CinemachineTransposer _transposer;
private PlanetObject _root;
private bool _rootFound;
public ItemManager ItemManager { get; set; }
public float Time { get; set; }
@ -105,7 +120,7 @@ public class SectorRenderer : MonoBehaviour
foreach(var p in zone.Planets.Values)
LoadPlanet(p);
foreach (var x in _planets)
foreach (var x in Planets)
{
if (!(zone.Planets[x.Key] is GasGiantData))
{
@ -124,7 +139,7 @@ public class SectorRenderer : MonoBehaviour
if (parentPlanetData == null)
parent = _root;
else if (!_planets.TryGetValue(parentPlanetData.ID, out parent))
else if (!Planets.TryGetValue(parentPlanetData.ID, out parent))
{
Debug.Log("WTF!");
}
@ -132,23 +147,72 @@ public class SectorRenderer : MonoBehaviour
_tourPlanets.Add((x.Value.Body.transform, parent.Body.transform));
}
}
foreach(var entity in zone.Entities)
LoadEntity(entity);
zone.Entities.ObserveAdd().Subscribe(e => LoadEntity(e.Value));
zone.Entities.ObserveRemove().Subscribe(e => UnloadEntity(e.Value));
}
public void ClearZone()
{
if (_planets.Count > 0)
if (Planets.Count > 0)
{
foreach (var planet in _planets.Values)
foreach (var planet in Planets.Values)
{
DestroyImmediate(planet.gameObject);
}
_planets.Clear();
Planets.Clear();
_beltMeshes.Clear();
_beltMatrices.Clear();
_tourPlanets.Clear();
}
}
void LoadEntity(Entity entity)
{
var hullData = ItemManager.GetData(entity.Hull) as HullData;
if (entity is Ship ship)
{
var shipInstance = new ShipInstance();
shipInstance.Ship = ship;
shipInstance.Transform = Instantiate(UnityHelpers.LoadAsset<GameObject>(hullData.Prefab)).transform;
shipInstance.Thrusters = ship.GetBehaviors<Thruster>().ToArray();
shipInstance.ThrusterParticles = shipInstance.Thrusters
.Select(x =>
{
var particles = Instantiate(UnityHelpers.LoadAsset<ParticleSystem>(((ThrusterData) x.Data).ParticlesPrefab));
var particlesShape = particles.shape;
particlesShape.meshRenderer = shipInstance.Transform.Find(x.Entity.Hardpoints[x.Item.Position.x, x.Item.Position.y].Transform)
.GetComponent<MeshRenderer>();
return particles;
})
.ToArray();
shipInstance.ThrusterBaseEmission = shipInstance.ThrusterParticles.Select(x => x.emission.rateOverTimeMultiplier).ToArray();
Ships.Add(ship, shipInstance);
}
else if (entity is OrbitalEntity orbital)
{
Orbitals.Add(orbital,Instantiate(UnityHelpers.LoadAsset<GameObject>(hullData.Prefab)).transform);
}
}
void UnloadEntity(Entity entity)
{
if (entity is Ship ship)
{
Destroy(Ships[ship].Transform.gameObject);
foreach(var p in Ships[ship].ThrusterParticles)
Destroy(p.gameObject);
Ships.Remove(ship);
}
else if (entity is OrbitalEntity orbital)
{
Destroy(Orbitals[orbital].gameObject);
Orbitals.Remove(orbital);
}
}
void LoadPlanet(BodyData planetData)
{
if (planetData is AsteroidBeltData beltData)
@ -226,7 +290,7 @@ public class SectorRenderer : MonoBehaviour
planetInstance.BodyData.Mass.Subscribe(f => planet.Icon.transform.localScale = Settings.IconSize.Evaluate(f) * Vector3.one);
_planets[planetData.ID] = planet;
Planets[planetData.ID] = planet;
if (!_rootFound)
{
_rootFound = true;
@ -236,32 +300,32 @@ public class SectorRenderer : MonoBehaviour
LODHandler.FindPlanets();
}
private void Update()
{
if (Tour)
{
_tourTimer -= UnityEngine.Time.deltaTime;
if (_tourTimer < 0)
{
_tourTimer = TourSwitchTime;
_tourIndex = (_tourIndex + 1) % _tourPlanets.Count;
SceneCamera.Follow = _tourPlanets[_tourIndex].Item1;
SceneCamera.LookAt = _tourPlanets[_tourIndex].Item2;
if(_tourIndex==0) Debug.Log("Tour Complete!");
}
// if(_tourIndex>=0)
// {
// var offset = (SceneCamera.Follow.position - SceneCamera.LookAt.position);
// offset.y = 0;
// offset = offset.normalized * TourFollowDistance;
// offset.y = TourHeightOffset;
// offset = Quaternion.AngleAxis(TourFollowOffsetDegrees, Vector3.up) * offset;
// _transposer.m_FollowOffset = offset;
// }
}
}
// private void Update()
// {
// if (Tour)
// {
// _tourTimer -= UnityEngine.Time.deltaTime;
// if (_tourTimer < 0)
// {
// _tourTimer = TourSwitchTime;
// _tourIndex = (_tourIndex + 1) % _tourPlanets.Count;
// SceneCamera.Follow = _tourPlanets[_tourIndex].Item1;
// SceneCamera.LookAt = _tourPlanets[_tourIndex].Item2;
// if(_tourIndex==0) Debug.Log("Tour Complete!");
// }
// // if(_tourIndex>=0)
// // {
// // var offset = (SceneCamera.Follow.position - SceneCamera.LookAt.position);
// // offset.y = 0;
// // offset = offset.normalized * TourFollowDistance;
// // offset.y = TourHeightOffset;
// // offset = Quaternion.AngleAxis(TourFollowOffsetDegrees, Vector3.up) * offset;
// // _transposer.m_FollowOffset = offset;
// // }
// }
// }
void LateUpdate()
void Update()
{
foreach(var belt in _zone.AsteroidBelts)
{
@ -287,7 +351,7 @@ public class SectorRenderer : MonoBehaviour
_beltObjects[belt.Key].Update(_beltAsteroidPositions[belt.Key]);
}
foreach (var planet in _planets)
foreach (var planet in Planets)
{
var planetInstance = _zone.PlanetInstances[planet.Key];
var p = _zone.GetOrbitPosition(planetInstance.BodyData.Orbit);
@ -305,6 +369,30 @@ public class SectorRenderer : MonoBehaviour
else planet.Value.Body.transform.rotation *= Quaternion.AngleAxis(Settings.PlanetRotationSpeed, Vector3.up);
}
foreach (var ship in Ships)
{
var hullData = ItemManager.GetData(ship.Key.Hull) as HullData;
var h = _zone.GetHeight(ship.Key.Position);
ship.Value.Transform.position = new Vector3(ship.Key.Position.x,h + hullData.GridOffset,ship.Key.Position.y);
var normal = _zone.GetNormal(ship.Key.Position);
//Debug.Log($"Normal: {normal}");
var shipRight = ship.Key.Direction.Rotate(ItemRotation.Clockwise);
var forward = Vector3.Cross(new Vector3(shipRight.x,0,shipRight.y), normal);
ship.Value.Transform.rotation = Quaternion.LookRotation(forward, normal);
for (int i = 0; i < ship.Value.Thrusters.Length; i++)
{
var emissionModule = ship.Value.ThrusterParticles[i].emission;
emissionModule.rateOverTimeMultiplier = ship.Value.ThrusterBaseEmission[i] * ship.Value.Thrusters[i].Axis;
}
}
foreach (var orbital in Orbitals)
{
var hullData = ItemManager.GetData(orbital.Key.Hull) as HullData;
var h = _zone.GetHeight(orbital.Key.Position);
orbital.Value.position = new Vector3(orbital.Key.Position.x,h + hullData.GridOffset,orbital.Key.Position.y);
}
var fogPos = FogCameraParent.position;
SectorBoundaryBrush.material.SetFloat("_Power", Settings.PlanetSettings.ZoneDepthExponent);
SectorBoundaryBrush.material.SetFloat("_Depth", Settings.PlanetSettings.ZoneDepth + Settings.PlanetSettings.ZoneBoundaryFog);
@ -321,6 +409,15 @@ public class SectorRenderer : MonoBehaviour
}
}
public class ShipInstance
{
public ParticleSystem[] ThrusterParticles;
public Thruster[] Thrusters;
public float[] ThrusterBaseEmission;
public Ship Ship;
public Transform Transform;
}
[Serializable]
public class InstancedMesh
{

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static Unity.Mathematics.math;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using UnityEngine;
/// <summary>

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using static Unity.Mathematics.math;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using JsonKnownTypes;

View file

@ -1,4 +1,8 @@
using System.Collections;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Unity.Mathematics;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using MessagePack;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using JsonKnownTypes;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using JsonKnownTypes;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using JsonKnownTypes;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,3 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
public class WanderTask : AgentTask
{

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
public class NameAttribute : Attribute
{
@ -52,6 +56,17 @@ public class InspectableFieldAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public class InspectableTextAttribute : InspectableFieldAttribute { }
[AttributeUsage(AttributeTargets.Field)]
public class InspectableUnityObjectAttribute : InspectableFieldAttribute
{
public Type ObjectType;
public InspectableUnityObjectAttribute(Type type)
{
ObjectType = type;
}
}
[AttributeUsage(AttributeTargets.Field)]
public class InspectablePrefabAttribute : InspectableFieldAttribute { }

View file

@ -1,91 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;
// [InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
// public class AfterburnerData : BehaviorData
// {
// [InspectableField, JsonProperty("thrust"), Key(1)]
// public PerformanceStat ThrustModifier = new PerformanceStat();
//
// [InspectableField, JsonProperty("speed"), Key(2)]
// public PerformanceStat SpeedModifier = new PerformanceStat();
//
// [InspectableField, JsonProperty("torque"), Key(3)]
// public PerformanceStat TorqueModifier = new PerformanceStat();
//
// public override IBehavior CreateInstance(GameContext context, Entity entity, Gear item)
// {
// return new Afterburner(context, this, entity, item);
// }
// }
//
// public class Afterburner : IActivatedBehavior
// {
// private List<Dictionary<IBehavior,float>> _modifiers = new List<Dictionary<IBehavior, float>>();
// private AfterburnerData _data;
// private Thruster _thruster;
// private int _thrustAxis;
//
// public Entity Entity { get; }
// public Gear Item { get; }
// public GameContext Context { get; }
//
// public BehaviorData Data => _data;
//
// public Afterburner(GameContext context, AfterburnerData data, Entity entity, Gear item)
// {
// Context = context;
// _data = data;
// Entity = entity;
// Item = item;
// }
//
// public void Initialize()
// {
// _thruster = Entity.GetBehaviors<Thruster>().FirstOrDefault();
// _thrustAxis = Entity.GetAxis<Thruster>();
// }
//
// public bool Update(float delta)
// {
// return true;
// }
//
// public bool Activate()
// {
// if (_thruster == null) return false;
//
// var thrustMod = ((ThrusterData) _thruster.Data).Thrust.GetScaleModifiers(Entity);
// thrustMod.Add(this,Context.Evaluate(_data.ThrustModifier,Item, Entity));
// _modifiers.Add(thrustMod);
//
// Entity.AxisOverrides[_thrustAxis] = 1;
//
// return true;
//
// // var speedMod = (Ship.Hull.ItemData as HullData).TopSpeed.GetScaleModifiers(Ship);
// // _modifiers.Add(speedMod);
// // speedMod.Add(this,Context.Evaluate(_data.SpeedModifier,Item, Ship));
// //
// // var torqueMod = (Ship.GetEquipped(HardpointType.Thruster).ItemData as ThrusterData).Torque.GetScaleModifiers(Ship);
// // _modifiers.Add(torqueMod);
// // torqueMod.Add(this,Context.Evaluate(_data.TorqueModifier,Item, Ship));
// }
//
// public void Deactivate()
// {
// Entity.AxisOverrides.Remove(_thrustAxis);
// foreach (var mod in _modifiers)
// {
// mod.Remove(this);
// }
// _modifiers.Clear();
// }
//
// public void Remove()
// {
// }
// }

View file

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 967ca96c9f90416887db9a6a0341f58c
timeCreated: 1584292755

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using MessagePack;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using System.Linq;
using MessagePack;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using MessagePack;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
[InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]

View file

@ -1,4 +1,7 @@

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;

View file

@ -1,4 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,3 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;
@ -14,6 +18,9 @@ public class ThrusterData : BehaviorData
[InspectableField, JsonProperty("heat"), Key(3)]
public PerformanceStat Heat = new PerformanceStat();
[InspectablePrefab, JsonProperty("Particles"), Key(4)]
public string ParticlesPrefab;
public override IBehavior CreateInstance(ItemManager context, Entity entity, EquippedItem item)
{
@ -28,6 +35,7 @@ public class Thruster : IAnalogBehavior
public ItemManager Context { get; }
public float Thrust { get; private set; }
public float Torque { get; }
public float Axis
{
@ -47,12 +55,19 @@ public class Thruster : IAnalogBehavior
_data = data;
Entity = entity;
Item = item;
var hullData = context.GetData(entity.Hull) as HullData;
var hullCenter = hullData.Shape.CenterOfMass;
var itemData = context.GetData(item.EquippableItem);
var itemCenter = hullData.Shape.Inset(itemData.Shape, item.Position, item.EquippableItem.Rotation).CenterOfMass;
var toCenter = hullCenter - itemCenter;
Torque = -dot(toCenter, float2(1, 0).Rotate(item.EquippableItem.Rotation));
}
public bool Update(float delta)
{
Thrust = Context.Evaluate(_data.Thrust, Item.EquippableItem, Entity);
Entity.Velocity += Entity.Direction * _input * Thrust / Entity.Mass * delta;
Entity.Velocity -= Entity.Direction.Rotate(Item.EquippableItem.Rotation) * _input * Thrust / Entity.Mass * delta;
Entity.Direction = mul(Entity.Direction, Unity.Mathematics.float2x2.Rotate(_input * Torque * Thrust / Entity.Mass / 100 * delta));
Item.Temperature += (_input * Context.Evaluate(_data.Heat, Item.EquippableItem, Entity) * delta) / Context.GetThermalMass(Item.EquippableItem);
Entity.VisibilitySources[this] = _input * Context.Evaluate(_data.Visibility, Item.EquippableItem, Entity);
return true;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View file

@ -1,4 +1,8 @@
using System;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
using MessagePack;
using Newtonsoft.Json;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;

View file

@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;

Some files were not shown because too many files have changed in this diff Show more