Compare commits
27 Commits
0.0.6
...
e723e939d7
@@ -2,7 +2,7 @@
|
|||||||
"name": "Cryville.Common",
|
"name": "Cryville.Common",
|
||||||
"rootNamespace": "",
|
"rootNamespace": "",
|
||||||
"references": [
|
"references": [
|
||||||
"GUID:da293eebbcb9a4947a212534c52d1a32"
|
"GUID:6055be8ebefd69e48b49212b09b47b2f"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ namespace Cryville.Common.Unity.UI {
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
protected bool m_ChildScaleHeight;
|
protected bool m_ChildScaleHeight;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
protected bool m_ChildOverflowWidth;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
protected bool m_ChildOverflowHeight;
|
||||||
|
|
||||||
public override void CalculateLayoutInputHorizontal() {
|
public override void CalculateLayoutInputHorizontal() {
|
||||||
base.CalculateLayoutInputHorizontal();
|
base.CalculateLayoutInputHorizontal();
|
||||||
CalcAlongAxis(0);
|
CalcAlongAxis(0);
|
||||||
@@ -60,9 +66,10 @@ namespace Cryville.Common.Unity.UI {
|
|||||||
float size = rectTransform.rect.size[axis];
|
float size = rectTransform.rect.size[axis];
|
||||||
bool controlSize = (axis == 0) ? m_ChildControlWidth : m_ChildControlHeight;
|
bool controlSize = (axis == 0) ? m_ChildControlWidth : m_ChildControlHeight;
|
||||||
bool useScale = (axis == 0) ? m_ChildScaleWidth : m_ChildScaleHeight;
|
bool useScale = (axis == 0) ? m_ChildScaleWidth : m_ChildScaleHeight;
|
||||||
|
bool overflow = (axis == 0) ? m_ChildOverflowWidth : m_ChildOverflowHeight;
|
||||||
bool childForceExpandSize = (axis == 0) ? m_ChildForceExpandWidth : m_ChildForceExpandHeight;
|
bool childForceExpandSize = (axis == 0) ? m_ChildForceExpandWidth : m_ChildForceExpandHeight;
|
||||||
float alignmentOnAxis = GetAlignmentOnAxis(axis);
|
float alignmentOnAxis = GetAlignmentOnAxis(axis);
|
||||||
float innerSize = size - ((axis == 0) ? padding.horizontal : padding.vertical);
|
float innerSize = overflow ? float.PositiveInfinity : (size - ((axis == 0) ? padding.horizontal : padding.vertical));
|
||||||
RectTransform child = rectChildren[0];
|
RectTransform child = rectChildren[0];
|
||||||
GetChildSizes(child, axis, controlSize, childForceExpandSize, out var min2, out var preferred2, out var flexible2);
|
GetChildSizes(child, axis, controlSize, childForceExpandSize, out var min2, out var preferred2, out var flexible2);
|
||||||
float scaleFactor2 = useScale ? child.localScale[axis] : 1f;
|
float scaleFactor2 = useScale ? child.localScale[axis] : 1f;
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ using System.Globalization;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.TextCore;
|
||||||
using UnityEngine.TextCore.LowLevel;
|
using UnityEngine.TextCore.LowLevel;
|
||||||
using UnityEngine.TextCore.Text;
|
using AtlasPopulationMode = TMPro.AtlasPopulationMode;
|
||||||
|
|
||||||
namespace Cryville.Common.Unity.UI {
|
namespace Cryville.Common.Unity.UI {
|
||||||
[RequireComponent(typeof(TMP_Text))]
|
[RequireComponent(typeof(TMP_Text))]
|
||||||
@@ -16,7 +17,7 @@ namespace Cryville.Common.Unity.UI {
|
|||||||
public static FontMatcher FontMatcher;
|
public static FontMatcher FontMatcher;
|
||||||
public static int MaxFallbackCount = 4;
|
public static int MaxFallbackCount = 4;
|
||||||
|
|
||||||
static readonly Dictionary<CultureInfo, FontAsset> _cachedFonts = new();
|
static readonly Dictionary<CultureInfo, TMP_FontAsset> _cachedFonts = new();
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
Shader m_shader;
|
Shader m_shader;
|
||||||
@@ -46,7 +47,7 @@ namespace Cryville.Common.Unity.UI {
|
|||||||
if (MaxFallbackCount <= 0) break;
|
if (MaxFallbackCount <= 0) break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
font.fallbackFontAssetTable ??= new List<FontAsset>();
|
font.fallbackFontAssetTable ??= new List<TMP_FontAsset>();
|
||||||
font.fallbackFontAssetTable.Add(ifont);
|
font.fallbackFontAssetTable.Add(ifont);
|
||||||
if (font.fallbackFontAssetTable.Count >= MaxFallbackCount) break;
|
if (font.fallbackFontAssetTable.Count >= MaxFallbackCount) break;
|
||||||
}
|
}
|
||||||
@@ -58,23 +59,93 @@ namespace Cryville.Common.Unity.UI {
|
|||||||
Text.font = font;
|
Text.font = font;
|
||||||
}
|
}
|
||||||
|
|
||||||
static MethodInfo _methodCreateFontAsset;
|
static TMP_FontAsset CreateFontAsset(string path, int index) => CreateFontAsset(path, index, 90, 9, GlyphRenderMode.SDFAA, 1024, 1024, AtlasPopulationMode.Dynamic);
|
||||||
static readonly object[] _paramsCreateFontAsset = new object[] { null, null, 90, 9, GlyphRenderMode.SDFAA, 1024, 1024, Type.Missing, Type.Missing };
|
|
||||||
static FontAsset CreateFontAsset(string path, int index) {
|
static readonly Lazy<FieldInfo> _f_m_Version = new(() => typeof(TMP_FontAsset).GetField("m_Version", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
if (_methodCreateFontAsset == null) {
|
static readonly Lazy<PropertyInfo> _p_atlasWidth = new(() => typeof(TMP_FontAsset).GetProperty("atlasWidth", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
_methodCreateFontAsset = typeof(FontAsset).GetMethod(
|
static readonly Lazy<PropertyInfo> _p_atlasHeight = new(() => typeof(TMP_FontAsset).GetProperty("atlasHeight", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
"CreateFontAsset", BindingFlags.Static | BindingFlags.NonPublic, null,
|
static readonly Lazy<PropertyInfo> _p_atlasPadding = new(() => typeof(TMP_FontAsset).GetProperty("atlasPadding", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
new Type[] {
|
static readonly Lazy<PropertyInfo> _p_atlasRenderMode = new(() => typeof(TMP_FontAsset).GetProperty("atlasRenderMode", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
typeof(string), typeof(int), typeof(int), typeof(int),
|
static readonly Lazy<PropertyInfo> _p_freeGlyphRects = new(() => typeof(TMP_FontAsset).GetProperty("freeGlyphRects", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
typeof(GlyphRenderMode), typeof(int), typeof(int),
|
static readonly Lazy<PropertyInfo> _p_usedGlyphRects = new(() => typeof(TMP_FontAsset).GetProperty("usedGlyphRects", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
typeof(AtlasPopulationMode), typeof(bool)
|
|
||||||
},
|
static readonly Lazy<PropertyInfo> _p_ShaderRef_MobileBitmap = new(() => typeof(ShaderUtilities).GetProperty("ShaderRef_MobileBitmap", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
null
|
static readonly Lazy<PropertyInfo> _p_ShaderRef_MobileSDF = new(() => typeof(ShaderUtilities).GetProperty("ShaderRef_MobileSDF", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
|
||||||
);
|
|
||||||
|
public static TMP_FontAsset CreateFontAsset(string path, int faceIndex, int samplingPointSize, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight, AtlasPopulationMode atlasPopulationMode = AtlasPopulationMode.Dynamic, bool enableMultiAtlasSupport = true) {
|
||||||
|
// Initialize FontEngine
|
||||||
|
FontEngine.InitializeFontEngine();
|
||||||
|
|
||||||
|
// Load Font Face
|
||||||
|
if (FontEngine.LoadFontFace(path, samplingPointSize, faceIndex) != FontEngineError.Success) {
|
||||||
|
Debug.LogWarning("Unable to load font face at path " + path);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
_paramsCreateFontAsset[0] = path;
|
|
||||||
_paramsCreateFontAsset[1] = index;
|
// Create new font asset
|
||||||
return (FontAsset)_methodCreateFontAsset.Invoke(null, _paramsCreateFontAsset);
|
TMP_FontAsset fontAsset = ScriptableObject.CreateInstance<TMP_FontAsset>();
|
||||||
|
|
||||||
|
_f_m_Version.Value.SetValue(fontAsset, "1.1.0");
|
||||||
|
fontAsset.faceInfo = FontEngine.GetFaceInfo();
|
||||||
|
|
||||||
|
fontAsset.atlasPopulationMode = atlasPopulationMode;
|
||||||
|
|
||||||
|
_p_atlasWidth.Value.SetValue(fontAsset, atlasWidth);
|
||||||
|
_p_atlasHeight.Value.SetValue(fontAsset, atlasHeight);
|
||||||
|
_p_atlasPadding.Value.SetValue(fontAsset, atlasPadding);
|
||||||
|
_p_atlasRenderMode.Value.SetValue(fontAsset, renderMode);
|
||||||
|
|
||||||
|
// Initialize array for the font atlas textures.
|
||||||
|
fontAsset.atlasTextures = new Texture2D[1];
|
||||||
|
|
||||||
|
// Create and add font atlas texture.
|
||||||
|
var texture = new Texture2D(0, 0, TextureFormat.Alpha8, false);
|
||||||
|
fontAsset.atlasTextures[0] = texture;
|
||||||
|
|
||||||
|
fontAsset.isMultiAtlasTexturesEnabled = enableMultiAtlasSupport;
|
||||||
|
|
||||||
|
// Add free rectangle of the size of the texture.
|
||||||
|
int packingModifier;
|
||||||
|
if (((int)renderMode & 0x10) != 0) {
|
||||||
|
packingModifier = 0;
|
||||||
|
|
||||||
|
// Optimize by adding static ref to shader.
|
||||||
|
var tmp_material = new Material((Shader)_p_ShaderRef_MobileBitmap.Value.GetValue(null));
|
||||||
|
|
||||||
|
//tmp_material.name = texture.name + " Material";
|
||||||
|
tmp_material.SetTexture(ShaderUtilities.ID_MainTex, texture);
|
||||||
|
tmp_material.SetFloat(ShaderUtilities.ID_TextureWidth, atlasWidth);
|
||||||
|
tmp_material.SetFloat(ShaderUtilities.ID_TextureHeight, atlasHeight);
|
||||||
|
|
||||||
|
fontAsset.material = tmp_material;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
packingModifier = 1;
|
||||||
|
|
||||||
|
// Optimize by adding static ref to shader.
|
||||||
|
var tmp_material = new Material((Shader)_p_ShaderRef_MobileSDF.Value.GetValue(null));
|
||||||
|
|
||||||
|
//tmp_material.name = texture.name + " Material";
|
||||||
|
tmp_material.SetTexture(ShaderUtilities.ID_MainTex, texture);
|
||||||
|
tmp_material.SetFloat(ShaderUtilities.ID_TextureWidth, atlasWidth);
|
||||||
|
tmp_material.SetFloat(ShaderUtilities.ID_TextureHeight, atlasHeight);
|
||||||
|
|
||||||
|
tmp_material.SetFloat(ShaderUtilities.ID_GradientScale, atlasPadding + packingModifier);
|
||||||
|
|
||||||
|
tmp_material.SetFloat(ShaderUtilities.ID_WeightNormal, fontAsset.normalStyle);
|
||||||
|
tmp_material.SetFloat(ShaderUtilities.ID_WeightBold, fontAsset.boldStyle);
|
||||||
|
|
||||||
|
fontAsset.material = tmp_material;
|
||||||
|
}
|
||||||
|
|
||||||
|
_p_freeGlyphRects.Value.SetValue(fontAsset, new List<GlyphRect>(8) { new(0, 0, atlasWidth - packingModifier, atlasHeight - packingModifier) });
|
||||||
|
_p_usedGlyphRects.Value.SetValue(fontAsset, new List<GlyphRect>(8));
|
||||||
|
|
||||||
|
// TODO: Consider adding support for extracting glyph positioning data
|
||||||
|
|
||||||
|
fontAsset.ReadFontAssetDefinition();
|
||||||
|
|
||||||
|
return fontAsset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ MonoImporter:
|
|||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: -95
|
||||||
icon: {instanceID: 0}
|
icon: {instanceID: 0}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
|
|||||||
@@ -1,19 +1,60 @@
|
|||||||
using Cryville.Common.Font;
|
using Cryville.Common.Font;
|
||||||
|
using Cryville.Common.Logging;
|
||||||
using Cryville.Common.Unity.UI;
|
using Cryville.Common.Unity.UI;
|
||||||
using Cryville.Culture;
|
using Cryville.Culture;
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Logger = Cryville.Common.Logging.Logger;
|
||||||
|
|
||||||
namespace Cryville.EEW.Unity {
|
namespace Cryville.EEW.Unity {
|
||||||
class App {
|
class App {
|
||||||
|
public static string AppDataPath { get; private set; }
|
||||||
|
|
||||||
|
public static Logger MainLogger { get; private set; }
|
||||||
|
static FileStream _logFileStream;
|
||||||
|
static StreamLoggerListener _logWriter;
|
||||||
|
|
||||||
static bool _init;
|
static bool _init;
|
||||||
public static void Init() {
|
public static void Init() {
|
||||||
if (_init) return;
|
if (_init) return;
|
||||||
_init = true;
|
_init = true;
|
||||||
|
|
||||||
|
AppDataPath = Application.persistentDataPath;
|
||||||
|
|
||||||
|
var logPath = Directory.CreateDirectory(Path.Combine(AppDataPath, "logs"));
|
||||||
|
_logFileStream = new FileStream(
|
||||||
|
Path.Combine(
|
||||||
|
logPath.FullName,
|
||||||
|
string.Format(
|
||||||
|
CultureInfo.InvariantCulture,
|
||||||
|
"{0}.log",
|
||||||
|
DateTimeOffset.UtcNow.ToString("yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
FileMode.Create, FileAccess.Write, FileShare.Read
|
||||||
|
);
|
||||||
|
_logWriter = new StreamLoggerListener(_logFileStream) { AutoFlush = true };
|
||||||
|
MainLogger = new Logger();
|
||||||
|
var listener = new InstantLoggerListener();
|
||||||
|
listener.Log += MainLogger.Log;
|
||||||
|
MainLogger.AddListener(_logWriter);
|
||||||
|
Application.logMessageReceivedThreaded += OnInternalLog;
|
||||||
|
|
||||||
|
MainLogger.Log(1, "App", null, "App Version: {0}", Application.version);
|
||||||
|
MainLogger.Log(1, "App", null, "Unity Version: {0}", Application.unityVersion);
|
||||||
|
MainLogger.Log(1, "App", null, "Operating System: {0}, Unity = {1}, Family = {2}", Environment.OSVersion, SystemInfo.operatingSystem, SystemInfo.operatingSystemFamily);
|
||||||
|
MainLogger.Log(1, "App", null, "Platform: Build = {0}, Unity = {1}", PlatformConfig.Name, Application.platform);
|
||||||
|
MainLogger.Log(1, "App", null, "Culture: {0}, UI = {1}, Unity = {2}", SharedCultures.CurrentCulture, SharedCultures.CurrentUICulture, Application.systemLanguage);
|
||||||
|
MainLogger.Log(1, "App", null, "Device: Model = {0}, Type = {1}", SystemInfo.deviceModel, SystemInfo.deviceType);
|
||||||
|
MainLogger.Log(1, "App", null, "Graphics: Name = {0}, Type = {1}, Vendor = {2}, Version = {3}", SystemInfo.graphicsDeviceName, SystemInfo.graphicsDeviceType, SystemInfo.graphicsDeviceVendor, SystemInfo.graphicsDeviceVersion);
|
||||||
|
MainLogger.Log(1, "App", null, "Processor: Count = {0}, Frequency = {1}MHz, Type = {2}", SystemInfo.processorCount, SystemInfo.processorFrequency, SystemInfo.processorType);
|
||||||
|
|
||||||
|
MainLogger.Log(1, "App", null, "Initializing font manager");
|
||||||
foreach (var res in Resources.LoadAll<TextAsset>("cldr/common/validity")) {
|
foreach (var res in Resources.LoadAll<TextAsset>("cldr/common/validity")) {
|
||||||
IdValidity.Load(LoadXmlDocument(res));
|
IdValidity.Load(LoadXmlDocument(res));
|
||||||
}
|
}
|
||||||
@@ -25,7 +66,10 @@ namespace Cryville.EEW.Unity {
|
|||||||
};
|
};
|
||||||
TMPLocalizedText.DefaultShader = Resources.Load<Shader>(PlatformConfig.TextShader);
|
TMPLocalizedText.DefaultShader = Resources.Load<Shader>(PlatformConfig.TextShader);
|
||||||
|
|
||||||
|
MainLogger.Log(1, "App", null, "Loading config");
|
||||||
SharedSettings.Instance.Init();
|
SharedSettings.Instance.Init();
|
||||||
|
|
||||||
|
MainLogger.Log(1, "App", null, "Initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly Encoding _encoding = new UTF8Encoding(false, true);
|
static readonly Encoding _encoding = new UTF8Encoding(false, true);
|
||||||
@@ -40,5 +84,16 @@ namespace Cryville.EEW.Unity {
|
|||||||
using var reader = XmlReader.Create(stream, _xmlSettings);
|
using var reader = XmlReader.Create(stream, _xmlSettings);
|
||||||
return XDocument.Load(reader);
|
return XDocument.Load(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void OnInternalLog(string condition, string stackTrace, LogType type) {
|
||||||
|
var l = type switch {
|
||||||
|
LogType.Log => 1,
|
||||||
|
LogType.Assert => 2,
|
||||||
|
LogType.Warning => 3,
|
||||||
|
LogType.Error or LogType.Exception => 4,
|
||||||
|
_ => 1,
|
||||||
|
};
|
||||||
|
MainLogger.Log(l, "Internal", null, "{0}\n{1}", condition, stackTrace);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.0.6")]
|
[assembly: AssemblyVersion("0.0.11")]
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace Cryville.EEW.Unity {
|
|||||||
float SeverityColorMappingLuminanceMultiplier,
|
float SeverityColorMappingLuminanceMultiplier,
|
||||||
bool UseContinuousColor,
|
bool UseContinuousColor,
|
||||||
string ColorScheme,
|
string ColorScheme,
|
||||||
|
float HillshadeLayerOpacity,
|
||||||
string LocationNamer,
|
string LocationNamer,
|
||||||
|
|
||||||
string OverrideTimeZone,
|
string OverrideTimeZone,
|
||||||
@@ -31,6 +32,7 @@ namespace Cryville.EEW.Unity {
|
|||||||
1f,
|
1f,
|
||||||
false,
|
false,
|
||||||
"Default",
|
"Default",
|
||||||
|
1,
|
||||||
"FERegionLong",
|
"FERegionLong",
|
||||||
|
|
||||||
null,
|
null,
|
||||||
@@ -55,23 +57,29 @@ namespace Cryville.EEW.Unity {
|
|||||||
[JsonDerivedType(typeof(BMKGOpenDataEventSourceConfig), "BMKGOpenData")]
|
[JsonDerivedType(typeof(BMKGOpenDataEventSourceConfig), "BMKGOpenData")]
|
||||||
[JsonDerivedType(typeof(CWAOpenDataEventSourceConfig), "CWAOpenData")]
|
[JsonDerivedType(typeof(CWAOpenDataEventSourceConfig), "CWAOpenData")]
|
||||||
[JsonDerivedType(typeof(EMSCRealTimeEventSourceConfig), "EMSCRealTime")]
|
[JsonDerivedType(typeof(EMSCRealTimeEventSourceConfig), "EMSCRealTime")]
|
||||||
|
[JsonDerivedType(typeof(FANStudioEventSourceConfig), "FANStudio")]
|
||||||
|
[JsonDerivedType(typeof(FANStudioAllEventSourceConfig), "FANStudioAll")]
|
||||||
|
[JsonDerivedType(typeof(GeoNetEventSourceConfig), "GeoNet")]
|
||||||
[JsonDerivedType(typeof(GlobalQuakeServerEventSourceConfig), "GlobalQuakeServer")]
|
[JsonDerivedType(typeof(GlobalQuakeServerEventSourceConfig), "GlobalQuakeServer")]
|
||||||
[JsonDerivedType(typeof(GlobalQuakeServer15EventSourceConfig), "GlobalQuakeServer15")]
|
[JsonDerivedType(typeof(GlobalQuakeServer15EventSourceConfig), "GlobalQuakeServer15")]
|
||||||
[JsonDerivedType(typeof(JMAAtomEventSourceConfig), "JMAAtom")]
|
[JsonDerivedType(typeof(JMAAtomEventSourceConfig), "JMAAtom")]
|
||||||
[JsonDerivedType(typeof(NOAAEventSourceConfig), "NOAA")]
|
[JsonDerivedType(typeof(NOAAEventSourceConfig), "NOAA")]
|
||||||
[JsonDerivedType(typeof(UpdateCheckerEventSourceConfig), "UpdateChecker")]
|
[JsonDerivedType(typeof(UpdateCheckerEventSourceConfig), "UpdateChecker")]
|
||||||
[JsonDerivedType(typeof(USGSQuakeMLEventSourceConfig), "USGSQuakeML")]
|
[JsonDerivedType(typeof(USGSEventSourceConfig), "USGSQuakeML")]
|
||||||
[JsonDerivedType(typeof(WolfxEventSourceConfig), "Wolfx")]
|
[JsonDerivedType(typeof(WolfxEventSourceConfig), "Wolfx")]
|
||||||
abstract record EventSourceConfig();
|
abstract record EventSourceConfig();
|
||||||
record BMKGOpenDataEventSourceConfig([property: JsonRequired] string[] Subtypes) : EventSourceConfig;
|
record BMKGOpenDataEventSourceConfig([property: JsonRequired] string[] Subtypes) : EventSourceConfig;
|
||||||
record CWAOpenDataEventSourceConfig([property: JsonRequired] string Subtype, [property: JsonRequired] string Token) : EventSourceConfig;
|
record CWAOpenDataEventSourceConfig([property: JsonRequired] string Subtype, [property: JsonRequired] string Token) : EventSourceConfig;
|
||||||
record EMSCRealTimeEventSourceConfig() : EventSourceConfig;
|
record EMSCRealTimeEventSourceConfig() : EventSourceConfig;
|
||||||
|
record FANStudioEventSourceConfig([property: JsonRequired] string Subtype) : EventSourceConfig;
|
||||||
|
record FANStudioAllEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false) : EventSourceConfig;
|
||||||
|
record GeoNetEventSourceConfig(int MinimumMMI = 3, bool DoGetFullHistory = false, bool DoGetStrongMotionInfo = true) : EventSourceConfig;
|
||||||
record GlobalQuakeServerEventSourceConfig([property: JsonRequired] string Host, int Port = 38000) : EventSourceConfig;
|
record GlobalQuakeServerEventSourceConfig([property: JsonRequired] string Host, int Port = 38000) : EventSourceConfig;
|
||||||
record GlobalQuakeServer15EventSourceConfig(string Host, int Port = 38000) : GlobalQuakeServerEventSourceConfig(Host, Port);
|
record GlobalQuakeServer15EventSourceConfig(string Host, int Port = 38000) : GlobalQuakeServerEventSourceConfig(Host, Port);
|
||||||
record JMAAtomEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false) : EventSourceConfig;
|
record JMAAtomEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false) : EventSourceConfig;
|
||||||
record NOAAEventSourceConfig([property: JsonRequired] string Subtype) : EventSourceConfig;
|
record NOAAEventSourceConfig([property: JsonRequired] string Subtype) : EventSourceConfig;
|
||||||
record UpdateCheckerEventSourceConfig : EventSourceConfig;
|
record UpdateCheckerEventSourceConfig : EventSourceConfig;
|
||||||
record USGSQuakeMLEventSourceConfig([property: JsonRequired] string Subtype) : EventSourceConfig;
|
record USGSEventSourceConfig([property: JsonRequired] string Subtype, bool UseGeoJSONFeeds, string[] Products) : EventSourceConfig;
|
||||||
record WolfxEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false, bool UseRawCENCLocationName = false) : EventSourceConfig;
|
record WolfxEventSourceConfig(IReadOnlyCollection<string> Filter = null, bool IsFilterWhitelist = false, bool UseRawCENCLocationName = false) : EventSourceConfig;
|
||||||
|
|
||||||
[JsonSerializable(typeof(Config))]
|
[JsonSerializable(typeof(Config))]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"GUID:b92f9c7ac10b1c04e86fc48210f62ab1",
|
"GUID:b92f9c7ac10b1c04e86fc48210f62ab1",
|
||||||
"GUID:1e0937e40dadba24a97b7342c4559580",
|
"GUID:1e0937e40dadba24a97b7342c4559580",
|
||||||
"GUID:e5b7e7f40a80a814ba706299d68f9213",
|
"GUID:e5b7e7f40a80a814ba706299d68f9213",
|
||||||
"GUID:da293eebbcb9a4947a212534c52d1a32"
|
"GUID:6055be8ebefd69e48b49212b09b47b2f"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Cryville.EEW.Core.Map;
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -10,12 +11,16 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
Transform m_layerTile;
|
Transform m_layerTile;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
|
Transform m_layerTileHillshade;
|
||||||
|
[SerializeField]
|
||||||
MapElementManager m_layerElement;
|
MapElementManager m_layerElement;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
MapElementManager m_layerElementSub;
|
MapElementManager m_layerElementSub;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject m_prefabTile;
|
GameObject m_prefabTile;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
|
GameObject m_prefabTileHillshade;
|
||||||
|
[SerializeField]
|
||||||
GameObject m_prefabBitmapHolder;
|
GameObject m_prefabBitmapHolder;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
int m_maxMapTileZoom = 10;
|
int m_maxMapTileZoom = 10;
|
||||||
@@ -23,6 +28,7 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
bool m_isEditor;
|
bool m_isEditor;
|
||||||
|
|
||||||
MapTileCacheManager _tiles;
|
MapTileCacheManager _tiles;
|
||||||
|
MapTileCacheManager _tilesHillshade;
|
||||||
float _elementLayerZ;
|
float _elementLayerZ;
|
||||||
|
|
||||||
void Start() {
|
void Start() {
|
||||||
@@ -33,12 +39,23 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
_tiles.PrefabTile = m_prefabTile;
|
_tiles.PrefabTile = m_prefabTile;
|
||||||
_tiles.PrefabBitmapHolder = m_prefabBitmapHolder;
|
_tiles.PrefabBitmapHolder = m_prefabBitmapHolder;
|
||||||
_tiles.CacheDir = Application.temporaryCachePath;
|
_tiles.CacheDir = Application.temporaryCachePath;
|
||||||
|
if (m_layerTileHillshade) {
|
||||||
|
m_prefabTileHillshade.GetComponent<SpriteRenderer>().sharedMaterial.color = new UnityEngine.Color(1, 1, 1, SharedSettings.Instance.HillshadeLayerOpacity);
|
||||||
|
_tilesHillshade = new HillshadeMapTileCacheManager {
|
||||||
|
ExtraCachedZoomLevel = 20,
|
||||||
|
Parent = m_layerTileHillshade,
|
||||||
|
PrefabTile = m_prefabTileHillshade,
|
||||||
|
PrefabBitmapHolder = m_prefabBitmapHolder,
|
||||||
|
CacheDir = Application.temporaryCachePath,
|
||||||
|
};
|
||||||
|
}
|
||||||
_camera.orthographicSize = 0.5f / MathF.Max(1, (float)_camera.pixelWidth / _camera.pixelHeight);
|
_camera.orthographicSize = 0.5f / MathF.Max(1, (float)_camera.pixelWidth / _camera.pixelHeight);
|
||||||
if (m_layerElement != null) _elementLayerZ = m_layerElement.transform.position.z;
|
if (m_layerElement != null) _elementLayerZ = m_layerElement.transform.position.z;
|
||||||
_mapElementUpdated = true;
|
_mapElementUpdated = true;
|
||||||
}
|
}
|
||||||
void OnDestroy() {
|
void OnDestroy() {
|
||||||
_tiles.Dispose();
|
_tiles.Dispose();
|
||||||
|
_tilesHillshade?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
float Scale {
|
float Scale {
|
||||||
@@ -104,10 +121,10 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
var bounds = new Bounds((Vector2)transform.position, new Vector2(w, h));
|
var bounds = new Bounds((Vector2)transform.position, new Vector2(w, h));
|
||||||
int zoom = Math.Clamp((int)Math.Log(vz / 256, 2) + 1, 0, m_maxMapTileZoom);
|
int zoom = Math.Clamp((int)Math.Log(vz / 256, 2) + 1, 0, m_maxMapTileZoom);
|
||||||
int zoomScale = 1 << zoom;
|
int zoomScale = 1 << zoom;
|
||||||
_tiles.MoveTo(
|
var a = new MapTileIndex(Mathf.FloorToInt(bounds.min.x * zoomScale), Mathf.FloorToInt(-bounds.max.y * zoomScale), zoom);
|
||||||
new(Mathf.FloorToInt(bounds.min.x * zoomScale), Mathf.FloorToInt(-bounds.max.y * zoomScale), zoom),
|
var b = new MapTileIndex(Mathf.CeilToInt(bounds.max.x * zoomScale), Mathf.CeilToInt(-bounds.min.y * zoomScale), zoom);
|
||||||
new(Mathf.CeilToInt(bounds.max.x * zoomScale), Mathf.CeilToInt(-bounds.min.y * zoomScale), zoom)
|
_tiles.MoveTo(a, b);
|
||||||
);
|
_tilesHillshade?.MoveTo(a, b);
|
||||||
|
|
||||||
if (m_layerElement != null) {
|
if (m_layerElement != null) {
|
||||||
m_layerElement.Scale = h;
|
m_layerElement.Scale = h;
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using Cryville.EEW.Core.Map;
|
||||||
|
using System.IO;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Cryville.EEW.Unity.Map {
|
||||||
|
sealed class HillshadeMapTileCacheManager : MapTileCacheManager {
|
||||||
|
protected override MapTileBitmapHolder CreateBitmapHolder(MapTileIndex index) => new(
|
||||||
|
index,
|
||||||
|
GameObject.Instantiate(PrefabBitmapHolder, Parent, false),
|
||||||
|
new($"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{index.Z}/{index.NY}/{index.NX}.png")
|
||||||
|
);
|
||||||
|
|
||||||
|
protected override string GetCacheFilePath(MapTileIndex index) => Path.Combine(CacheDir, $"map_hillshade/{index.Z}/{index.NX}/{index.NY}");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 9e8aa96a139a7414cb4d2031a22588db
|
guid: d5fed9b884a4ff54f837aa0f2265ad36
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -2,12 +2,15 @@ using Cryville.EEW.BMKGOpenData.Map;
|
|||||||
using Cryville.EEW.Core;
|
using Cryville.EEW.Core;
|
||||||
using Cryville.EEW.CWAOpenData.Map;
|
using Cryville.EEW.CWAOpenData.Map;
|
||||||
using Cryville.EEW.EMSC.Map;
|
using Cryville.EEW.EMSC.Map;
|
||||||
|
using Cryville.EEW.FANStudio.Map;
|
||||||
|
using Cryville.EEW.GeoNet.Map;
|
||||||
using Cryville.EEW.GlobalQuake.Map;
|
using Cryville.EEW.GlobalQuake.Map;
|
||||||
using Cryville.EEW.JMAAtom.Map;
|
using Cryville.EEW.JMAAtom.Map;
|
||||||
using Cryville.EEW.Map;
|
using Cryville.EEW.Map;
|
||||||
using Cryville.EEW.NOAA.Map;
|
using Cryville.EEW.NOAA.Map;
|
||||||
using Cryville.EEW.QuakeML.Map;
|
using Cryville.EEW.QuakeML.Map;
|
||||||
using Cryville.EEW.Report;
|
using Cryville.EEW.Report;
|
||||||
|
using Cryville.EEW.USGS.Map;
|
||||||
using Cryville.EEW.Wolfx.Map;
|
using Cryville.EEW.Wolfx.Map;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@@ -127,20 +130,33 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly ContextedGeneratorManager<IMapGeneratorContext, MapElement> _gen = new(new IContextedGenerator<IMapGeneratorContext, MapElement>[] {
|
readonly ContextedGeneratorManager<IMapGeneratorContext, MapElement> _gen = new(new IContextedGenerator<IMapGeneratorContext, MapElement>[] {
|
||||||
|
new BeijingEarthquakeMapGenerator(),
|
||||||
new BMKGEarthquakeMapGenerator(),
|
new BMKGEarthquakeMapGenerator(),
|
||||||
new CENCEarthquakeMapGenerator(),
|
new CEAEEWMapGenerator(),
|
||||||
|
new FANStudio.Map.CENCEarthquakeMapGenerator(),
|
||||||
|
new Wolfx.Map.CENCEarthquakeMapGenerator(),
|
||||||
new CENCEEWMapGenerator(),
|
new CENCEEWMapGenerator(),
|
||||||
new CWAEarthquakeMapGenerator(),
|
new CWAEarthquakeMapGenerator(),
|
||||||
new CWAEEWMapGenerator(),
|
new CWAEEWMapGenerator(),
|
||||||
new CWATsunamiMapGenerator(),
|
new CWATsunamiMapGenerator(),
|
||||||
new EMSCRealTimeEventMapGenerator(),
|
new EMSCRealTimeEventMapGenerator(),
|
||||||
new FujianEEWMapGenerator(),
|
new FANStudio.Map.FujianEEWMapGenerator(),
|
||||||
|
new Wolfx.Map.FujianEEWMapGenerator(),
|
||||||
|
new GeoNetQuakeHistoryMapGenerator(),
|
||||||
|
new GeoNetQuakeMapGenerator(),
|
||||||
|
new GeoNetStrongMapGenerator(),
|
||||||
new GlobalQuakeMapViewGenerator(),
|
new GlobalQuakeMapViewGenerator(),
|
||||||
|
new HKOEarthquakeMapGenerator(),
|
||||||
|
new ICLEEWMapGenerator(),
|
||||||
new JMAAtomMapGenerator(),
|
new JMAAtomMapGenerator(),
|
||||||
new JMAEEWMapGenerator(),
|
new JMAEEWMapGenerator(),
|
||||||
|
new NingxiaEarthquakeMapGenerator(),
|
||||||
new NOAAMapGenerator(),
|
new NOAAMapGenerator(),
|
||||||
|
new ShakeAlertEEWMapGenerator(),
|
||||||
|
new FANStudio.Map.SichuanEEWMapGenerator(),
|
||||||
|
new Wolfx.Map.SichuanEEWMapGenerator(),
|
||||||
new QuakeMLEventMapGenerator(),
|
new QuakeMLEventMapGenerator(),
|
||||||
new SichuanEEWMapGenerator(),
|
new USGSContoursMapGenerator(),
|
||||||
});
|
});
|
||||||
public UnityMapElement Build(object e, out CultureInfo culture, out int order) {
|
public UnityMapElement Build(object e, out CultureInfo culture, out int order) {
|
||||||
culture = CultureInfo.InvariantCulture;
|
culture = CultureInfo.InvariantCulture;
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
float z = 1 << index.Z;
|
float z = 1 << index.Z;
|
||||||
transform.localPosition = new(index.X / z, -(index.Y + 1) / z, -index.Z / 100f);
|
transform.localPosition = new(index.X / z, -(index.Y + 1) / z, -index.Z / 100f);
|
||||||
transform.localScale = new Vector3(1 / z, 1 / z, 1);
|
transform.localScale = new Vector3(1 / z, 1 / z, 1);
|
||||||
|
if (_idView) {
|
||||||
_idView.gameObject.SetActive(true);
|
_idView.gameObject.SetActive(true);
|
||||||
byte e = SharedSettings.Instance.IdBytes[((index.X << 2) + index.Y) & 0x1f];
|
byte e = SharedSettings.Instance.IdBytes[((index.X << 2) + index.Y) & 0x1f];
|
||||||
int ex = e >> 4, ey = e & 0xf;
|
int ex = e >> 4, ey = e & 0xf;
|
||||||
_idView.localPosition = new(ex / 16f, 1 - ey / 16f, -1 / 200f);
|
_idView.localPosition = new(ex / 16f, 1 - ey / 16f, -1 / 200f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Set(Sprite sprite) {
|
public void Set(Sprite sprite) {
|
||||||
if (_renderer) {
|
if (_renderer) {
|
||||||
@@ -40,5 +42,9 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetVisible(bool v) {
|
||||||
|
_renderer.enabled = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
|
|
||||||
public MapTileBitmapHolder(MapTileIndex index, GameObject gameObject, Uri uri) : base(index) {
|
public MapTileBitmapHolder(MapTileIndex index, GameObject gameObject, Uri uri) : base(index) {
|
||||||
_behaviour = gameObject.GetComponent<MapTileBitmapHolderBehaviour>();
|
_behaviour = gameObject.GetComponent<MapTileBitmapHolderBehaviour>();
|
||||||
|
_behaviour.Index = index;
|
||||||
_uri = uri;
|
_uri = uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,5 +33,17 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
public void Bind(MapTile tile) {
|
public void Bind(MapTile tile) {
|
||||||
_behaviour.Bind(tile);
|
_behaviour.Bind(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Unbind(MapTile tile) {
|
||||||
|
_behaviour.Unbind(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddChild(MapTileBitmapHolder bitmapHolder) {
|
||||||
|
_behaviour.AddChild(bitmapHolder._behaviour);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveChild(MapTileBitmapHolder bitmapHolder) {
|
||||||
|
_behaviour.RemoveChild(bitmapHolder._behaviour);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,39 @@
|
|||||||
|
using Cryville.EEW.Core.Map;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
namespace Cryville.EEW.Unity.Map {
|
namespace Cryville.EEW.Unity.Map {
|
||||||
sealed class MapTileBitmapHolderBehaviour : MonoBehaviour {
|
sealed class MapTileBitmapHolderBehaviour : MonoBehaviour {
|
||||||
Action<Sprite> _callback;
|
public MapTileIndex Index { get; set; }
|
||||||
|
|
||||||
|
readonly List<MapTile> _tiles = new();
|
||||||
public void Bind(MapTile tile) {
|
public void Bind(MapTile tile) {
|
||||||
if (_isDone)
|
_tiles.Add(tile);
|
||||||
|
if (_sprite) {
|
||||||
tile.Set(_sprite);
|
tile.Set(_sprite);
|
||||||
else
|
}
|
||||||
_callback += tile.Set;
|
}
|
||||||
|
public void Unbind(MapTile tile) {
|
||||||
|
_tiles.Remove(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly List<MapTileBitmapHolderBehaviour> _children = new();
|
||||||
|
public void AddChild(MapTileBitmapHolderBehaviour behaviour) {
|
||||||
|
_children.Add(behaviour);
|
||||||
|
foreach (var tile in _tiles) {
|
||||||
|
tile.SetVisible(false);
|
||||||
|
}
|
||||||
|
SetChildSprite(behaviour);
|
||||||
|
}
|
||||||
|
public void RemoveChild(MapTileBitmapHolderBehaviour behaviour) {
|
||||||
|
_children.Remove(behaviour);
|
||||||
|
bool isActive = _children.Count == 0;
|
||||||
|
foreach (var tile in _tiles) {
|
||||||
|
tile.SetVisible(isActive);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UnityWebRequest _req;
|
UnityWebRequest _req;
|
||||||
@@ -20,7 +43,6 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
|
|
||||||
FileInfo _localFile;
|
FileInfo _localFile;
|
||||||
bool _isReady;
|
bool _isReady;
|
||||||
bool _isDone;
|
|
||||||
public void Load(FileInfo file) {
|
public void Load(FileInfo file) {
|
||||||
_localFile = file;
|
_localFile = file;
|
||||||
_isReady = true;
|
_isReady = true;
|
||||||
@@ -40,7 +62,7 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
_req.SendWebRequest();
|
_req.SendWebRequest();
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Debug.LogException(ex);
|
App.MainLogger.Log(4, "Map", null, "An error occurred when loading map tile {0}: {1}", _localFile, ex);
|
||||||
}
|
}
|
||||||
_isReady = false;
|
_isReady = false;
|
||||||
}
|
}
|
||||||
@@ -48,19 +70,41 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
if (_texHandler.isDone && _texHandler.texture != null) {
|
if (_texHandler.isDone && _texHandler.texture != null) {
|
||||||
_tex = _texHandler.texture;
|
_tex = _texHandler.texture;
|
||||||
_tex.wrapMode = TextureWrapMode.Clamp;
|
_tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
_sprite = Sprite.Create(_tex, new Rect(0, 0, _tex.width, _tex.height), Vector2.zero, _tex.height, 0, SpriteMeshType.FullRect, Vector4.zero, false);
|
SetSprite(_tex, 0, 0, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Debug.LogError(_texHandler.error);
|
App.MainLogger.Log(4, "Map", null, "An error occurred when loading map tile {0}: {1}", _localFile, _texHandler.error);
|
||||||
_localFile.Delete();
|
_localFile.Delete();
|
||||||
}
|
}
|
||||||
_req.Dispose();
|
_req.Dispose();
|
||||||
_texHandler.Dispose();
|
_texHandler.Dispose();
|
||||||
_req = null;
|
_req = null;
|
||||||
_callback?.Invoke(_sprite);
|
|
||||||
_isDone = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int _minDz = int.MaxValue;
|
||||||
|
int _x, _y;
|
||||||
|
void SetSprite(Texture2D tex, int dz, int x, int y) {
|
||||||
|
if (dz >= 8) return;
|
||||||
|
if (dz > _minDz) return;
|
||||||
|
_tex = tex;
|
||||||
|
_x = x; _y = y;
|
||||||
|
_minDz = dz;
|
||||||
|
if (_sprite) Destroy(_sprite);
|
||||||
|
int sx = x << (8 - dz), sy = 256 - ((y + 1) << (8 - dz));
|
||||||
|
_sprite = Sprite.Create(tex, new Rect(sx, sy, 1 << (8 - dz), 1 << (8 - dz)), Vector2.zero, 1 << (8 - dz), 0, SpriteMeshType.FullRect, Vector4.zero, false);
|
||||||
|
foreach (var tile in _tiles)
|
||||||
|
tile.Set(_sprite);
|
||||||
|
foreach (var child in _children) {
|
||||||
|
SetChildSprite(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetChildSprite(MapTileBitmapHolderBehaviour child) {
|
||||||
|
if (!_tex) return;
|
||||||
|
int cdz = child.Index.Z - Index.Z;
|
||||||
|
int cx = child.Index.X % (1 << cdz) | (_x << cdz), cy = child.Index.Y % (1 << cdz) | (_y << cdz);
|
||||||
|
child.SetSprite(_tex, cdz + _minDz, cx, cy);
|
||||||
|
}
|
||||||
|
|
||||||
bool _isDestroyed;
|
bool _isDestroyed;
|
||||||
public void Destroy() {
|
public void Destroy() {
|
||||||
@@ -69,11 +113,15 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
void OnDestroy() {
|
void OnDestroy() {
|
||||||
if (_req != null) {
|
if (_req != null) {
|
||||||
_req.Abort();
|
_req.Abort();
|
||||||
_req.Dispose();
|
if (_texHandler != null) {
|
||||||
|
var tex = _texHandler.texture;
|
||||||
|
if (tex) Destroy(tex);
|
||||||
_texHandler.Dispose();
|
_texHandler.Dispose();
|
||||||
}
|
}
|
||||||
|
_req.Dispose();
|
||||||
|
}
|
||||||
if (_sprite) Destroy(_sprite);
|
if (_sprite) Destroy(_sprite);
|
||||||
if (_tex) Destroy(_tex);
|
if (_tex && _minDz == 0) Destroy(_tex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Cryville.EEW.Core.Map;
|
using Cryville.EEW.Core.Map;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -15,7 +16,7 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
protected override MapTileBitmapHolder CreateBitmapHolder(MapTileIndex index) => new(
|
protected override MapTileBitmapHolder CreateBitmapHolder(MapTileIndex index) => new(
|
||||||
index,
|
index,
|
||||||
GameObject.Instantiate(PrefabBitmapHolder, Parent, false),
|
GameObject.Instantiate(PrefabBitmapHolder, Parent, false),
|
||||||
new($"https://server.arcgisonline.com/ArcGIS/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{index.Z}/{index.NY}/{index.NX}")
|
new($"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{index.Z}/{index.NY}/{index.NX}")
|
||||||
);
|
);
|
||||||
|
|
||||||
protected override string GetCacheFilePath(MapTileIndex index) => Path.Combine(CacheDir, $"map/{index.Z}/{index.NX}/{index.NY}");
|
protected override string GetCacheFilePath(MapTileIndex index) => Path.Combine(CacheDir, $"map/{index.Z}/{index.NX}/{index.NY}");
|
||||||
@@ -26,16 +27,30 @@ namespace Cryville.EEW.Unity.Map {
|
|||||||
var gameObject = GameObject.Instantiate(PrefabTile, Parent, false);
|
var gameObject = GameObject.Instantiate(PrefabTile, Parent, false);
|
||||||
var uTile = gameObject.GetComponent<MapTile>();
|
var uTile = gameObject.GetComponent<MapTile>();
|
||||||
_map.Add(tile, uTile);
|
_map.Add(tile, uTile);
|
||||||
uTile.Init(tile.Index);
|
var index = tile.Index;
|
||||||
tile.BitmapHolder.Bind(uTile);
|
uTile.Init(index);
|
||||||
|
var bitmapHolder = tile.BitmapHolder;
|
||||||
|
bitmapHolder.Bind(uTile);
|
||||||
|
|
||||||
|
if (index.Z <= 0) return;
|
||||||
|
var maybeTile = FindTile(index.ZoomToLevel(index.Z - 1, Math.Floor), false);
|
||||||
|
if (maybeTile is not MapTile<MapTileBitmapHolder> parentTile) return;
|
||||||
|
parentTile.BitmapHolder.AddChild(bitmapHolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnTileDestroyed(MapTile<MapTileBitmapHolder> tile) {
|
protected override void OnTileDestroyed(MapTile<MapTileBitmapHolder> tile) {
|
||||||
base.OnTileDestroyed(tile);
|
base.OnTileDestroyed(tile);
|
||||||
|
var bitmapHolder = tile.BitmapHolder;
|
||||||
if (_map.TryGetValue(tile, out var uTile)) {
|
if (_map.TryGetValue(tile, out var uTile)) {
|
||||||
uTile.Destroy();
|
uTile.Destroy();
|
||||||
|
bitmapHolder.Unbind(uTile);
|
||||||
_map.Remove(tile);
|
_map.Remove(tile);
|
||||||
}
|
}
|
||||||
|
var index = tile.Index;
|
||||||
|
if (index.Z <= 0) return;
|
||||||
|
var maybeTile = FindTile(index.ZoomToLevel(index.Z - 1, Math.Floor), false);
|
||||||
|
if (maybeTile is not MapTile<MapTileBitmapHolder> parentTile) return;
|
||||||
|
parentTile.BitmapHolder.RemoveChild(bitmapHolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace Cryville.EEW.Unity {
|
|||||||
public IColorScheme ColorScheme { get; private set; } = new SeverityBasedColorScheme(DefaultSeverityScheme.Instance, DefaultSeverityColorMapping.Instance);
|
public IColorScheme ColorScheme { get; private set; } = new SeverityBasedColorScheme(DefaultSeverityScheme.Instance, DefaultSeverityColorMapping.Instance);
|
||||||
public ISubColorScheme BorderColorScheme { get; private set; } = new WrappedColorScheme(new SeverityBasedColorScheme(DefaultSeverityScheme.Instance, DefaultSeverityColorMapping.SecondaryInstance));
|
public ISubColorScheme BorderColorScheme { get; private set; } = new WrappedColorScheme(new SeverityBasedColorScheme(DefaultSeverityScheme.Instance, DefaultSeverityColorMapping.SecondaryInstance));
|
||||||
public ISubColorScheme TextColorScheme { get; private set; } = new DefaultTextColorScheme(Color.White, Color.Black);
|
public ISubColorScheme TextColorScheme { get; private set; } = new DefaultTextColorScheme(Color.White, Color.Black);
|
||||||
|
public float HillshadeLayerOpacity { get; private set; } = 1;
|
||||||
public TimeSpan NowcastWarningDelayTolerance { get; private set; } = TimeSpan.FromMinutes(60);
|
public TimeSpan NowcastWarningDelayTolerance { get; private set; } = TimeSpan.FromMinutes(60);
|
||||||
|
|
||||||
public CultureInfo RVMCulture { get; private set; } = SharedCultures.CurrentUICulture;
|
public CultureInfo RVMCulture { get; private set; } = SharedCultures.CurrentUICulture;
|
||||||
@@ -117,6 +118,7 @@ namespace Cryville.EEW.Unity {
|
|||||||
"SREV" => new DefaultTextColorScheme(Color.White, Color.FromArgb(28, 28, 28), 0.555f),
|
"SREV" => new DefaultTextColorScheme(Color.White, Color.FromArgb(28, 28, 28), 0.555f),
|
||||||
_ => new DefaultTextColorScheme(Color.White, Color.Black),
|
_ => new DefaultTextColorScheme(Color.White, Color.Black),
|
||||||
};
|
};
|
||||||
|
HillshadeLayerOpacity = config.HillshadeLayerOpacity;
|
||||||
_locationNamer.Namer = config.LocationNamer switch {
|
_locationNamer.Namer = config.LocationNamer switch {
|
||||||
"FERegionShort" => new FERegionShortNamer(),
|
"FERegionShort" => new FERegionShortNamer(),
|
||||||
_ => new FERegionLongNamer(),
|
_ => new FERegionLongNamer(),
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace Cryville.EEW.Unity {
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected override Stream Open(string path) {
|
protected override Stream Open(string path) {
|
||||||
|
App.MainLogger.Log(0, "Audio", null, "Opening audio file {0}", path);
|
||||||
path = Path.Combine(Application.streamingAssetsPath, "Sounds", path + ".ogg");
|
path = Path.Combine(Application.streamingAssetsPath, "Sounds", path + ".ogg");
|
||||||
if (!File.Exists(path)) return null;
|
if (!File.Exists(path)) return null;
|
||||||
return new FileStream(path, FileMode.Open, FileAccess.Read);
|
return new FileStream(path, FileMode.Open, FileAccess.Read);
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using SpeechLib;
|
using SpeechLib;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Cryville.EEW.Unity {
|
namespace Cryville.EEW.Unity {
|
||||||
class TTSWorker : Core.Audio.TTSWorker {
|
class TTSWorker : Core.Audio.TTSWorker {
|
||||||
readonly ISpVoice _voice;
|
readonly ISpVoice _voice;
|
||||||
|
|
||||||
public TTSWorker() : base(CreateSoundPlayer()) {
|
public TTSWorker() : base(CreateSoundPlayer()) {
|
||||||
|
App.MainLogger.Log(1, "Audio", null, "Initializing TTS worker");
|
||||||
try {
|
try {
|
||||||
_voice = new SpVoiceClass();
|
_voice = new SpVoiceClass();
|
||||||
}
|
}
|
||||||
@@ -16,10 +15,12 @@ namespace Cryville.EEW.Unity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static SoundPlayer CreateSoundPlayer() {
|
static SoundPlayer CreateSoundPlayer() {
|
||||||
|
App.MainLogger.Log(1, "Audio", null, "Creating sound player");
|
||||||
try {
|
try {
|
||||||
return new SoundPlayer();
|
return new SoundPlayer();
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException) {
|
catch (InvalidOperationException ex) {
|
||||||
|
App.MainLogger.Log(3, "Audio", null, "An error occurred when creating sound player: {0}", ex);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,18 +31,19 @@ namespace Cryville.EEW.Unity {
|
|||||||
return (status.dwRunningState & (uint)SpeechRunState.SRSEIsSpeaking) != 0;
|
return (status.dwRunningState & (uint)SpeechRunState.SRSEIsSpeaking) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Task Speak(CultureInfo culture, string content, CancellationToken cancellationToken) {
|
protected override void BeginSpeak(CultureInfo culture, string content) {
|
||||||
if (_voice == null) return Task.CompletedTask;
|
if (_voice == null) return;
|
||||||
_voice.Speak(
|
_voice.Speak(
|
||||||
string.Format(CultureInfo.InvariantCulture, "<LANG LANGID=\"{0:x}\">{1}</LANG>", culture.LCID, content),
|
string.Format(CultureInfo.InvariantCulture, "<LANG LANGID=\"{0:x}\">{1}</LANG>", culture.LCID, content),
|
||||||
(uint)(SpeechVoiceSpeakFlags.SVSFlagsAsync | SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak),
|
(uint)(SpeechVoiceSpeakFlags.SVSFlagsAsync | SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak),
|
||||||
out _
|
out _
|
||||||
);
|
);
|
||||||
return Task.CompletedTask;
|
App.MainLogger.Log(0, "Audio", null, "TTS ({0}): {1}", culture, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void StopCurrent() {
|
protected override void StopCurrent() {
|
||||||
if (_voice == null) return;
|
if (_voice == null) return;
|
||||||
|
App.MainLogger.Log(0, "Audio", null, "TTS stopping current");
|
||||||
_voice.Skip("SENTENCE", int.MaxValue, out _);
|
_voice.Skip("SENTENCE", int.MaxValue, out _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
37
Assets/Cryville.EEW.Unity/UI/Dialog.cs
Normal file
37
Assets/Cryville.EEW.Unity/UI/Dialog.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
using Cryville.Common.Unity;
|
||||||
|
using Cryville.Common.Unity.UI;
|
||||||
|
using System.Globalization;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Cryville.EEW.Unity.UI {
|
||||||
|
public class Dialog : MonoBehaviour {
|
||||||
|
public static Dialog Instance { get; private set; }
|
||||||
|
|
||||||
|
[SerializeField] CanvasGroup m_mask;
|
||||||
|
PropertyTweener<float> _groupAlphaTweener;
|
||||||
|
|
||||||
|
[SerializeField] TMPLocalizedText m_title;
|
||||||
|
[SerializeField] TMPLocalizedText m_message;
|
||||||
|
|
||||||
|
void Awake() {
|
||||||
|
Instance = this;
|
||||||
|
|
||||||
|
m_mask.gameObject.SetActive(false);
|
||||||
|
_groupAlphaTweener = new(() => m_mask.alpha, v => m_mask.alpha = v, Tweeners.Single);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Show(string title, string message) {
|
||||||
|
Show(SharedCultures.CurrentUICulture, title, message);
|
||||||
|
}
|
||||||
|
public void Show(CultureInfo culture, string title, string message) {
|
||||||
|
m_title.SetText(title, culture);
|
||||||
|
m_message.SetText(message, culture);
|
||||||
|
m_mask.gameObject.SetActive(true);
|
||||||
|
_groupAlphaTweener.Start(1, 0.2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update() {
|
||||||
|
_groupAlphaTweener.Advance(Time.deltaTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4f85302336d038c4da80ea264d185657
|
guid: f1b4f209f34bc6e4c8e13aeb4dd5789d
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: -5
|
||||||
icon: {instanceID: 0}
|
icon: {instanceID: 0}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
@@ -5,6 +5,10 @@ using Cryville.EEW.CWAOpenData;
|
|||||||
using Cryville.EEW.CWAOpenData.Model;
|
using Cryville.EEW.CWAOpenData.Model;
|
||||||
using Cryville.EEW.CWAOpenData.TTS;
|
using Cryville.EEW.CWAOpenData.TTS;
|
||||||
using Cryville.EEW.EMSC;
|
using Cryville.EEW.EMSC;
|
||||||
|
using Cryville.EEW.FANStudio;
|
||||||
|
using Cryville.EEW.FANStudio.TTS;
|
||||||
|
using Cryville.EEW.GeoNet;
|
||||||
|
using Cryville.EEW.GeoNet.TTS;
|
||||||
using Cryville.EEW.GlobalQuake;
|
using Cryville.EEW.GlobalQuake;
|
||||||
using Cryville.EEW.JMAAtom;
|
using Cryville.EEW.JMAAtom;
|
||||||
using Cryville.EEW.JMAAtom.TTS;
|
using Cryville.EEW.JMAAtom.TTS;
|
||||||
@@ -17,7 +21,6 @@ using Cryville.EEW.Unity.UI;
|
|||||||
using Cryville.EEW.UpdateChecker;
|
using Cryville.EEW.UpdateChecker;
|
||||||
using Cryville.EEW.USGS;
|
using Cryville.EEW.USGS;
|
||||||
using Cryville.EEW.Wolfx;
|
using Cryville.EEW.Wolfx;
|
||||||
using Cryville.EEW.Wolfx.Model;
|
|
||||||
using Cryville.EEW.Wolfx.TTS;
|
using Cryville.EEW.Wolfx.TTS;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
@@ -50,14 +53,22 @@ namespace Cryville.EEW.Unity {
|
|||||||
}
|
}
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
|
||||||
|
try {
|
||||||
App.Init();
|
App.Init();
|
||||||
|
|
||||||
_worker = new(new TTSWorker());
|
_worker = new(new TTSWorker());
|
||||||
_grouper = new ReportGrouper();
|
_grouper = new ReportGrouper();
|
||||||
_cancellationTokenSource = new();
|
_cancellationTokenSource = new();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Dialog.Instance.Show("FATAL ERROR", ex.ToString());
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Start() {
|
void Start() {
|
||||||
|
try {
|
||||||
|
App.MainLogger.Log(1, "App", null, "Initializing localized resources manager");
|
||||||
LocalizedResources.Init(new LocalizedResourcesManager());
|
LocalizedResources.Init(new LocalizedResourcesManager());
|
||||||
RegisterViewModelGenerators(_worker);
|
RegisterViewModelGenerators(_worker);
|
||||||
RegisterTTSMessageGenerators(_worker);
|
RegisterTTSMessageGenerators(_worker);
|
||||||
@@ -71,6 +82,7 @@ namespace Cryville.EEW.Unity {
|
|||||||
_worker.Reported += OnReported;
|
_worker.Reported += OnReported;
|
||||||
_grouper.GroupUpdated += OnGroupUpdated;
|
_grouper.GroupUpdated += OnGroupUpdated;
|
||||||
_grouper.GroupRemoved += OnGroupRemoved;
|
_grouper.GroupRemoved += OnGroupRemoved;
|
||||||
|
App.MainLogger.Log(1, "App", null, "Worker ready");
|
||||||
Task.Run(() => GatewayVerify(_cancellationTokenSource.Token)).ContinueWith(task => {
|
Task.Run(() => GatewayVerify(_cancellationTokenSource.Token)).ContinueWith(task => {
|
||||||
if (task.IsFaulted) {
|
if (task.IsFaulted) {
|
||||||
OnReported(this, new() { Title = task.Exception.Message });
|
OnReported(this, new() { Title = task.Exception.Message });
|
||||||
@@ -83,6 +95,11 @@ namespace Cryville.EEW.Unity {
|
|||||||
Task.Run(() => _ongoingReportManager.RunAsync(_cancellationTokenSource.Token));
|
Task.Run(() => _ongoingReportManager.RunAsync(_cancellationTokenSource.Token));
|
||||||
}, TaskScheduler.Current);
|
}, TaskScheduler.Current);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Dialog.Instance.Show("FATAL ERROR", ex.ToString());
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void OnDestroy() {
|
void OnDestroy() {
|
||||||
_cancellationTokenSource.Cancel();
|
_cancellationTokenSource.Cancel();
|
||||||
@@ -90,44 +107,73 @@ namespace Cryville.EEW.Unity {
|
|||||||
_ongoingReportManager.Dispose();
|
_ongoingReportManager.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
CENCEarthquakeRVMGenerator _cencEarthquakeRVMGenerator;
|
Wolfx.CENCEarthquakeRVMGenerator _cencEarthquakeRVMGenerator;
|
||||||
void RegisterViewModelGenerators(CoreWorker worker) {
|
void RegisterViewModelGenerators(CoreWorker worker) {
|
||||||
|
worker.RegisterViewModelGenerator(new BeijingEarthquakeRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new BMKGEarthquakeRVMGenerator());
|
worker.RegisterViewModelGenerator(new BMKGEarthquakeRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(_cencEarthquakeRVMGenerator = new CENCEarthquakeRVMGenerator());
|
worker.RegisterViewModelGenerator(new CEAEEWRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new FANStudio.CENCEarthquakeRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(_cencEarthquakeRVMGenerator = new());
|
||||||
worker.RegisterViewModelGenerator(new CENCEEWRVMGenerator());
|
worker.RegisterViewModelGenerator(new CENCEEWRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new CWAEarthquakeRVMGenerator());
|
worker.RegisterViewModelGenerator(new CWAEarthquakeRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new CWAEEWRVMGenerator());
|
worker.RegisterViewModelGenerator(new CWAEEWRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new CWATsunamiRVMGenerator());
|
worker.RegisterViewModelGenerator(new CWATsunamiRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new EMSCRealTimeEventRVMGenerator());
|
worker.RegisterViewModelGenerator(new EMSCRealTimeEventRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new FujianEEWRVMGenerator());
|
worker.RegisterViewModelGenerator(new FANStudio.FujianEEWRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new Wolfx.FujianEEWRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new GeoNetQuakeHistoryRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new GeoNetQuakeRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new GeoNetStrongRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new GlobalQuakeRVMGenerator());
|
worker.RegisterViewModelGenerator(new GlobalQuakeRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new HKOEarthquakeRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new ICLEEWRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new JMAAtomRVMGenerator());
|
worker.RegisterViewModelGenerator(new JMAAtomRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new JMAEEWRVMGenerator());
|
worker.RegisterViewModelGenerator(new JMAEEWRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new NingxiaEarthquakeRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new NOAAAtomRVMGenerator());
|
worker.RegisterViewModelGenerator(new NOAAAtomRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new QuakeMLEventRVMGenerator());
|
var quakemlEventRVMGenerator = new QuakeMLEventRVMGenerator();
|
||||||
worker.RegisterViewModelGenerator(new SichuanEEWRVMGenerator());
|
quakemlEventRVMGenerator.AddExtension(new USGSQuakeMLExtension());
|
||||||
|
worker.RegisterViewModelGenerator(quakemlEventRVMGenerator);
|
||||||
|
worker.RegisterViewModelGenerator(new ShakeAlertEEWRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new FANStudio.SichuanEEWRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new Wolfx.SichuanEEWRVMGenerator());
|
||||||
|
worker.RegisterViewModelGenerator(new USGSContoursRVMGenerator());
|
||||||
worker.RegisterViewModelGenerator(new VersionRVMGenerator());
|
worker.RegisterViewModelGenerator(new VersionRVMGenerator());
|
||||||
}
|
}
|
||||||
CENCEarthquakeTTSMessageGenerator _cencEarthquakeTTSMessageGenerator;
|
Wolfx.TTS.CENCEarthquakeTTSMessageGenerator _cencEarthquakeTTSMessageGenerator;
|
||||||
void RegisterTTSMessageGenerators(CoreWorker worker) {
|
void RegisterTTSMessageGenerators(CoreWorker worker) {
|
||||||
|
worker.RegisterTTSMessageGenerator(new BeijingEarthquakeTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new BMKGEarthquakeTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new BMKGEarthquakeTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(_cencEarthquakeTTSMessageGenerator = new CENCEarthquakeTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new CEAEEWTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new FANStudio.TTS.CENCEarthquakeTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(_cencEarthquakeTTSMessageGenerator = new());
|
||||||
worker.RegisterTTSMessageGenerator(new CENCEEWTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new CENCEEWTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new CWAEarthquakeTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new CWAEarthquakeTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new CWAEEWTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new CWAEEWTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new CWATsunamiTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new CWATsunamiTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new FujianEEWTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new FANStudio.TTS.FujianEEWTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new Wolfx.TTS.FujianEEWTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new GeoNetQuakeHistoryTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new GeoNetQuakeTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new GeoNetStrongTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new HKOEarthquakeTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new ICLEEWTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new JMAAtomTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new JMAAtomTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new JMAEEWTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new JMAEEWTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new NingxiaEarthquakeTTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new NOAATTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new NOAATTSMessageGenerator());
|
||||||
worker.RegisterTTSMessageGenerator(new SichuanEEWTTSMessageGenerator());
|
worker.RegisterTTSMessageGenerator(new ShakeAlertEEWTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new FANStudio.TTS.SichuanEEWTTSMessageGenerator());
|
||||||
|
worker.RegisterTTSMessageGenerator(new Wolfx.TTS.SichuanEEWTTSMessageGenerator());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _verified;
|
bool _verified;
|
||||||
void BuildWorkers() {
|
void BuildWorkers() {
|
||||||
|
App.MainLogger.Log(1, "App", null, "Building workers");
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
_worker.AddWorker(new WolfxWorker(new Uri("ws://localhost:9995/wolfx")));
|
_worker.AddWorker(new WolfxWorker(new Uri("ws://localhost:9995/wolfx")));
|
||||||
_worker.AddWorker(new JMAAtomWorker(new Uri("http://localhost:9095/eqvol.xml")));
|
_worker.AddWorker(new JMAAtomWorker(new Uri("http://localhost:9095/eqvol.xml")));
|
||||||
|
_worker.AddWorker(new FANStudioWorker<FANStudio.Model.CEAEEW>(new("ws://localhost:9995/fan/cea")));
|
||||||
_worker.AddWorker(new CWAReportWorker<Tsunami>(new Uri("http://localhost:9095/E-A0014-001.json"), "1"));
|
_worker.AddWorker(new CWAReportWorker<Tsunami>(new Uri("http://localhost:9095/E-A0014-001.json"), "1"));
|
||||||
_worker.AddWorker(new CWAReportWorker<Earthquake>(new Uri("http://localhost:9095/E-A0015-001.json"), "1"));
|
_worker.AddWorker(new CWAReportWorker<Earthquake>(new Uri("http://localhost:9095/E-A0015-001.json"), "1"));
|
||||||
_worker.AddWorker(new CWAReportWorker<Earthquake>(new Uri("http://localhost:9095/E-A0016-001.json"), "1"));
|
_worker.AddWorker(new CWAReportWorker<Earthquake>(new Uri("http://localhost:9095/E-A0016-001.json"), "1"));
|
||||||
@@ -139,25 +185,41 @@ namespace Cryville.EEW.Unity {
|
|||||||
#else
|
#else
|
||||||
foreach (var source in SharedSettings.Instance.EventSources) {
|
foreach (var source in SharedSettings.Instance.EventSources) {
|
||||||
_worker.AddWorker(source switch {
|
_worker.AddWorker(source switch {
|
||||||
BMKGOpenDataEventSourceConfig bmkgOpenData => BuildBMKGOpenDataWorkerUris(new BMKGOpenDataWorker(new("https://data.bmkg.go.id/DataMKG/TEWS/autogempa.json")), bmkgOpenData),
|
BMKGOpenDataEventSourceConfig bmkgOpenData => BuildBMKGOpenDataWorkerUris(new(new("https://data.bmkg.go.id/DataMKG/TEWS/autogempa.json")), bmkgOpenData),
|
||||||
CWAOpenDataEventSourceConfig cwaOpenData => cwaOpenData.Subtype switch {
|
CWAOpenDataEventSourceConfig cwaOpenData => cwaOpenData.Subtype switch {
|
||||||
"E-A0014-001" => new CWAReportWorker<Tsunami>(new Uri("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0014-001"), cwaOpenData.Token, 1440, 17280),
|
"E-A0014-001" => new CWAReportWorker<Tsunami>(new("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0014-001"), cwaOpenData.Token, 1440, 17280),
|
||||||
"E-A0015-001" => new CWAReportWorker<Earthquake>(new Uri("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0015-001"), cwaOpenData.Token),
|
"E-A0015-001" => new CWAReportWorker<Earthquake>(new("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0015-001"), cwaOpenData.Token),
|
||||||
"E-A0016-001" => new CWAReportWorker<Earthquake>(new Uri("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0016-001"), cwaOpenData.Token),
|
"E-A0016-001" => new CWAReportWorker<Earthquake>(new("https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0016-001"), cwaOpenData.Token),
|
||||||
_ => throw new InvalidOperationException("Unknown CWA open data sub-type."),
|
_ => throw new InvalidOperationException("Unknown CWA open data sub-type."),
|
||||||
},
|
},
|
||||||
EMSCRealTimeEventSourceConfig => new EMSCRealTimeWorker(new("wss://www.seismicportal.eu/standing_order/websocket")),
|
EMSCRealTimeEventSourceConfig => new EMSCRealTimeWorker(new("wss://www.seismicportal.eu/standing_order/websocket")),
|
||||||
|
FANStudioEventSourceConfig fanStudio => fanStudio.Subtype switch {
|
||||||
|
"cenc" => new FANStudioWorker<FANStudio.Model.CENCEarthquake>(new("wss://ws.fanstudio.tech/cenc")),
|
||||||
|
"cea" => new FANStudioWorker<FANStudio.Model.CEAEEW>(new("wss://ws.fanstudio.tech/cea")),
|
||||||
|
"sichuan" => new FANStudioWorker<FANStudio.Model.SichuanEEW>(new("wss://ws.fanstudio.tech/sichuan")),
|
||||||
|
"ningxia" => new FANStudioWorker<FANStudio.Model.NingxiaEarthquake>(new("wss://ws.fanstudio.tech/ningxia")),
|
||||||
|
"fujian" => new FANStudioWorker<FANStudio.Model.FujianEEW>(new("wss://ws.fanstudio.tech/fujian")),
|
||||||
|
"beijing" => new FANStudioWorker<FANStudio.Model.BeijingEarthquake>(new("wss://ws.fanstudio.tech/beijing")),
|
||||||
|
"hko" => new FANStudioWorker<FANStudio.Model.HKOEarthquake>(new("wss://ws.fanstudio.tech/hko")),
|
||||||
|
"sa" => new FANStudioWorker<FANStudio.Model.ShakeAlertEEW>(new("wss://ws.fanstudio.tech/hko")),
|
||||||
|
_ => throw new InvalidOperationException("Unknown FAN Studio sub-type."),
|
||||||
|
},
|
||||||
|
FANStudioAllEventSourceConfig fanStudioAll => BuildFANStudioAllWorkerFilter(new FANStudioAllWorker(new("wss://ws.fanstudio.tech/all")), fanStudioAll),
|
||||||
|
GeoNetEventSourceConfig geoNet => BuildGeoNetWorker(new(new("https://api.geonet.org.nz/quake"), new("https://api.geonet.org.nz/quake/history/index"), new("https://api.geonet.org.nz/intensity/strong/processed/index")), geoNet),
|
||||||
GlobalQuakeServer15EventSourceConfig gq => new GlobalQuakeWorker15(gq.Host, gq.Port),
|
GlobalQuakeServer15EventSourceConfig gq => new GlobalQuakeWorker15(gq.Host, gq.Port),
|
||||||
GlobalQuakeServerEventSourceConfig gq => new GlobalQuakeWorker(gq.Host, gq.Port),
|
GlobalQuakeServerEventSourceConfig gq => new GlobalQuakeWorker(gq.Host, gq.Port),
|
||||||
JMAAtomEventSourceConfig jmaAtom => BuildJMAAtomWorkerFilter(new JMAAtomWorker(new("https://www.data.jma.go.jp/developer/xml/feed/eqvol.xml")), jmaAtom),
|
JMAAtomEventSourceConfig jmaAtom => BuildJMAAtomWorkerFilter(new(new("https://www.data.jma.go.jp/developer/xml/feed/eqvol.xml")), jmaAtom),
|
||||||
NOAAEventSourceConfig noaaAtom => noaaAtom.Subtype switch {
|
NOAAEventSourceConfig noaaAtom => noaaAtom.Subtype switch {
|
||||||
"PAAQ" => new NOAAAtomWorker(new("https://www.tsunami.gov/events/xml/PAAQAtom.xml"), new("https://www.tsunami.gov/"), new("/php/esri.php?e=t", UriKind.Relative), "PAAQ"),
|
"PAAQ" => new NOAAAtomWorker(new("https://www.tsunami.gov/events/xml/PAAQAtom.xml"), new("https://www.tsunami.gov/"), new("/php/esri.php?e=t", UriKind.Relative), "PAAQ"),
|
||||||
"PHEB" => new NOAAAtomWorker(new("https://www.tsunami.gov/events/xml/PHEBAtom.xml"), new("https://www.tsunami.gov/"), new("/php/esri.php?e=t", UriKind.Relative), "PHEB"),
|
"PHEB" => new NOAAAtomWorker(new("https://www.tsunami.gov/events/xml/PHEBAtom.xml"), new("https://www.tsunami.gov/"), new("/php/esri.php?e=t", UriKind.Relative), "PHEB"),
|
||||||
_ => throw new InvalidOperationException("Unknown NOAA sub-type."),
|
_ => throw new InvalidOperationException("Unknown NOAA sub-type."),
|
||||||
},
|
},
|
||||||
UpdateCheckerEventSourceConfig => new UpdateCheckerWorker(typeof(Worker).Assembly.GetName().Version?.ToString(3) ?? "", "unity"),
|
UpdateCheckerEventSourceConfig => new UpdateCheckerWorker(typeof(Worker).Assembly.GetName().Version?.ToString(3) ?? "", "unity"),
|
||||||
USGSQuakeMLEventSourceConfig usgsQuakeML => BuildUSGSQuakeMLWorkerUri(new USGSQuakeMLWorker(new Uri("https://earthquake.usgs.gov/earthquakes/feed/v1.0/quakeml.php")), usgsQuakeML),
|
USGSEventSourceConfig usgs => BuildUSGSWorker(usgs.UseGeoJSONFeeds
|
||||||
WolfxEventSourceConfig wolfx => BuildWolfxWorkerFilter(new WolfxWorker(new Uri("wss://ws-api.wolfx.jp/all_eew")), wolfx),
|
? new USGSGeoJSONWorker(new Uri("https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php"))
|
||||||
|
: new USGSQuakeMLWorker(new Uri("https://earthquake.usgs.gov/earthquakes/feed/v1.0/quakeml.php"))
|
||||||
|
, usgs),
|
||||||
|
WolfxEventSourceConfig wolfx => BuildWolfxWorkerFilter(new WolfxWorker(new("wss://ws-api.wolfx.jp/all_eew")), wolfx),
|
||||||
_ => throw new InvalidOperationException("Unknown event source type."),
|
_ => throw new InvalidOperationException("Unknown event source type."),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -170,12 +232,12 @@ namespace Cryville.EEW.Unity {
|
|||||||
}
|
}
|
||||||
WolfxWorker BuildWolfxWorkerFilter(WolfxWorker worker, WolfxEventSourceConfig config) {
|
WolfxWorker BuildWolfxWorkerFilter(WolfxWorker worker, WolfxEventSourceConfig config) {
|
||||||
if (config.Filter != null) worker.SetFilter(config.Filter.Select(i => i switch {
|
if (config.Filter != null) worker.SetFilter(config.Filter.Select(i => i switch {
|
||||||
"cenc_eew" => typeof(CENCEEW),
|
"cenc_eew" => typeof(Wolfx.Model.CENCEEW),
|
||||||
"cenc_eqlist" => typeof(WolfxEarthquakeList<CENCEarthquake>),
|
"cenc_eqlist" => typeof(Wolfx.Model.WolfxEarthquakeList<Wolfx.Model.CENCEarthquake>),
|
||||||
"cwa_eew" => typeof(CWAEEW),
|
"cwa_eew" => typeof(Wolfx.Model.CWAEEW),
|
||||||
"fj_eew" => typeof(FujianEEW),
|
"fj_eew" => typeof(Wolfx.Model.FujianEEW),
|
||||||
"jma_eew" => typeof(JMAEEW),
|
"jma_eew" => typeof(Wolfx.Model.JMAEEW),
|
||||||
"sc_eew" => typeof(SichuanEEW),
|
"sc_eew" => typeof(Wolfx.Model.SichuanEEW),
|
||||||
_ => throw new InvalidOperationException("Unknown Wolfx event type."),
|
_ => throw new InvalidOperationException("Unknown Wolfx event type."),
|
||||||
}));
|
}));
|
||||||
worker.IsFilterWhitelist = config.IsFilterWhitelist;
|
worker.IsFilterWhitelist = config.IsFilterWhitelist;
|
||||||
@@ -186,12 +248,31 @@ namespace Cryville.EEW.Unity {
|
|||||||
|
|
||||||
return worker;
|
return worker;
|
||||||
}
|
}
|
||||||
|
FANStudioAllWorker BuildFANStudioAllWorkerFilter(FANStudioAllWorker worker, FANStudioAllEventSourceConfig config) {
|
||||||
|
if (config.Filter != null) worker.SetFilter(config.Filter);
|
||||||
|
worker.IsFilterWhitelist = config.IsFilterWhitelist;
|
||||||
|
return worker;
|
||||||
|
}
|
||||||
static BMKGOpenDataWorker BuildBMKGOpenDataWorkerUris(BMKGOpenDataWorker worker, BMKGOpenDataEventSourceConfig config) {
|
static BMKGOpenDataWorker BuildBMKGOpenDataWorkerUris(BMKGOpenDataWorker worker, BMKGOpenDataEventSourceConfig config) {
|
||||||
worker.SetDataUris(config.Subtypes.Select(i => new Uri(string.Format(CultureInfo.InvariantCulture, "https://data.bmkg.go.id/DataMKG/TEWS/{0}.json", i))));
|
worker.SetDataUris(config.Subtypes.Select(i => new Uri(string.Format(CultureInfo.InvariantCulture, "https://data.bmkg.go.id/DataMKG/TEWS/{0}.json", i))));
|
||||||
return worker;
|
return worker;
|
||||||
}
|
}
|
||||||
static USGSQuakeMLWorker BuildUSGSQuakeMLWorkerUri(USGSQuakeMLWorker worker, USGSQuakeMLEventSourceConfig config) {
|
static GeoNetWorker BuildGeoNetWorker(GeoNetWorker worker, GeoNetEventSourceConfig pref) {
|
||||||
worker.SetFeedRelativeUri(new(string.Format(CultureInfo.InvariantCulture, "/earthquakes/feed/v1.0/summary/{0}.quakeml", config.Subtype), UriKind.Relative));
|
worker.MinimumMMI = pref.MinimumMMI;
|
||||||
|
worker.DoGetFullHistory = pref.DoGetFullHistory;
|
||||||
|
worker.DoGetStrongMotionInfo = pref.DoGetStrongMotionInfo;
|
||||||
|
return worker;
|
||||||
|
}
|
||||||
|
static USGSWorker BuildUSGSWorker(USGSWorker worker, USGSEventSourceConfig config) {
|
||||||
|
worker.SetFeedRelativeUri(new(string.Format(CultureInfo.InvariantCulture, "/earthquakes/feed/v1.0/summary/{0}{1}", config.Subtype, config.UseGeoJSONFeeds ? ".geojson" : ".quakeml"), UriKind.Relative));
|
||||||
|
if (worker is USGSGeoJSONWorker geojsonWorker) {
|
||||||
|
geojsonWorker.SetFilter(
|
||||||
|
config.Products
|
||||||
|
.Select(i => i.Split('/', 2))
|
||||||
|
.GroupBy(i => i[0])
|
||||||
|
.ToDictionary(g => g.Key, g => g.Select(i => i[1]))
|
||||||
|
);
|
||||||
|
}
|
||||||
return worker;
|
return worker;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +281,7 @@ namespace Cryville.EEW.Unity {
|
|||||||
ReportViewModel _latestHistoryReport;
|
ReportViewModel _latestHistoryReport;
|
||||||
void OnReported(object sender, ReportViewModel e) {
|
void OnReported(object sender, ReportViewModel e) {
|
||||||
if (e.Model is Exception && e.Model is not SourceWorkerNetworkException)
|
if (e.Model is Exception && e.Model is not SourceWorkerNetworkException)
|
||||||
Debug.LogError(e);
|
App.MainLogger.Log(4, "App", null, "Received an error from {0}: {1}", sender.GetType(), e.Model);
|
||||||
_grouper.Report(e);
|
_grouper.Report(e);
|
||||||
_ongoingReportManager.Report(e);
|
_ongoingReportManager.Report(e);
|
||||||
_uiActionQueue.Enqueue(() => {
|
_uiActionQueue.Enqueue(() => {
|
||||||
|
|||||||
2394
Assets/Main.unity
2394
Assets/Main.unity
File diff suppressed because it is too large
Load Diff
91
Assets/Materials/Multiply.mat
Normal file
91
Assets/Materials/Multiply.mat
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 8
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Multiply
|
||||||
|
m_Shader: {fileID: 4800000, guid: 0637d3d4bac33b34ea1fb084d1aa83c5, type: 3}
|
||||||
|
m_Parent: {fileID: 0}
|
||||||
|
m_ModifiedSerializedProperties: 0
|
||||||
|
m_ValidKeywords: []
|
||||||
|
m_InvalidKeywords: []
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_LockedProperties:
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _AlphaTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Ints: []
|
||||||
|
m_Floats:
|
||||||
|
- PixelSnap: 0
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DstBlend: 0
|
||||||
|
- _EnableExternalAlpha: 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: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
- _Flip: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4972abff193472e4bbef2dd0ec07b55e
|
guid: e2b4779e0934e3b45978a57b79d75597
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 0
|
mainObjectFileID: 2100000
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
Binary file not shown.
Binary file not shown.
1315
Assets/Plugins/Cryville.Audio.xml
Normal file
1315
Assets/Plugins/Cryville.Audio.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 2ade62400bece1a4f9093a91ca22b276
|
guid: 0444abb2bb6ae5c44a7f7ee60b312f0d
|
||||||
TextScriptImporter:
|
TextScriptImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
BIN
Assets/Plugins/Cryville.Common.Logging.dll
Normal file
BIN
Assets/Plugins/Cryville.Common.Logging.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Cryville.Common.Logging.dll.meta
Normal file
33
Assets/Plugins/Cryville.Common.Logging.dll.meta
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7aa0c56ccfdaf9443b58f26bf40eed01
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
185
Assets/Plugins/Cryville.Common.Logging.xml
Normal file
185
Assets/Plugins/Cryville.Common.Logging.xml
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<doc>
|
||||||
|
<assembly>
|
||||||
|
<name>Cryville.Common.Logging</name>
|
||||||
|
</assembly>
|
||||||
|
<members>
|
||||||
|
<member name="T:Cryville.Common.Logging.Logger">
|
||||||
|
<summary>
|
||||||
|
A logger.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.AddListener(Cryville.Common.Logging.LoggerListener)">
|
||||||
|
<summary>
|
||||||
|
Attaches a listener to the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="listener">The logger listener.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.RemoveListener(Cryville.Common.Logging.LoggerListener)">
|
||||||
|
<summary>
|
||||||
|
Detaches a listener from the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="listener">The logger listener.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.Log(System.Int32,System.String,System.String,System.Object[])">
|
||||||
|
<summary>
|
||||||
|
Logs to the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="format">The format string.</param>
|
||||||
|
<param name="args">The arguments for formatting.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.Log(System.Int32,System.String,System.IFormatProvider,System.String,System.Object[])">
|
||||||
|
<summary>
|
||||||
|
Logs to the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="provider">The format provider.</param>
|
||||||
|
<param name="format">The format string.</param>
|
||||||
|
<param name="args">The arguments for formatting.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.Log(System.Int32,System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
Logs to the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">The message.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.Log(System.Int32,System.String,System.Char[])">
|
||||||
|
<summary>
|
||||||
|
Logs to the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">An array of <see cref="T:System.Char" /> containing the message.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.Log(System.Int32,System.String,System.Char[],System.Int32,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
Logs to the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">An array of <see cref="T:System.Char" /> containing the message.</param>
|
||||||
|
<param name="index">A zero-based index of the first character of the message within <paramref name="message" />.</param>
|
||||||
|
<param name="length">The length of the message.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.Logger.Log(System.Int32,System.String,System.Char*,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
Logs to the logger.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">A pointer to the first character of the message.</param>
|
||||||
|
<param name="length">The length of the message.</param>
|
||||||
|
</member>
|
||||||
|
<member name="T:Cryville.Common.Logging.LoggerListener">
|
||||||
|
<summary>
|
||||||
|
A logger listener.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.LoggerListener.Dispose(System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Closes the logger listener and cleans up all the resources.
|
||||||
|
</summary>
|
||||||
|
<param name="disposing">Whether to clean up managed resources.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.LoggerListener.Dispose">
|
||||||
|
<summary>
|
||||||
|
Closes the logger listener.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.LoggerListener.OnLog(System.Int32,System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
Handles an incoming log.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">The message.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.LoggerListener.OnLog(System.Int32,System.String,System.Char[],System.Int32,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
Handles an incoming log.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">An array of <see cref="T:System.Char" /> containing the message.</param>
|
||||||
|
<param name="index">A zero-based index of the first character of the message within <paramref name="message" />.</param>
|
||||||
|
<param name="length">The length of the message.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.LoggerListener.OnLog(System.Int32,System.String,System.Char*,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
Handles an incoming log.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">A pointer to the first character of the message.</param>
|
||||||
|
<param name="length">The length of the message.</param>
|
||||||
|
</member>
|
||||||
|
<member name="T:Cryville.Common.Logging.InstantLoggerListener">
|
||||||
|
<summary>
|
||||||
|
A <see cref="T:Cryville.Common.Logging.LoggerListener" /> that calls a callback function on log.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="E:Cryville.Common.Logging.InstantLoggerListener.Log">
|
||||||
|
<summary>
|
||||||
|
Occurs when a log is logged to the logger.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.InstantLoggerListener.OnLog(System.Int32,System.String,System.String)">
|
||||||
|
<inheritdoc />
|
||||||
|
</member>
|
||||||
|
<member name="T:Cryville.Common.Logging.BufferedLoggerListener">
|
||||||
|
<summary>
|
||||||
|
A <see cref="T:Cryville.Common.Logging.LoggerListener" /> that buffers the logs for enumeration.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.BufferedLoggerListener.OnLog(System.Int32,System.String,System.String)">
|
||||||
|
<inheritdoc />
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.BufferedLoggerListener.Enumerate(Cryville.Common.Logging.LogHandler)">
|
||||||
|
<summary>
|
||||||
|
Enumerates the buffered logs.
|
||||||
|
</summary>
|
||||||
|
<param name="callback">The callback function to receive the logs.</param>
|
||||||
|
</member>
|
||||||
|
<member name="T:Cryville.Common.Logging.StreamLoggerListener">
|
||||||
|
<summary>
|
||||||
|
A <see cref="T:Cryville.Common.Logging.LoggerListener" /> that writes logs into a stream.
|
||||||
|
</summary>
|
||||||
|
<param name="stream">The stream.</param>
|
||||||
|
<param name="encoding">The encoding.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.StreamLoggerListener.#ctor(System.IO.Stream,System.Text.Encoding)">
|
||||||
|
<summary>
|
||||||
|
A <see cref="T:Cryville.Common.Logging.LoggerListener" /> that writes logs into a stream.
|
||||||
|
</summary>
|
||||||
|
<param name="stream">The stream.</param>
|
||||||
|
<param name="encoding">The encoding.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.StreamLoggerListener.#ctor(System.IO.Stream)">
|
||||||
|
<summary>
|
||||||
|
Creates an instance of the <see cref="T:Cryville.Common.Logging.StreamLoggerListener" /> class.
|
||||||
|
</summary>
|
||||||
|
<param name="stream">The stream.</param>
|
||||||
|
</member>
|
||||||
|
<member name="P:Cryville.Common.Logging.StreamLoggerListener.AutoFlush">
|
||||||
|
<summary>
|
||||||
|
Whether to flush the stream every time a log is written.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Cryville.Common.Logging.StreamLoggerListener.OnLog(System.Int32,System.String,System.String)">
|
||||||
|
<inheritdoc />
|
||||||
|
</member>
|
||||||
|
<member name="T:Cryville.Common.Logging.LogHandler">
|
||||||
|
<summary>
|
||||||
|
Represents the method that will handle a log.
|
||||||
|
</summary>
|
||||||
|
<param name="level">The severity level.</param>
|
||||||
|
<param name="category">The category.</param>
|
||||||
|
<param name="message">The message.</param>
|
||||||
|
</member>
|
||||||
|
</members>
|
||||||
|
</doc>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 43c7445480589fb4a944cdc658afd52e
|
guid: 72ded0675457e0348809193a9c1092b5
|
||||||
AssemblyDefinitionImporter:
|
TextScriptImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Assets/Plugins/Cryville.EEW.FANStudio.Map.dll
Normal file
BIN
Assets/Plugins/Cryville.EEW.FANStudio.Map.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Cryville.EEW.FANStudio.Map.dll.meta
Normal file
33
Assets/Plugins/Cryville.EEW.FANStudio.Map.dll.meta
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: decba95f87869fa4699fd22f50528285
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/Cryville.EEW.FANStudio.TTS.dll
Normal file
BIN
Assets/Plugins/Cryville.EEW.FANStudio.TTS.dll
Normal file
Binary file not shown.
33
Assets/Plugins/Cryville.EEW.FANStudio.TTS.dll.meta
Normal file
33
Assets/Plugins/Cryville.EEW.FANStudio.TTS.dll.meta
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 50ac3fa1c3c1c7244820383f3c6f2617
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user