Deliver provider-owned thermal profiles
This commit is contained in:
parent
d04b00c9ce
commit
a73051ea4d
18 changed files with 387 additions and 22 deletions
|
|
@ -3,6 +3,8 @@ using System.Collections;
|
|||
using System.IO;
|
||||
using GameCult.Eve.UnityScene;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
public sealed class AetheriaUnityClient : MonoBehaviour
|
||||
{
|
||||
|
|
@ -18,6 +20,7 @@ public sealed class AetheriaUnityClient : MonoBehaviour
|
|||
var replicaPath = Path.Combine(Application.persistentDataPath, "aetheria-unity.cc");
|
||||
|
||||
CreateView();
|
||||
gameObject.AddComponent<AetheriaUnityThermalPresentationSink>();
|
||||
_provider = gameObject.AddComponent<EveUnityCultMeshPlayableWorldProvider>();
|
||||
_provider.Configure(
|
||||
endpoint,
|
||||
|
|
@ -41,8 +44,12 @@ public sealed class AetheriaUnityClient : MonoBehaviour
|
|||
|
||||
private static void CreateView()
|
||||
{
|
||||
var pipeline = UniversalRenderPipelineAsset.Create();
|
||||
GraphicsSettings.defaultRenderPipeline = pipeline;
|
||||
QualitySettings.renderPipeline = pipeline;
|
||||
var cameraObject = new GameObject("Main Camera") { tag = "MainCamera" };
|
||||
var camera = cameraObject.AddComponent<Camera>();
|
||||
cameraObject.AddComponent<UniversalAdditionalCameraData>().renderPostProcessing = true;
|
||||
camera.clearFlags = CameraClearFlags.SolidColor;
|
||||
camera.backgroundColor = new Color(0.025f, 0.035f, 0.055f);
|
||||
camera.nearClipPlane = 0.05f;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
using GameCult.Eve.UnityScene;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
public sealed class AetheriaUnityThermalPresentationSink : MonoBehaviour,
|
||||
IEveUnityThermalPresentationSink, IEveUnityThermalPresentationAssetSink
|
||||
{
|
||||
private Volume _heatstroke;
|
||||
private Volume _severeHeatstroke;
|
||||
private Volume _hypothermia;
|
||||
private Volume _severeHypothermia;
|
||||
private Volume _death;
|
||||
|
||||
public EveUnityThermalPresentationFrame LastFrame { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_heatstroke = CreateVolume("Heatstroke");
|
||||
_severeHeatstroke = CreateVolume("Severe Heatstroke");
|
||||
_hypothermia = CreateVolume("Hypothermia");
|
||||
_severeHypothermia = CreateVolume("Severe Hypothermia");
|
||||
_death = CreateVolume("Death");
|
||||
}
|
||||
|
||||
public void ConfigureThermalPresentationAssets(EveUnityThermalPresentationAssets assets)
|
||||
{
|
||||
_heatstroke.sharedProfile = assets.Heatstroke as VolumeProfile;
|
||||
_severeHeatstroke.sharedProfile = assets.SevereHeatstroke as VolumeProfile;
|
||||
_hypothermia.sharedProfile = assets.Hypothermia as VolumeProfile;
|
||||
_severeHypothermia.sharedProfile = assets.SevereHypothermia as VolumeProfile;
|
||||
_death.sharedProfile = assets.Death as VolumeProfile;
|
||||
}
|
||||
|
||||
public void ApplyThermalPresentation(EveUnityThermalPresentationFrame frame)
|
||||
{
|
||||
LastFrame = frame;
|
||||
_heatstroke.weight = frame.HeatstrokeWeight;
|
||||
_severeHeatstroke.weight = frame.SevereHeatstrokeWeight;
|
||||
_hypothermia.weight = frame.HypothermiaWeight;
|
||||
_severeHypothermia.weight = frame.SevereHypothermiaWeight;
|
||||
_death.weight = frame.DeathWeight;
|
||||
}
|
||||
|
||||
private Volume CreateVolume(string label)
|
||||
{
|
||||
var root = new GameObject(label);
|
||||
root.transform.SetParent(transform, false);
|
||||
var volume = root.AddComponent<Volume>();
|
||||
volume.isGlobal = true;
|
||||
volume.priority = 100;
|
||||
volume.weight = 0;
|
||||
return volume;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 85872e4612f94611b391fc274976820f
|
||||
|
|
@ -5,9 +5,10 @@
|
|||
"com.unity.modules.imageconversion": "1.0.0",
|
||||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.modules.uielements": "1.0.0",
|
||||
"com.unity.render-pipelines.universal": "17.4.0",
|
||||
"org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-source-v1.0.3-r2",
|
||||
"org.gamecult.eve.plugin-fields": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.1.1",
|
||||
"org.gamecult.eve.surface": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.1.0",
|
||||
"org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#580af5328d4c5db4295432cb918402ce762c960a"
|
||||
"org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#b112acb34d1e2561f1e770a9088bd0123e6614ab"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,27 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"com.unity.burst": {
|
||||
"version": "1.8.29",
|
||||
"depth": 2,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.mathematics": "1.2.1",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.collections": {
|
||||
"version": "6.4.0",
|
||||
"depth": 2,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.burst": "1.8.23",
|
||||
"com.unity.mathematics": "1.3.2",
|
||||
"com.unity.nuget.mono-cecil": "1.11.5",
|
||||
"com.unity.test-framework": "1.4.6",
|
||||
"com.unity.test-framework.performance": "3.0.3"
|
||||
}
|
||||
},
|
||||
"com.unity.ext.nunit": {
|
||||
"version": "2.0.5",
|
||||
"depth": 1,
|
||||
|
|
@ -13,6 +35,60 @@
|
|||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.nuget.mono-cecil": {
|
||||
"version": "1.11.6",
|
||||
"depth": 3,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.render-pipelines.core": {
|
||||
"version": "17.4.0",
|
||||
"depth": 1,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.burst": "1.8.14",
|
||||
"com.unity.mathematics": "1.3.2",
|
||||
"com.unity.ugui": "2.0.0",
|
||||
"com.unity.collections": "2.4.3",
|
||||
"com.unity.modules.terrain": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.render-pipelines.universal": {
|
||||
"version": "17.4.0",
|
||||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.render-pipelines.core": "17.4.0",
|
||||
"com.unity.shadergraph": "17.4.0",
|
||||
"com.unity.render-pipelines.universal-config": "17.4.0"
|
||||
}
|
||||
},
|
||||
"com.unity.render-pipelines.universal-config": {
|
||||
"version": "17.4.0",
|
||||
"depth": 1,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.render-pipelines.core": "17.4.0"
|
||||
}
|
||||
},
|
||||
"com.unity.searcher": {
|
||||
"version": "4.9.4",
|
||||
"depth": 2,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.shadergraph": {
|
||||
"version": "17.4.0",
|
||||
"depth": 1,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.render-pipelines.core": "17.4.0",
|
||||
"com.unity.searcher": "4.9.3"
|
||||
}
|
||||
},
|
||||
"com.unity.test-framework": {
|
||||
"version": "1.6.0",
|
||||
"depth": 0,
|
||||
|
|
@ -23,6 +99,25 @@
|
|||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
}
|
||||
},
|
||||
"com.unity.test-framework.performance": {
|
||||
"version": "3.4.0",
|
||||
"depth": 3,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.test-framework": "1.1.33",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ugui": {
|
||||
"version": "2.0.0",
|
||||
"depth": 2,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.modules.ui": "1.0.0",
|
||||
"com.unity.modules.imgui": "1.0.0"
|
||||
}
|
||||
},
|
||||
"org.gamecult.cultlib": {
|
||||
"version": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-source-v1.0.3-r2",
|
||||
"depth": 0,
|
||||
|
|
@ -47,7 +142,7 @@
|
|||
"hash": "e10821f1cc81f619479c6507438f6a097d1f0ce2"
|
||||
},
|
||||
"org.gamecult.eve.unity-scene": {
|
||||
"version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#580af5328d4c5db4295432cb918402ce762c960a",
|
||||
"version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#b112acb34d1e2561f1e770a9088bd0123e6614ab",
|
||||
"depth": 0,
|
||||
"source": "git",
|
||||
"dependencies": {
|
||||
|
|
@ -56,7 +151,7 @@
|
|||
"org.gamecult.eve.surface": "0.1.0",
|
||||
"com.unity.mathematics": "1.3.2"
|
||||
},
|
||||
"hash": "580af5328d4c5db4295432cb918402ce762c960a"
|
||||
"hash": "b112acb34d1e2561f1e770a9088bd0123e6614ab"
|
||||
},
|
||||
"com.unity.modules.assetbundle": {
|
||||
"version": "1.0.0",
|
||||
|
|
@ -94,6 +189,12 @@
|
|||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.terrain": {
|
||||
"version": "1.0.0",
|
||||
"depth": 2,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
"com.unity.modules.ui": {
|
||||
"version": "1.0.0",
|
||||
"depth": 1,
|
||||
|
|
|
|||
Loading…
Reference in a new issue