Compare commits

..

8 Commits

Author SHA1 Message Date
556fdb6090 Added task stations rendering 2026-04-26 13:12:21 +02:00
43a3434e97 GetSet station patch 2026-04-26 10:12:48 +02:00
48448a9cff Added IInteractable and Stations 2026-04-26 09:36:55 +02:00
b872b52632 Added gps and ITask update 2026-03-28 10:59:01 +01:00
be595da357 Added test mode and manual positioning 2026-03-21 22:40:20 +01:00
a1b40ad102 Added map 2026-03-01 13:26:13 +01:00
7294466604 UI patch 2026-02-21 11:02:26 +01:00
67d3ee76c1 UI update 2026-02-21 10:59:27 +01:00
284 changed files with 7807 additions and 14093 deletions

5
.gitignore vendored
View File

@@ -186,7 +186,6 @@ StyleCopReport.xml
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
@@ -304,10 +303,6 @@ PublishScripts/
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files

File diff suppressed because it is too large Load Diff

View File

@@ -1,90 +0,0 @@
%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: Mask 3 Default UI
m_Shader: {fileID: 4800000, guid: 2fa3c67be732d4f38be87103967c4b10, type: 3}
m_ValidKeywords:
- UNITY_UI_ALPHACLIP
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 1
- _ZWrite: 1
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _ClipRectRadii: {r: 50, g: 20, b: 20, a: 50}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

View File

@@ -1,226 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Rounded Rect Mask 2D</title>
<link href="https://fonts.cdnfonts.com/css/inter" rel="stylesheet">
<style>
* {
/* outline: 1px solid red; */
box-sizing: border-box;
}
/* THESE ENSURE THE WEBVIEW WILL BE OF CORRECT HEIGHT
* =======================================================================
*/
html {
margin: 0px;
padding: 0px;
font-family: 'Inter';
background-color: #F7F5EB;
}
body {
margin: 0px;
padding: 0px;
}
body :first-child {
margin-top: 0px;
}
body :last-child {
margin-bottom: 0px;
}
/* FIXES SCROLLING
* =======================================================================
*/
html,
body {
overflow-x: hidden;
}
/* MAIN STYLING
* =======================================================================
*/
:root {
--default-text-color: #333333;
--muted-text-color: #666666;
--link-color: #f05675;
--muted-border-color: #dddddd;
--muted-background-color: #eeeeee;
--codeblock-background-color: #222222;
--codeblock-text-color: #ffffff;
}
body {
padding: 16px;
line-height: 1.5rem;
color: var(--default-text-color);
word-wrap: break-word;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 2rem;
margin-bottom: 1rem;
}
h1 {
font-size: 1.6rem;
}
h2 {
font-size: 1.45rem;
}
h3 {
font-size: 1.3rem;
}
h4 {
font-size: 1.2rem;
}
h5 {
font-size: 1.1rem;
}
h6 {
font-size: 1.05rem;
}
h1,
h2 {
padding-bottom: 0.4rem;
border-bottom: 1px solid var(--muted-border-color);
}
ul,
ol {
padding-inline-start: 1.8rem;
}
a {
text-decoration-thickness: 1px;
text-underline-offset: 2px;
color: var(--link-color);
}
del {
color: var(--muted-text-color);
}
pre {
padding: 1rem;
border-radius: 4px;
color: var(--codeblock-text-color);
background-color: var(--codeblock-background-color);
overflow-x: auto;
}
:not(pre)>code {
background-color: var(--muted-background-color);
padding: 0.1rem 0.4rem;
border-radius: 3px;
}
blockquote {
margin-inline: 0px;
padding-block: 12px;
padding-left: 16px;
color: var(--muted-text-color);
border-left: 2px solid var(--muted-border-color);
font-style: italic;
}
blockquote :last-child {
margin-bottom: 0px;
}
table {
display: block;
overflow-x: auto;
border-collapse: collapse;
}
th,
td {
padding: 0.6rem 1rem;
}
th,
td {
border: 1px solid var(--muted-border-color)
}
th {
font-size: 1rem;
background-color: var(--muted-background-color);
border-bottom-width: 2px;
}
img {
max-width: 100%;
}
</style>
</head>
<body>
<h1 id="rounded-rect-mask-2d">Rounded Rect Mask 2D</h1>
<p><img src="./Resources/RRM2D_Banner.png" alt="screenshot" /><br />
available on the <a href="https://assetstore.unity.com/packages/slug/326028" rel="noopener noreferrer" target="_blank">Asset Store</a></p>
<h2 id="documentation">Documentation</h2>
<p><img src="./Resources/RRM2D_ScreenshotScene.png" alt="screenshot" /></p>
<h3 id="basics">Basics</h3>
<ul>
<li>All Graphics (<a href="https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/comp-UIVisual.html" rel="noopener noreferrer" target="_blank">Visuals</a> &amp; <a href="https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/comp-UIInteraction.html" rel="noopener noreferrer" target="_blank">Interactions</a>) components child of the Rounded Mask need the <em>Default UI (Rounded Mask)</em> material to work.</li>
<li>All TextMeshPro texts need the <em>TMP SDF-Mobile (Rounded Mask)</em> material inside the TMP_FontAsset that needs to work with the rounded corners. If your text is only clipped on the straight edges of the mask, they don't need to be changed.</li>
<li>You will need one <em>Default UI (Rounded Mask)</em> material per RoundedRectMask2D radius configuration. If you always use the same corners throughout your project, you can use the Material provided in the package. Same for the TMP_FontAssets.</li>
<li>If you have different radii in your project, either <strong>duplicate the materials</strong>, or tick the checkbox <strong>Clone maskable materials on Start</strong> to automatically create new instances of the materials (for both Default UI &amp; TMP_FontAsset's material).</li>
</ul>
<h3 id="limitations">Limitations</h3>
<ul>
<li>As Rounded RectMask2D uses a special UI shader to work, it can only be used with normal UI (ie: Images with no special material). If you have custom UI shaders for your UI you will need to tweak them to support the RoundedRectMask2D component (otherwise the corners will not be correctly clipped).</li>
<li>Moreover, you will need one Material per corners configuration. If you always use the same values, you can use one Material for all of your UI, but otherwise, RoundedRectMask2D can auto instantiate your materials at runtime, allowing you to have any mask values.</li>
<li>Softness doesn't work with RoundedRectMask2D. If you need softness in your mask, you will have to use both RoundedRectMask2D &amp; a regular RectMask2D nested into each other.</li>
</ul>
<h3 id="custom-shaders">Custom Shaders</h3>
<p>If you have custom UI shaders and would like them to work with the RoundedRectMask2D component, you will need to edit them, to support the feature. You can check how it's done in the custom Shaders (UI Default &amp; TMP_SDF Mobile). <br />
Here is what you need to do:</p>
<ol>
<li>Either move your shaders to the AntoineCherel/RoundedRectMask2D/Shaders folder, or copy &amp; paste the <em>RoundedMaskCommon.hlsl</em> library to your custom shader's folder</li>
<li>in the <em>Pass</em>, include the library <br />
<code>#include "RoundedMaskCommon.hlsl"</code></li>
<li>in the Vertex to Fragment or Vertext to Pixel struct, add <br />
<code>float3 posLocal : TEXCOORD8;</code></li>
<li>fill it in the V2F or V2P function <br />
<code>OUT.posLocal = v.vertex.xyz;</code></li>
<li>in the frag or pixel return function, replace the existing clipping method by<br />
<code>clip( RMUnityUIClipRect(IN.posLocal.xy, _ClipRect, _ClipRectRadii) - 0.5);</code><br />
all of these added lines should be encapsulated inside <code>#ifdef UNITY_UI_CLIP_RECT</code> statements.</li>
</ol>
<p>If something goes wrong double check with the implemented shaders inside the Shaders folder.<br />
You can also reach out to me contact (at) antoinecherel.dev</p>
<h2 id="credits">Credits</h2>
<p>Unity Plugin, developped by <a href="https://www.antoinecherel.dev/" target="_blank">Antoine Cherel</a></p>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

View File

@@ -1,124 +0,0 @@
using UnityEditor;
using UnityEditor.UI;
using UnityEngine;
namespace ACRoundedRectMask
{
/// <summary>
/// Custom editor for the RoundedRectMask2D component.
/// </summary>
[CustomEditor(typeof(RoundedRectMask2D), true)]
[CanEditMultipleObjects]
public class RoundedRectMask2DInspector : RectMask2DEditor
{
private static GUIContent radiusContent = new GUIContent("Corner Radius", "Determines the radius of the rect mask's corners.");
private static GUIContent radiiContent = new GUIContent("Corner Radii", "Determines the radius of each corner of the rect mask.");
private static GUIContent topLeftContent = new GUIContent("Top Left", "Local -X, +Y corner.");
private static GUIContent topRightContent = new GUIContent("Top Right", "Local +X, +Y corner.");
private static GUIContent bottomLeftContent = new GUIContent("Bottom Left", "Local -X, -Y corner.");
private static GUIContent bottomRightContent = new GUIContent("Bottom Right", "Local +X, -Y corner.");
private static bool showRadii = false;
private static GUIContent paddingContent = new GUIContent("Padding");
private static GUIContent leftContent = new GUIContent("Left");
private static GUIContent rightContent = new GUIContent("Right");
private static GUIContent topContent = new GUIContent("Top");
private static GUIContent bottomContent = new GUIContent("Bottom");
private static bool showOffsets = false;
private SerializedProperty independentRadii;
private SerializedProperty radii;
private SerializedProperty padding;
private SerializedProperty cloneMaterials;
/// <inheritdoc/>
protected override void OnEnable()
{
independentRadii = serializedObject.FindProperty("independantRadii");
radii = serializedObject.FindProperty("radii");
padding = serializedObject.FindProperty("m_Padding");
cloneMaterials = serializedObject.FindProperty("cloneMaskableMaterialsOnStart");
base.OnEnable();
}
/// <summary>
/// Renders a custom inspector GUI that displays radius options and hides softness properties.
/// </summary>
public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(independentRadii);
if (independentRadii.boolValue)
{
showRadii = EditorGUILayout.Foldout(showRadii, radiiContent, true);
if (showRadii)
{
using (var check = new EditorGUI.ChangeCheckScope())
{
EditorGUI.indentLevel++;
Vector4 newRadii = radii.vector4Value;
newRadii.x = Mathf.Max(0.0f, EditorGUILayout.FloatField(topLeftContent, newRadii.x));
newRadii.y = Mathf.Max(0.0f, EditorGUILayout.FloatField(topRightContent, newRadii.y));
newRadii.z = Mathf.Max(0.0f, EditorGUILayout.FloatField(bottomLeftContent, newRadii.z));
newRadii.w = Mathf.Max(0.0f, EditorGUILayout.FloatField(bottomRightContent, newRadii.w));
if (check.changed)
{
radii.vector4Value = newRadii;
}
EditorGUI.indentLevel--;
}
}
}
else
{
using (var check = new EditorGUI.ChangeCheckScope())
{
float newRadius = radii.vector4Value.x;
newRadius = Mathf.Max(0.0f, EditorGUILayout.FloatField(radiusContent, newRadius));
if (check.changed)
{
Vector4 newRadii = radii.vector4Value;
newRadii = Vector4.one * newRadius;
radii.vector4Value = newRadii;
}
}
}
// Rather than call base.OnInspectorGUI() manually showing padding so that softness can be hidden since it is not supported by rounded rect masks.
showOffsets = EditorGUILayout.Foldout(showOffsets, paddingContent, true);
if (showOffsets)
{
using (var check = new EditorGUI.ChangeCheckScope())
{
EditorGUI.indentLevel++;
Vector4 newPadding = padding.vector4Value;
newPadding.x = EditorGUILayout.FloatField(leftContent, newPadding.x);
newPadding.z = EditorGUILayout.FloatField(rightContent, newPadding.z);
newPadding.w = EditorGUILayout.FloatField(topContent, newPadding.w);
newPadding.y = EditorGUILayout.FloatField(bottomContent, newPadding.y);
if (check.changed)
{
padding.vector4Value = newPadding;
}
EditorGUI.indentLevel--;
}
}
EditorGUILayout.PropertyField(cloneMaterials);
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -1,90 +0,0 @@
%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: Default UI (RoundedMask)
m_Shader: {fileID: 4800000, guid: 2fa3c67be732d4f38be87103967c4b10, type: 3}
m_ValidKeywords:
- UNITY_UI_ALPHACLIP
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 1
- _ZWrite: 1
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _ClipRectRadii: {r: 20, g: 20, b: 20, a: 20}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

File diff suppressed because one or more lines are too long

View File

@@ -1,359 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Reflection;
using TMPro;
#if UNITY_2021_1_OR_NEWER
using UnityEngine.Pool;
#endif
namespace ACRoundedRectMask
{
/// <summary>
/// Overrides the RectMask2D.PerformClipping method to add extra checks before doing exhaustive culling on
/// each maskable target.
/// </summary>
public class RoundedRectMask2D : RectMask2D
{
public static readonly string RadiiPropertyName = "_ClipRectRadii";
[SerializeField]
private bool independantRadii;
[Tooltip("The four corner radii of the rounded rect. (x: top left, y: top right, z: bottom left, w: bottom right)")]
[SerializeField]
private Vector4 radii = Vector4.one * 10.0f;
public Vector4 Radii
{
get => radii;
set
{
radii = value;
MaskUtilities.Notify2DMaskStateChanged(this);
ForceClip = true;
}
}
[Tooltip("If not set to true, you will need to handle that all masked UI elements have their own material instances")]
[SerializeField]
private bool cloneMaskableMaterialsOnStart = true;
private static int clipRectRadiiID = 0;
private HashSet<IClippable> clipTargets = null;
private HashSet<MaskableGraphic> maskableTargets = null;
private int lastclipTargetsCount = 0;
private int lastmaskableTargetsCount = 0;
private bool shouldRecalculateClipRects = false;
private Canvas cachedCanvas = null;
private Vector3[] cachedCorners = new Vector3[4];
private Rect lastClipRectCanvasSpace = new Rect();
private Vector2Int lastSoftness = new Vector2Int();
private List<RectMask2D> clippers = new List<RectMask2D>();
#region MonoBehaviour Implementation
/// <inheritdoc />
protected override void OnEnable()
{
base.OnEnable();
shouldRecalculateClipRects = true;
ForceClip = true;
}
#if UNITY_EDITOR
/// <inheritdoc />
protected override void OnValidate()
{
base.OnValidate();
shouldRecalculateClipRects = true;
ForceClip = true;
}
#endif
/// <inheritdoc />
protected override void OnDidApplyAnimationProperties()
{
base.OnDidApplyAnimationProperties();
shouldRecalculateClipRects = true;
ForceClip = true;
}
#endregion MonoBehaviour Implementation
#region RectMask2D Implementation
/// <inheritdoc />
protected override void OnTransformParentChanged()
{
base.OnTransformParentChanged();
shouldRecalculateClipRects = true;
}
/// <inheritdoc />
protected override void OnCanvasHierarchyChanged()
{
cachedCanvas = null;
base.OnCanvasHierarchyChanged();
shouldRecalculateClipRects = true;
}
protected override void Start()
{
base.Start();
shouldRecalculateClipRects = true;
PerformClipping();
if (cloneMaskableMaterialsOnStart && maskableTargets != null)
{
foreach (MaskableGraphic mg in maskableTargets)
{
if (mg.materialForRendering.Equals(mg.material))
{
Material m = new Material(mg.material);
mg.material = m;
}
else if (mg is TMP_Text tmpText)
{
Material m = new Material(tmpText.fontMaterial);
tmpText.fontMaterial = m;
}
else
{
Debug.Log("[RoundedRectMask2d] Can't clone material for " + mg.name + ". This will result in same rounded corners for all assets sharing its materiel " + mg.materialForRendering);
continue;
}
OnSetClipRect(mg);
}
}
}
/// <summary>
/// Improves the base class method by:
/// - Checks if the canvas renderer has moved before exhaustive culling.
/// - Interleaves UpdateClipSoftness so objects are not iterated over twice.
/// - Adds a OnSetClipRect callback for derived classes to use.
/// </summary>
public override void PerformClipping()
{
// Not calling the base class method intentionally to provide a more optimal version.
//base.PerformClipping();
if (clipRectRadiiID == 0)
{
clipRectRadiiID = Shader.PropertyToID(RadiiPropertyName);
}
Initialize();
if (ReferenceEquals(Canvas, null))
{
return;
}
//TODO See if an IsActive() test would work well here or whether it might cause unexpected side effects (re case 776771)
// if the parents are changed
// or something similar we
// do a recalculate here
if (shouldRecalculateClipRects || ForceClip)
{
MaskUtilities.GetRectMasksForClip(this, clippers);
shouldRecalculateClipRects = false;
}
// get the compound rects from
// the clippers that are valid
bool validRect = true;
Rect clipRect = Clipping.FindCullAndClipWorldRect(clippers, out validRect);
// If the mask is in ScreenSpaceOverlay/Camera render mode, its content is only rendered when its rect
// overlaps that of the root canvas.
RenderMode renderMode = Canvas.rootCanvas.renderMode;
bool maskIsCulled =
(renderMode == RenderMode.ScreenSpaceCamera || renderMode == RenderMode.ScreenSpaceOverlay) &&
!clipRect.Overlaps(RootCanvasRect, true);
if (maskIsCulled)
{
// Children are only displayed when inside the mask. If the mask is culled, then the children
// inside the mask are also culled. In that situation, we pass an invalid rect to allow callees
// to avoid some processing.
clipRect = Rect.zero;
validRect = false;
}
if (clipRect != lastClipRectCanvasSpace || softness != lastSoftness)
{
foreach (IClippable clipTarget in clipTargets)
{
clipTarget.SetClipRect(clipRect, validRect);
clipTarget.SetClipSoftness(softness);
}
foreach (MaskableGraphic maskableTarget in maskableTargets)
{
maskableTarget.SetClipRect(clipRect, validRect);
maskableTarget.SetClipSoftness(softness);
OnSetClipRect(maskableTarget);
maskableTarget.Cull(clipRect, validRect);
}
}
else if (ForceClip)
{
foreach (IClippable clipTarget in clipTargets)
{
clipTarget.SetClipRect(clipRect, validRect);
clipTarget.SetClipSoftness(softness);
}
foreach (MaskableGraphic maskableTarget in maskableTargets)
{
maskableTarget.SetClipRect(clipRect, validRect);
maskableTarget.SetClipSoftness(softness);
OnSetClipRect(maskableTarget);
if (maskableTarget.canvasRenderer.hasMoved)
{
maskableTarget.Cull(clipRect, validRect);
}
}
}
else
{
foreach (MaskableGraphic maskableTarget in maskableTargets)
{
if (!maskableTarget.canvasRenderer.hasMoved)
{
continue;
}
maskableTarget.Cull(clipRect, validRect);
}
}
ForceClip = false;
lastClipRectCanvasSpace = clipRect;
lastSoftness = softness;
}
#endregion RectMask2D Implementation
public bool ForceClip
{
get
{
// This is an imprecise check if a clip or mask target gets added then removed on the same frame.
// But... the alternative is we reflect into m_ForceClip base member which would be a per frame allocation due to it being a value type.
// If this check is return false negatives in your scenario, then set ForceClip to true.
return clipTargets.Count != lastclipTargetsCount ||
maskableTargets.Count != lastmaskableTargetsCount;
}
set
{
if (value == true)
{
lastclipTargetsCount = 0;
lastmaskableTargetsCount = 0;
}
else
{
Initialize();
lastclipTargetsCount = clipTargets.Count;
lastmaskableTargetsCount = maskableTargets.Count;
}
}
}
/// <summary>
/// Callback whenever the clip rect is mutated.
/// </summary>
protected virtual void OnSetClipRect(IClippable clippable)
{
}
/// <summary>
/// Callback whenever the clip rect is mutated.
/// </summary>
protected virtual void OnSetClipRect(MaskableGraphic maskableTarget)
{
Material targetMaterial = maskableTarget.materialForRendering;
if (targetMaterial != null)
{
targetMaterial.SetVector(clipRectRadiiID, Radii);
}
Debug.Log("Setting clip rect for " + maskableTarget.name);
}
private void Initialize()
{
// Check if we have already initialized.
if (clipTargets != null)
{
return;
}
// Many of the properties we need access to for clipping are not exposed. So, we have to do reflection to get access to them.
BindingFlags bindFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
clipTargets = (HashSet<IClippable>)typeof(RectMask2D).GetField("m_ClipTargets", bindFlags).GetValue(this);
maskableTargets = (HashSet<MaskableGraphic>)typeof(RectMask2D).GetField("m_MaskableTargets", bindFlags).GetValue(this);
}
private Canvas Canvas
{
get
{
if (cachedCanvas == null)
{
#if UNITY_2021_1_OR_NEWER
var list = ListPool<Canvas>.Get();
gameObject.GetComponentsInParent(false, list);
if (list.Count > 0)
cachedCanvas = list[list.Count - 1];
else
cachedCanvas = null;
ListPool<Canvas>.Release(list);
#else
var list = gameObject.GetComponentsInParent<Canvas>(false);
if (list.Length > 0)
cachedCanvas = list[list.Length - 1];
else
cachedCanvas = null;
#endif
}
return cachedCanvas;
}
}
private Rect RootCanvasRect
{
get
{
rectTransform.GetWorldCorners(cachedCorners);
if (!ReferenceEquals(Canvas, null))
{
Canvas rootCanvas = Canvas.rootCanvas;
for (int i = 0; i < 4; ++i)
cachedCorners[i] = rootCanvas.transform.InverseTransformPoint(cachedCorners[i]);
}
return new Rect(cachedCorners[0].x, cachedCorners[0].y, cachedCorners[2].x - cachedCorners[0].x, cachedCorners[2].y - cachedCorners[0].y);
}
}
}
}

View File

@@ -1,112 +0,0 @@
#ifndef RM_COMMON
#define RM_COMMON
/// <summary>
/// Constants
/// </summary>
#define RM_PI 3.14159265359
#define RM_DEGREES_TO_RADIANS (RM_PI / 180.0)
#define RM_HALF_MIN 6.103515625e-5 // 2^-14, the same value for 10, 11 and 16-bit: https://www.khronos.org/opengl/wiki/Small_Float_Formats
#define RM_MIN_CORNER_VALUE 1e-3
#define RM_MIN_CORNER_VALUE_RECT 1e-3
/// <summary>
/// SDF methods.
/// </summary>
inline float RMPointVsRoundedBox(in float2 position, in float2 cornerCircleDistance, in float cornerCircleRadius)
{
return length(max(abs(position) - cornerCircleDistance, 0.0)) - cornerCircleRadius;
}
inline float FilterDistance(in float distance)
{
float pixelDistance = distance / fwidth(distance);
#if defined(_INDEPENDENT_CORNERS) || defined(_UI_CLIP_RECT_ROUNDED_INDEPENDENT)
// To avoid artifacts at discontinuities in the SDF distance increase the pixel width.
return saturate(1.0 - pixelDistance);
#else
return saturate(0.5 - pixelDistance);
#endif
}
inline float RMRoundCornersSmooth(in float2 position, in float2 cornerCircleDistance, in float cornerCircleRadius, in float smoothingValue)
{
float distance = RMPointVsRoundedBox(position, cornerCircleDistance, cornerCircleRadius);
#if defined(_EDGE_SMOOTHING_AUTOMATIC)
return FilterDistance(distance);
#else
return smoothstep(1.0, 0.0, distance / smoothingValue);
#endif
}
inline float RMRoundCorners(in float2 position, in float2 cornerCircleDistance, in float cornerCircleRadius, in float smoothingValue)
{
#if defined(_TRANSPARENT)
return RMRoundCornersSmooth(position, cornerCircleDistance, cornerCircleRadius, smoothingValue);
#else
return (RMPointVsRoundedBox(position, cornerCircleDistance, cornerCircleRadius) < 0.0);
#endif
}
inline float RMFindCornerRadius(in float2 uv, in float4 radii)
{
if (uv.x < 0.5)
{
if (uv.y > 0.5) { return radii.x; } // Top left.
else { return radii.z; } // Bottom left.
}
else
{
if (uv.y > 0.5) { return radii.y; } // Top right.
else { return radii.w; } // Bottom right.
}
}
/// <summary>
/// UnityUI methods.
/// </summary>
inline float RMGet2DClippingRounded(in float2 position, in float4 clipRect, in float radius)
{
float2 halfSize = (clipRect.zw - clipRect.xy) * 0.5;
float2 center = clipRect.xy + halfSize;
float2 offset = position - center;
return RMPointVsRoundedBox(offset, halfSize - radius, radius);
}
inline float RMGet2DClippingRoundedSoft(in float2 position, in float4 clipRect, in float radius)
{
return saturate(FilterDistance(RMGet2DClippingRounded(position, clipRect, radius)));
}
inline float RMGet2DClippingRoundedIndependent(in float2 position, in float4 clipRect, in float4 radii)
{
float2 halfSize = (clipRect.zw - clipRect.xy) * 0.5;
float2 center = clipRect.xy + halfSize;
float2 offset = position - center;
float radius = RMFindCornerRadius(offset, radii);
return RMPointVsRoundedBox(offset, halfSize - radius, radius);
}
inline float RMGet2DClippingRoundedIndependentSoft(in float2 position, in float4 clipRect, in float4 radii)
{
return saturate(FilterDistance(RMGet2DClippingRoundedIndependent(position, clipRect, radii)));
}
inline float RMUnityUIClipRect(in float2 position, in float4 clipRect, in float4 radii)
{
radii = max(radii, RM_MIN_CORNER_VALUE_RECT);
#if defined(UNITY_UI_ALPHACLIP)
return RMGet2DClippingRoundedIndependent(position, clipRect, radii) <= 0.0;
#else
return RMGet2DClippingRoundedIndependentSoft(position, clipRect, radii);
#endif
}
#endif // RM_COMMON

View File

@@ -1,126 +0,0 @@
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "RoundedMask/UI/Default (RoundedMask)"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
[HideInInspector] _ClipRect("Clip Rect", Vector) = (-32767.0, -32767.0, 32767.0, 32767.0)
[HideInInspector] _ClipRectRadii("Clip Rect Radii", Vector) = (10.0, 10.0, 10.0, 10.0)
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
Name "Default"
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "RoundedMaskCommon.hlsl"
#pragma multi_compile_local _ UNITY_UI_CLIP_RECT
#pragma multi_compile_local _ UNITY_UI_ALPHACLIP
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
#ifdef UNITY_UI_CLIP_RECT
float3 posLocal : TEXCOORD8;
#endif
UNITY_VERTEX_OUTPUT_STEREO
};
sampler2D _MainTex;
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
float4 _ClipRectRadii;
float4 _MainTex_ST;
v2f vert(appdata_t v)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = v.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
#ifdef UNITY_UI_CLIP_RECT
OUT.posLocal = v.vertex.xyz;
#endif
OUT.color = v.color * _Color;
return OUT;
}
fixed4 frag(v2f IN) : SV_Target
{
#ifdef UNITY_UI_CLIP_RECT
clip( RMUnityUIClipRect(IN.posLocal.xy, _ClipRect, _ClipRectRadii) - 0.5);
#endif
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}

View File

@@ -1,249 +0,0 @@
// Simplified SDF shader:
// - No Shading Option (bevel / bump / env map)
// - No Glow Option
// - Softness is applied on both side of the outline
Shader "RoundedMask/TextMeshPro/Mobile/Distance Field (RoundedMask)" {
Properties {
[HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
[HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
[HDR]_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = .5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5
_ScaleX ("Scale X", float) = 1
_ScaleY ("Scale Y", float) = 1
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_Sharpness ("Sharpness", Range(-1,1)) = 0
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[HideInInspector]
_ClipRectRadii ("Clip Rect Radii", vector) = (10.0, 10.0, 10.0, 10.0)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_CullMode ("Cull Mode", Float) = 0
_ColorMask ("Color Mask", Float) = 15
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex VertShader
#pragma fragment PixShader
#pragma shader_feature __ OUTLINE_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "RoundedMaskCommon.hlsl"
#include "Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc"
struct vertex_t {
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 vertex : POSITION;
float3 normal : NORMAL;
fixed4 color : COLOR;
float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1;
};
struct pixel_t {
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
float4 vertex : SV_POSITION;
fixed4 faceColor : COLOR;
fixed4 outlineColor : COLOR1;
float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV
half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w)
half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw)
#if (UNDERLAY_ON | UNDERLAY_INNER)
float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved
half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y)
#endif
#ifdef UNITY_UI_CLIP_RECT
float3 posLocal : TEXCOORD8;
#endif
};
float4 _ClipRectRadii;
pixel_t VertShader(vertex_t input)
{
pixel_t output;
UNITY_INITIALIZE_OUTPUT(pixel_t, output);
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float bold = step(input.texcoord1.y, 0);
float4 vert = input.vertex;
vert.x += _VertexOffsetX;
vert.y += _VertexOffsetY;
float4 vPosition = UnityObjectToClipPos(vert);
float2 pixelSize = vPosition.w;
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord1.y) * _GradientScale * (_Sharpness + 1);
if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5;
float layerScale = scale;
scale /= 1 + (_OutlineSoftness * _ScaleRatioA * scale);
float bias = (0.5 - weight) * scale - 0.5;
float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale;
float opacity = input.color.a;
#if (UNDERLAY_ON | UNDERLAY_INNER)
opacity = 1.0;
#endif
fixed4 faceColor = fixed4(input.color.rgb, opacity) * _FaceColor;
faceColor.rgb *= faceColor.a;
fixed4 outlineColor = _OutlineColor;
outlineColor.a *= opacity;
outlineColor.rgb *= outlineColor.a;
outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2))));
#if (UNDERLAY_ON | UNDERLAY_INNER)
layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale);
float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale);
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 layerOffset = float2(x, y);
#endif
// Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
// Populate structure for pixel shader
output.vertex = vPosition;
output.faceColor = faceColor;
output.outlineColor = outlineColor;
output.texcoord0 = float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y);
output.param = half4(scale, bias - outline, bias + outline, bias);
output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
#if (UNDERLAY_ON || UNDERLAY_INNER)
output.texcoord1 = float4(input.texcoord0 + layerOffset, input.color.a, 0);
output.underlayParam = half2(layerScale, layerBias);
#endif
#ifdef UNITY_UI_CLIP_RECT
output.posLocal = vert.xyz;
#endif
return output;
}
// PIXEL SHADER
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x;
half4 c = input.faceColor * saturate(d - input.param.w);
#ifdef OUTLINE_ON
c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z));
c *= saturate(d - input.param.y);
#endif
#if UNDERLAY_ON
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a);
#endif
#if UNDERLAY_INNER
half sd = saturate(d - input.param.z);
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a);
#endif
// Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT
clip( RMUnityUIClipRect(input.posLocal.xy, _ClipRect, _ClipRectRadii) - 0.5);
#endif
#if (UNDERLAY_ON | UNDERLAY_INNER)
c *= input.texcoord1.z;
#endif
#if UNITY_UI_ALPHACLIP
clip(c.a - 0.001);
#endif
return c;
}
ENDCG
}
}
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
}

8
Assets/ClientSDK.meta Normal file
View File

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

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bc06bb57786c7e142b06ec231e5cf709

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1d2251b279edb0147bd274a884ac878b

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 91e0f647c37b0b94b83f53bb854db28c

View File

@@ -9,38 +9,39 @@ namespace GeoSus.Client
{
#region Základní typy
public struct Position
{
[JsonProperty("lat")]
public double Lat { get; set; }
[JsonProperty("lon")]
public double Lon { get; set; }
public Position(double lat, double lon)
public struct Position
{
Lat = lat;
Lon = lon;
[JsonProperty("lat")]
public double Lat { get; set; }
[JsonProperty("lon")]
public double Lon { get; set; }
public Position(double lat, double lon)
{
Lat = lat;
Lon = lon;
}
// Haversine vzdálenost v metrech
public double DistanceTo(Position other)
{
const double R = 6371000;
var lat1 = Lat * Math.PI / 180;
var lat2 = other.Lat * Math.PI / 180;
var dLat = (other.Lat - Lat) * Math.PI / 180;
var dLon = (other.Lon - Lon) * Math.PI / 180;
var a = Math.Sin(dLat / 2) * Math.Sin(dLat / 2) +
Math.Cos(lat1) * Math.Cos(lat2) *
Math.Sin(dLon / 2) * Math.Sin(dLon / 2);
var c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
return R * c;
}
public static bool operator ==(Position left, Position right) { if (left.Lat == right.Lat && left.Lon == right.Lon) { return true; } else { return false; } }
public static bool operator !=(Position left, Position right) { return !(left == right); }
}
// Haversine vzdálenost v metrech
public double DistanceTo(Position other)
{
const double R = 6371000;
var lat1 = Lat * Math.PI / 180;
var lat2 = other.Lat * Math.PI / 180;
var dLat = (other.Lat - Lat) * Math.PI / 180;
var dLon = (other.Lon - Lon) * Math.PI / 180;
var a = Math.Sin(dLat / 2) * Math.Sin(dLat / 2) +
Math.Cos(lat1) * Math.Cos(lat2) *
Math.Sin(dLon / 2) * Math.Sin(dLon / 2);
var c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
return R * c;
}
}
[JsonConverter(typeof(StringEnumConverter))]
public enum PlayerRole { Crew, Impostor }

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 14463228dfea2264ebfc36c3a7dc4b99

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 80ef0979df5d1fe489225f3e5edadc5c

View File

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

View File

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

8
Assets/GameManager.meta Normal file
View File

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

View File

@@ -7,8 +7,8 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Material
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Name: AreaMat
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
@@ -23,6 +23,10 @@ Material:
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}
@@ -61,14 +65,16 @@ Material:
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.658
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
@@ -78,7 +84,9 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.86666673, g: 0.10588236, b: 0.9607844, a: 1}
- _Color: {r: 0.0813297, g: 1, b: 0, 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: []
m_AllowLocking: 1

View File

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

View File

@@ -1,11 +1,10 @@
using UnityEngine;
using GeoSus.Client;
using Subsystems;
using System.Threading;
using System.Threading.Tasks;
using System.Collections;
using System.Collections.Generic;
using System;
using TMPro;
using System.Collections.Generic;
/*
GameManager - hlavní tøida pro správu hry
GameManager_Network - subsystém pro správu komunikace se serverem
@@ -20,26 +19,65 @@ public class GameManager : MonoBehaviour
[Header("Subsystems")]
protected GameManager_Network networkSubsystem;
protected GameManager_UI uiSubsystem;
protected GameManager_Map mapSubsystem;
protected GameManager_Input inputSubsystem;
protected GameManager_Game gameSubsystem;
protected GameClient gameClient;
[Header("Player Info")]
public string displayName;
[Header("UI Elements")]
public Canvas JoinCreateLobby;
public Canvas InLobby;
public Canvas LoadingScreen;
public Canvas GameScreen;
[Header("Map")]
public GameObject MapCenterPoint;
public BuildingSettings buildingSettings;
public PathwaySettings pathwaySettings;
public AreaSettings areaSettings;
[Header("GPS")]
public GameObject Player;
[Header("Debug")]
public bool testMode = false;
private GameClient _secondClient;
private GameClient _thirdClient;
private GameManager_Network _secondNetwork;
private GameManager_Network _thirdNetwork;
[Header("Tasks")]
public List<TaskData> AvailableTasks = new List<TaskData>();
public StationSettings settings = new StationSettings();
void Start()
{
DontDestroyOnLoad(this);
if (displayName == null || displayName == "")
{
displayName = "Player_" + Random.Range(1000, 9999).ToString();
displayName = GenerateUsername();
}
gameClient = new GameClient(GenerateUUID(), /*displayName*/ GenerateUsername());
uiSubsystem = new GameManager_UI(gameClient, JoinCreateLobby, InLobby);
if (testMode)
{
_secondClient = new GameClient(GenerateUUID(), GenerateUsername());
_secondNetwork = new GameManager_Network(_secondClient);
_thirdClient = new GameClient(GenerateUUID(), GenerateUsername());
_thirdNetwork = new GameManager_Network(_thirdClient);
_secondNetwork.OpenConection();
_thirdNetwork.OpenConection();
}
gameClient = new GameClient(GenerateUUID(), displayName);
uiSubsystem = new GameManager_UI(gameClient, JoinCreateLobby, InLobby, LoadingScreen, GameScreen);
networkSubsystem = new GameManager_Network(gameClient);
mapSubsystem = new GameManager_Map(gameClient, MapCenterPoint, buildingSettings, pathwaySettings, areaSettings);
inputSubsystem = new GameManager_Input(gameClient, Player, testMode);
gameSubsystem = new GameManager_Game(gameClient, Player, MapCenterPoint, AvailableTasks);
networkSubsystem.OpenConection();
}
private void Update()
@@ -47,8 +85,17 @@ public class GameManager : MonoBehaviour
if (gameClient.CurrentLobbyState != null)
{
uiSubsystem.UpdateLobbyUI();
}
try
{
if (gameClient.CurrentLobbyState.MapDataReady)
{
mapSubsystem.BuildMap();
gameClient.CurrentLobbyState.MapDataReady = false;
}
}
catch (NullReferenceException ex) { }
inputSubsystem.positionCheck();
}
@@ -60,13 +107,17 @@ public class GameManager : MonoBehaviour
}
protected string GenerateUsername()
{
string Username = Random.Range(0,10).ToString() + Random.Range(0, 10).ToString() + Random.Range(0, 10).ToString() + Random.Range(0, 10).ToString();
string Username = UnityEngine.Random.Range(0,10).ToString() + UnityEngine.Random.Range(0, 10).ToString() + UnityEngine.Random.Range(0, 10).ToString() + UnityEngine.Random.Range(0, 10).ToString();
Debug.Log(Username);
return Username;
}
public void CreateLobbyButton()
{
networkSubsystem.CrateLobby(50.0755, 14.4378);
networkSubsystem.CrateLobby(50.7727264, 15.0719876);
if (testMode)
{
StartCoroutine(ConnectTestClients());
}
}
public void JoinLobbyButton()
{
@@ -84,8 +135,24 @@ public class GameManager : MonoBehaviour
{
networkSubsystem.LeaveLobby();
}
public void StartGameButton()
{
networkSubsystem.StartGame();
}
public void Interact()
{
//TODO: Interakce s úkoly
}
void OnApplicationQuit()
{
gameClient.Disconnect();
_secondClient?.Disconnect();
_thirdClient?.Disconnect();
}
IEnumerator ConnectTestClients()
{
yield return new WaitForSeconds(2f);
_secondNetwork.JoinLobby(gameClient.CurrentLobbyState.JoinCode);
_thirdNetwork.JoinLobby(gameClient.CurrentLobbyState.JoinCode);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9e2c3e4ba4e36ea40a686e58feca4d2b

View File

@@ -0,0 +1,141 @@
using GeoSus.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UnityEngine;
using static UnityEngine.Rendering.RayTracingAccelerationStructure;
namespace Subsystems
{
[System.Serializable]
public class StationSettings
{
public GameObject TaskStationPrefab;
public GameObject SabotageStationPrefab;
public GameObject MeetingStationPrefab;
public GameObject BodyStationPrefab;
}
public class GameManager_Game
{
private GameClient _gameClient;
private GameObject _player;
private GameObject _map;
private float _range;
private List<TaskData> _availableTasks;
public List<GameObject> Stations { get; private set; }
public List<GameObject> TaskStations { get; private set; } = new List<GameObject>();
private StationSettings _stationSettings;
public GameManager_Game(GameClient client, GameObject player, GameObject map, List<TaskData> availableTasks, float range = 20f, StationSettings stationSettings = null)
{
_gameClient = client;
_player = player;
_map = map;
_availableTasks = availableTasks;
_range = range;
_stationSettings = stationSettings;
}
public bool CheckSightLine(Vector3 target)
{
RaycastHit hit;
Vector3 direction = target - _player.transform.position;
Ray ray = new Ray(new Vector3(_player.transform.position.x, 0.1f, _player.transform.position.z), direction);
Physics.Raycast(ray, out hit, _range);
if (hit.collider.tag == "Player")
{
Debug.Log("Target is visible");
return true;
}
else
{
Debug.Log("Target is not visible");
return false;
}
}
public void InitializeTaskStations()
{
for(int i = 0; i < _gameClient.MyTasks.Count; i++)
{
System.Random rnd = new System.Random();
var task = _availableTasks[rnd.Next(0,_availableTasks.Count)];
CreateStation(_gameClient.MyTasks[i].Location, StationType.Task, _gameClient.MyTasks[i]);
}
}
private void CreateStation(Position pos, StationType type)
{
GameObject stationPrefab = null;
PlayerRole? reqRole = null;
switch (type)
{
case StationType.Task:
stationPrefab = _stationSettings.TaskStationPrefab;
reqRole = PlayerRole.Crew;
Debug.LogError("Task station creation not fully implemented, using task station prefab as placeholder");
break;
case StationType.Sabotage:
stationPrefab = _stationSettings.SabotageStationPrefab;
break;
case StationType.Meeting:
stationPrefab = _stationSettings.MeetingStationPrefab;
break;
case StationType.Body:
stationPrefab = _stationSettings.BodyStationPrefab;
break;
default:
Debug.LogError("Invalid station type");
break;
}
var station = UnityEngine.Object.Instantiate(stationPrefab);
station.transform.position = pos.ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center);
Stations.Add(station);
IInteractable interactable = station.GetComponent<IInteractable>();
interactable.Location = pos;
interactable.InteractionRange = _range;
/*Stations = new List<GameObject>();
foreach (var task in _gameClient.MyTasks)
{
System.Random rnd = new System.Random();
int index = rnd.Next(0, _availableTasks.Count);
var station = UnityEngine.Object.Instantiate(_stationPrefab);
ITask TaskSettings = station.GetComponent<ITask>();
TaskSettings.TaskID = task.TaskId;
TaskSettings.TaskLocation = task.Location;
station.transform.position = TaskSettings.TaskLocation.ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center);
station.SetActive(false);
Stations.Add(station);
}*/
}
private void CreateStation(Position pos, StationType type, GameTask taskInfo)
{
GameObject stationPrefab = _stationSettings.TaskStationPrefab;
var station = UnityEngine.Object.Instantiate(stationPrefab);
station.transform.position = pos.ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center);
Stations.Add(station);
TaskStation interactable = station.GetComponent<TaskStation>();
interactable.Location = pos;
interactable.InteractionRange = _range;
interactable.TaskID = taskInfo.TaskId;
}
void CheckForPlayers()
{
foreach (var player in _gameClient.PlayerPositions.Where(p => p.Value.State == PlayerState.Alive))
{
if (CheckSightLine(player.Value.Position.ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center)))
{
Debug.Log($"Player {player.Key} is visible");
//TODO: Render player on map
}
else
{
Debug.Log($"Player {player.Key} is not visible");
}
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: aba57c59fb2a19141a4868fa6a5c924c

View File

@@ -0,0 +1,254 @@
using UnityEngine;
using GeoSus.Client;
using System;
using System.Collections;
namespace Subsystems
{
internal class CoroutineHost : MonoBehaviour
{
public CoroutineHost() { }
}
internal enum GPSState
{
Uninitialized,
Initializing,
Running,
Failed
}
public static class PositonExtensions
{
public static Position ToLocal(this Position position, Position center)
{
double latDiff = position.Lat - center.Lat;
double lonDiff = position.Lon - center.Lon;
double metersPerDegreeLat = 111320.0;
double metersPerDegreeLon = 111320.0 * Math.Cos(center.Lat * Math.PI / 180.0);
float x = (float)(lonDiff * metersPerDegreeLon);
float z = (float)(latDiff * metersPerDegreeLat);
return new Position(z, x);
}
public static Vector3 ToLocalVector3(this Position position, Position center)
{
return position.ToLocal(center).ToVector3(); //TODO: Implementace v subsystemech
}
public static Vector3 ToVector3(this Position position)
{
return new Vector3((float)position.Lon, 0, (float)position.Lat); //TODO: Implementace v subsystemech
}
public static double DistanceTo(this Vector3 pos, Vector3 other)
{
return Math.Sqrt((other.x - pos.x) * (other.x - pos.x) + (other.z - pos.z) * (other.z - pos.z));
}
}
public class GameManager_Input
{
private GameClient _gameClient;
private Position _currentPosition;
private Position _lastSentPosition;
private GameObject _player;
private bool _testMode;
private GPSState _GPSState = GPSState.Uninitialized;
private float _speed = 0.00001f;
private Position _mapCenter;
private CoroutineHost _coroutineHost = new CoroutineHost();
public GameManager_Input(GameClient gameClient, GameObject player, bool testMode)
{
_gameClient = gameClient;
_player = player;
_testMode = testMode;
}
public void positionCheck()
{
try
{
if (_gameClient.CurrentLobbyState.Phase == GamePhase.Playing)
{
if (_testMode)
{
if (_currentPosition == null || _currentPosition == new Position(0, 0))
{
//Init blok
_currentPosition = _gameClient.CurrentLobbyState.MapData.Center;
_mapCenter = _gameClient.CurrentLobbyState.MapData.Center;
_lastSentPosition = _currentPosition;
}
TestPlayerPosition();
}
else
{
if (_GPSState == GPSState.Uninitialized)
{
_coroutineHost.StartCoroutine(InitiallizeGPS());
return;
}
else if (_GPSState == GPSState.Initializing)
{
return;
}
else if (_GPSState == GPSState.Running)
{
try
{
if (_currentPosition != _lastSentPosition)
{
_gameClient.UpdatePosition(_currentPosition);
_lastSentPosition = _currentPosition;
_player.transform.position = _currentPosition.ToLocalVector3(_mapCenter);
_player.transform.rotation = Quaternion.Euler(0, (float)CalculateHeading(_lastSentPosition.ToLocalVector3(_mapCenter), _currentPosition.ToLocalVector3(_mapCenter)), 0);
}
}
catch (Exception ex)
{
Debug.Log(ex);
}
}
else
{
Debug.Log("GPS failed, trying again...");
_GPSState = GPSState.Uninitialized;
}
}
}
}
catch (NullReferenceException ex) { Debug.Log(ex); }
}
private void TestPlayerPosition()
{
double x = Input.GetAxis("Horizontal");
double y = Input.GetAxis("Vertical");
Debug.Log($"Input: {x}, {y}");
_currentPosition = new Position( _lastSentPosition.Lat + y * _speed, _lastSentPosition.Lon + x * _speed);
Debug.Log($"Current Position: {_currentPosition.Lat}, {_currentPosition.Lon}");
var localCurrent = _currentPosition.ToLocalVector3(_mapCenter);
Debug.Log($"Local Current Position: {localCurrent}");
var heading = CalculateHeading(_lastSentPosition.ToLocalVector3(_mapCenter), localCurrent);
if (heading != null)
{
Debug.Log($"Heading: {heading}");
_player.transform.rotation = Quaternion.Euler(0, (float)heading, 0);
}
_player.transform.position = localCurrent;
try
{
if (_currentPosition != _lastSentPosition)
{
_gameClient.UpdatePosition(_currentPosition);
_lastSentPosition = _currentPosition;
}
}
catch
{
_gameClient.UpdatePosition(_currentPosition);
_lastSentPosition = _currentPosition;
}
}
private double? CalculateHeading(Vector3 first, Vector3 second)
{
double? heading = null;
if ((first - second).magnitude == 0)
{
return null;
}
else if (first.x == second.x && first.z < second.z)
{
return 0;
}
else if (first.x == second.x && first.z > second.z)
{
return 180;
}
else if (first.x > second.x && first.z == second.z)
{
return 270;
}
else if (first.x < second.x && first.z == second.z)
{
return 90;
}
else if (first.x < second.x && first.z < second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI;
}
else if (first.x < second.x && first.z > second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI + 180;
}
else if (first.x > second.x && first.z < second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI - 90;
}
else if (first.x > second.x && first.z > second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI - 90;
}
else
{
return heading;
}
}
IEnumerator InitiallizeGPS()
{
_GPSState = GPSState.Initializing;
if (!Input.location.isEnabledByUser)
{
Debug.LogError("Location not enabled on device or app does not have permission to access location");
}
// Starts the location service.
float desiredAccuracyInMeters = 10f;
float updateDistanceInMeters = 10f;
Input.location.Start(desiredAccuracyInMeters, updateDistanceInMeters);
// Waits until the location service initializes
int maxWait = 20;
while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0)
{
yield return new WaitForSeconds(1);
maxWait--;
}
// If the service didn't initialize in 20 seconds this cancels location service use.
if (maxWait < 1)
{
_GPSState = GPSState.Failed;
Debug.LogError("Timed out");
yield break;
}
_GPSState = GPSState.Running;
yield return _coroutineHost.StartCoroutine(GPSService());
}
IEnumerator GPSService()
{
// Check if the user has location service enabled.
// If the connection failed this cancels location service use.
if (Input.location.status == LocationServiceStatus.Failed)
{
Debug.LogError("Unable to determine device location");
yield break;
}
else
{
// If the connection succeeded, this retrieves the device's current location and displays it in the Console window.
_currentPosition = new Position(Input.location.lastData.latitude, Input.location.lastData.longitude);
Debug.Log("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " + Input.location.lastData.altitude + " " + Input.location.lastData.horizontalAccuracy + " " + Input.location.lastData.timestamp);
yield return new WaitForSeconds(5f);
}
// Stops the location service if there is no need to query location updates continuously.
yield return _coroutineHost.StartCoroutine(GPSService());
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2ef1abfb1e85a7943925f9dc3cfea742

View File

@@ -0,0 +1,381 @@
using GeoSus.Client;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor;
using UnityEngine;
using UnityEngine.Localization.Pseudo;
using UnityEngine.UI;
namespace Subsystems{
[System.Serializable]
public class BuildingSettings
{
public Material ResidentalBuildingsMat;
public float ResidentalBuildingHeight;
public Material CommercialBuildingsMat;
public float CommercialBuildingHeight;
public Material IndustrialBuildingsMat;
public float IndustrialBuildingHeight;
public Material DefaultBuildingMat;
public float DefaultBuildingHeight;
}
[System.Serializable]
public class PathwaySettings
{
public Material FootwayMat;
public float FootwayWidth;
public Material PathMat;
public float PathWidth;
public Material StepsMat;
public float StepsWidth;
public Material CyclewayMat;
public float CyclewayWidth;
public Material PedestrianMat;
public float PedestrianWidth;
public Material RoadMat;
public float RoadWidth;
public Material ServiceMat;
public float ServiceWidth;
public Material ResidentialMat;
public float ResidentialWidth;
public Material TrackMat;
public float TrackWidth;
public Material DefaultMat;
public float DefaultWidth;
}
[System.Serializable]
public class AreaSettings
{
public Material ParkMat;
public Material GardenMat;
public Material PlaygroundMat;
public Material ForestMat;
public Material GrassMat;
public Material WaterMat;
public Material DefaultMat;
}
public class GameManager_Map
{
private GameClient _gameClient;
private GameObject _mapCenterPoint;
private Position _centerPosition;
private BuildingSettings _buildingSettings;
private PathwaySettings _pathwaySettings;
private AreaSettings _areaSettings;
private const float _metersPerUnit = 1f;
public GameManager_Map(GameClient gameClient, GameObject mapCenterPoint, BuildingSettings buildingSettings, PathwaySettings pathwaySettings, AreaSettings areaSettings)
{
_gameClient = gameClient;
_mapCenterPoint = mapCenterPoint;
_buildingSettings = buildingSettings;
_pathwaySettings = pathwaySettings;
_areaSettings = areaSettings;
}
public void BuildMap()
{
ClearChildren();
_centerPosition = _gameClient.CurrentLobbyState.MapData.Center;
GameObject buildingsRoot = new GameObject("Buildings");
buildingsRoot.transform.parent = _mapCenterPoint.transform;
GameObject pathRoot = new GameObject("Pathways");
pathRoot.transform.parent = _mapCenterPoint.transform;
GameObject areaRoot = new GameObject("Areas");
areaRoot.transform.parent = _mapCenterPoint.transform;
foreach (var building in _gameClient.CurrentLobbyState.MapData.GetBuildings())
{
string buildingType = "Unknown";
try
{
buildingType = _gameClient.CurrentLobbyState.MapData.BuildingTypes[_gameClient.CurrentLobbyState.MapData.GetBuildings().IndexOf(building)];
}
catch (Exception ex) { Debug.Log($"Error: {ex.Message}"); }
building.Name = buildingType;
GameObject b = BuildBuildingMesh(building);
b.transform.parent = buildingsRoot.transform;
}
foreach (var path in _gameClient.CurrentLobbyState.MapData.GetPathways())
{
GameObject p = BuildPathwayMesh(path);
p.transform.parent = pathRoot.transform;
}
foreach (var area in _gameClient.CurrentLobbyState.MapData.GetAreas())
{
GameObject a = BuildAreaMesh(area);
a.transform.parent = areaRoot.transform;
}
//TODO: POIs
}
void ClearChildren()
{
List<GameObject> toDestroy = new List<GameObject>();
foreach (Transform t in _mapCenterPoint.transform)
toDestroy.Add(t.gameObject);
foreach (var g in toDestroy)
{
UnityEngine.Object.DestroyImmediate(g);
}
}
#region Mesh Building
GameObject BuildBuildingMesh(MapBuilding b)
{
var building = new GameObject($"Building_{b.Name ?? "Unknown"}");
// Výpočet středu budovy
Vector3 center = CalculatePolygonCenter(b.Outline);
building.transform.position = center;
// Vytvoření mesh pro budovu
MeshFilter meshFilter = building.AddComponent<MeshFilter>();
MeshRenderer meshRenderer = building.AddComponent<MeshRenderer>();
MeshCollider meshCollider = building.AddComponent<MeshCollider>();
building.tag = "Map";
float height;
Material mat;
switch (b.BuildingType.ToLower())
{
case "residential":
mat = _buildingSettings.ResidentalBuildingsMat;
height = _buildingSettings.ResidentalBuildingHeight;
break;
case "commercial":
mat = _buildingSettings.CommercialBuildingsMat;
height = _buildingSettings.CommercialBuildingHeight;
break;
case "industrial":
mat = _buildingSettings.IndustrialBuildingsMat;
height = _buildingSettings.IndustrialBuildingHeight;
break;
default:
mat = _buildingSettings.DefaultBuildingMat;
height = _buildingSettings.DefaultBuildingHeight;
break;
}
Mesh mesh = CreateExtrudedPolygonMesh(b.Outline, height);
meshFilter.mesh = mesh;
meshCollider.sharedMesh = mesh;
//TODO: material by type
// Použijeme barvu podle typu budovy
meshRenderer.material = mat;
// Přidání collideru pro interakci
building.AddComponent<MeshCollider>();
return building;
}
GameObject BuildPathwayMesh(MapPathway w)
{
var path = new GameObject($"Path_{w.Name ?? "Unknown"}");
path.tag = "Map";
// Použijeme LineRenderer pro jednoduchost
LineRenderer line = path.AddComponent<LineRenderer>();
float width;
Material mat;
switch (w.PathType)
{
case PathType.Footway:
mat = _pathwaySettings.FootwayMat;
width = _pathwaySettings.FootwayWidth;
break;
case PathType.Path:
mat = _pathwaySettings.PathMat;
width = _pathwaySettings.PathWidth;
break;
case PathType.Steps:
mat = _pathwaySettings.StepsMat;
width = _pathwaySettings.PathWidth;
break;
case PathType.Cycleway:
mat = _pathwaySettings.CyclewayMat;
width = _pathwaySettings.CyclewayWidth;
break;
case PathType.Pedestrian:
mat = _pathwaySettings.PedestrianMat;
width = _pathwaySettings.PedestrianWidth;
break;
case PathType.Road:
mat = _pathwaySettings.RoadMat;
width = _pathwaySettings.RoadWidth;
break;
case PathType.Service:
mat = _pathwaySettings.ServiceMat;
width = _pathwaySettings.ServiceWidth;
break;
case PathType.Residential:
mat = _pathwaySettings.ResidentialMat;
width = _pathwaySettings.ResidentialWidth;
break;
case PathType.Track:
mat = _pathwaySettings.TrackMat;
width = _pathwaySettings.TrackWidth;
break;
default:
mat = _pathwaySettings.DefaultMat;
width = _pathwaySettings.DefaultWidth;
break;
}
line.material = mat;
line.widthMultiplier = width;
// Nastavení bodů cesty
line.positionCount = w.Points.Count;
for (int i = 0; i < w.Points.Count; i++)
{
Vector3 pos = w.Points[i].ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center);
pos.y = 0.1f; // Mírně nad zemí
line.SetPosition(i, pos);
}
return path;
}
GameObject BuildAreaMesh(MapArea a)
{
var area = new GameObject($"Area_{a.Name ?? "Unknown"}");
area.tag = "Map";
MeshFilter meshFilter = area.AddComponent<MeshFilter>();
MeshRenderer meshRenderer = area.AddComponent<MeshRenderer>();
// Vytvoření plochého mesh
Mesh mesh = CreateFlatPolygonMesh(a.Outline);
meshFilter.mesh = mesh;
Material mat;
switch (a.AreaType)
{
case MapAreaType.Park:
mat = _areaSettings.ParkMat;
break;
case MapAreaType.Garden:
mat = _areaSettings.GardenMat;
break;
case MapAreaType.Playground:
mat = _areaSettings.PlaygroundMat;
break;
case MapAreaType.Forest:
mat = _areaSettings.ForestMat;
break;
case MapAreaType.Grass:
mat = _areaSettings.GrassMat;
break;
case MapAreaType.Water:
mat = _areaSettings.WaterMat;
break;
default:
mat = _areaSettings.DefaultMat;
break;
}
meshRenderer.material = mat;
area.transform.position = new Vector3(0, 0.05f, 0); // Těsně nad zemí
return area;
}
//TODO: POIs
#endregion
#region Polygon Utils
private Vector3 CalculatePolygonCenter(List<Position> points)
{
Vector3 center = Vector3.zero;
foreach (var point in points)
{
center += point.ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center);
}
return center / points.Count;
}
private Mesh CreateExtrudedPolygonMesh(List<Position> outline, float height)
{
Mesh mesh = new Mesh();
int vertexCount = outline.Count;
// Vertices - spodní a horní podstava
Vector3[] vertices = new Vector3[vertexCount * 2];
Vector3 center = CalculatePolygonCenter(outline);
for (int i = 0; i < vertexCount; i++)
{
Vector3 pos = outline[i].ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center) - center;
vertices[i] = pos; // Spodní
vertices[i + vertexCount] = pos + Vector3.up * height; // Horní
}
// Triangles - jen boční stěny pro jednoduchost
List<int> triangles = new List<int>();
for (int i = 0; i < vertexCount; i++)
{
int next = (i + 1) % vertexCount;
// Boční stěna - dva trojúhelníky
triangles.Add(i);
triangles.Add(i + vertexCount);
triangles.Add(next);
triangles.Add(next);
triangles.Add(i + vertexCount);
triangles.Add(next + vertexCount);
}
// Horní podstava - zjednodušená triangulace (fan)
if (vertexCount >= 3)
{
for (int i = 1; i < vertexCount - 1; i++)
{
triangles.Add(vertexCount); // Střed (první bod horní)
triangles.Add(vertexCount + i);
triangles.Add(vertexCount + i + 1);
}
}
mesh.vertices = vertices;
mesh.triangles = triangles.ToArray();
mesh.RecalculateNormals();
mesh.RecalculateBounds();
return mesh;
}
private Mesh CreateFlatPolygonMesh(List<Position> outline)
{
Mesh mesh = new Mesh();
int vertexCount = outline.Count;
Vector3[] vertices = new Vector3[vertexCount];
Vector3 center = CalculatePolygonCenter(outline);
for (int i = 0; i < vertexCount; i++)
{
vertices[i] = outline[i].ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center) - center;
}
// Triangulace - fan pattern
List<int> triangles = new List<int>();
if (vertexCount >= 3)
{
for (int i = 1; i < vertexCount - 1; i++)
{
triangles.Add(0);
triangles.Add(i);
triangles.Add(i + 1);
}
}
mesh.vertices = vertices;
mesh.triangles = triangles.ToArray();
mesh.RecalculateNormals();
return mesh;
}
#endregion
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 71870ee18b89dd7438e5362ff9e02a3b

View File

@@ -2,6 +2,9 @@ using GeoSus.Client;
using System.Collections;
using System.Threading.Tasks;
using UnityEngine;
using System.Collections.Generic;
using Subsystems;
using System.Linq;
namespace Subsystems
{
@@ -10,6 +13,7 @@ namespace Subsystems
private const string _serverAddress = "geosus.honzuvkod.dev";
private const int _serverPort = 7777;
private GameClient _gameClient;
private GameManager_Map _mapSubsystem;
public async void OpenConection()
{
while (true)
@@ -78,14 +82,35 @@ namespace Subsystems
}
private void OnGameEvent(GameEvent gameEvent)
{
switch (gameEvent.Type)
switch (gameEvent.EventType)
{
case "PlayerJoined":
Debug.Log($"Player {gameEvent.GetPayload<PlayerJoinedPayload>().DisplayName} joined");
HandlePlayerJoined(gameEvent);
break;
case "PlayerLeft":
Debug.Log($"Player {gameEvent.GetPayload<PlayerLeftPayload>()} left");
break;
case "GameStarting":
Debug.Log("Game is starting!");
break;
case "GameStarted":
Debug.Log("Game started");
break;
case "MapDataReady":
Debug.Log("Map data ready");
break;
case "PlayerMapDataReceived":
Debug.Log("Player map data recieved");
break;
case "MapDataError":
Debug.Log("Received MapData server error");
break;
case "SabotageStarted":
Debug.Log("Sabotage started");
HandleSabotageStarted(gameEvent);
break;
default:
Debug.Log("Received GameEvent of type: " + gameEvent.Type);
Debug.Log("Received GameEvent of type: " + gameEvent.EventType);
break;
}
}
@@ -111,20 +136,6 @@ namespace Subsystems
Debug.LogError("Failed to create lobby: " + message.Error);
}
}
private void HandlePlayerJoined(GameEvent gameEvent)
{
var payload = gameEvent.GetPayload<PlayerJoinedPayload>();
_gameClient.CurrentLobbyState.Players.Add(new PlayerInfo
{
ClientUuid = payload.ClientUuid,
DisplayName = payload.DisplayName,
IsOwner = false,
IsReady = false,
State = PlayerState.Alive
});
}
public void CrateLobby(double lat, double lon)
{
_gameClient.CreateLobby(new Position(lat, lon));
@@ -145,8 +156,41 @@ namespace Subsystems
_gameClient.Disconnect();
Application.Quit();
}
public void StartGame()
{
_gameClient.StartGame();
}
#region GameEvent Handlers
private void HandleSabotageStarted(GameEvent gameEvent)
{
SabotageStartedPayload payload = gameEvent.GetPayload<SabotageStartedPayload>();
switch (payload.Type)
{
case SabotageType.CommsBlackout:
for(int i = 0;i < payload.RequiredSimultaneousRepairs; i++)
{
//create stations
}
//Ui.alert
//DisableComms
return;
case SabotageType.CriticalMeltdown:
for (int i = 0; i < payload.RequiredSimultaneousRepairs; i++)
{
//create stations
}
//UI.alert
//UI Time remain
return;
default:
Debug.Log($"Sabotage of unknown type: {payload.Type}");
return;
}
}
#endregion
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9c2032ed1184ad7418cc415edf97b69e

View File

@@ -2,7 +2,7 @@ using UnityEngine;
using Subsystems;
using GeoSus.Client;
using System.ComponentModel;
using System.Threading;
namespace Subsystems
{
@@ -11,25 +11,61 @@ namespace Subsystems
private GameClient _gameClient;
private Canvas _CreateJoinLobby;
private Canvas _InLobby;
public GameManager_UI(GameClient gameClient, Canvas CreateJoinLobby, Canvas InLobby)
private Canvas _LoadingScreen;
private Canvas _GameScreen;
public GameManager_UI(GameClient gameClient, Canvas CreateJoinLobby, Canvas InLobby, Canvas LoadingScreen, Canvas GameScreen)
{
_gameClient = gameClient;
_CreateJoinLobby = CreateJoinLobby;
_LoadingScreen = LoadingScreen;
_GameScreen = GameScreen;
_InLobby = InLobby;
_CreateJoinLobby.enabled = true;
_InLobby.enabled = false;
_GameScreen.enabled = false;
_LoadingScreen.enabled = false;
}
public void UpdateLobbyUI()
{
_InLobby.enabled = true;
_CreateJoinLobby.enabled = false;
var playerList = _InLobby.transform.Find("PlayerList").GetComponent<TMPro.TMP_Text>();
playerList.text = "";
foreach (var player in _gameClient.CurrentLobbyState.Players)
if (_gameClient.CurrentLobbyState == null)
{
playerList.text += player.DisplayName + "\n";
_CreateJoinLobby.enabled = true;
_InLobby.enabled = false;
_GameScreen.enabled = false;
_LoadingScreen.enabled = false;
return;
}
_InLobby.transform.Find("JoinCode").GetComponent<TMPro.TMP_Text>().text = _gameClient.CurrentLobbyState.JoinCode;
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Loading)
{
_CreateJoinLobby.enabled = false;
_InLobby.enabled = false;
_GameScreen.enabled = false;
_LoadingScreen.enabled = true;
return;
}
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Lobby)
{
_InLobby.enabled = true;
_CreateJoinLobby.enabled = false;
var playerList = _InLobby.transform.Find("PlayerList").GetComponent<TMPro.TMP_Text>();
playerList.text = "";
foreach (var player in _gameClient.CurrentLobbyState.Players)
{
playerList.text += player.DisplayName + "\n";
}
_InLobby.transform.Find("JoinCode").GetComponent<TMPro.TMP_Text>().text = _gameClient.CurrentLobbyState.JoinCode;
return;
}
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Playing)
{
_CreateJoinLobby.enabled = false;
_InLobby.enabled = false;
_GameScreen.enabled = true;
_LoadingScreen.enabled = false;
_GameScreen.transform.Find("Role").GetComponent<TMPro.TMP_Text>().text = _gameClient.MyRole.ToString() ;
return;
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f575016e02384774d88b46ed7f09579f

View File

@@ -2,20 +2,24 @@ using GeoSus.Client;
using System;
using UnityEngine;
public enum TaskType
/*public enum TaskType
{
Task //TODO: Typy úkolù
}*/
[System.Serializable]
public class TaskData
{
//TaskType
public GameObject TaskPrefab;
}
public interface ITask
{
public string TaskID { get; } // Unikátní ID úkolu pro server
public TaskType TaskType { get; } // Typ úkolu
public string TaskName { get; } // Viditelný název úkolu
public (double, double) TaskLocation { get; } // Polohy na mapì
public bool IsCompleted { get; } // Stav dokonèení úkolu
public string TaskID { get; set; } // Unikátní ID úkolu pro server
public TaskType TaskType { get; set; } // Typ úkolu
public string TaskName { get; set; } // Viditelný název úkolu
public Position TaskLocation { get; set; } // Polohy na mapì
public bool IsCompleted { get; } // Stav dokončení úkolu
void Initialize(Action<ITask> onCompleted); // Vytvoøení tasku + naètení postupu
void ExitTask(Action<ITask> onExit); // Pøi opuštìní úkolu poslat hotovo / uložit postup / reset
@@ -27,7 +31,7 @@ public class Wires : ITask{
public string TaskID { get; set; } // Unikátní ID úkolu pro server
public TaskType TaskType { get; set; } // Typ úkolu
public string TaskName { get; set; } // Viditelný název úkolu
public (double, double) TaskLocation { get; set; } // Poloha na mapì
public Position TaskLocation { get; set; } // Poloha na mapì
public bool IsCompleted { get; private set; } // Stav dokonèení úkolu
private Action<ITask> _onCompleted;
@@ -35,6 +39,7 @@ public class Wires : ITask{
{
IsCompleted = false;
_onCompleted = onCompleted;
}
public void ExitTask(Action<ITask> onExit) //Zavøení tasku
{
@@ -51,3 +56,18 @@ public class Wires : ITask{
}
*/
public enum StationType
{
Sabotage,
Task,
Meeting,
Body
}
public interface IInteractable
{
public StationType Type { get; set; } // Typ stanice
public Position Location { get; set; } // Pozice na mapě
public PlayerRole? ReqRole { get; set; } // Požadovaná role hráče Impostor / Crewmate / Any = null
public float InteractionRange { get; set; } // Dosah interakce
void Interact(PlayerRole role); // Spuštění interakce
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8e926b313c00d4f48ad68750c88817bf

View File

@@ -0,0 +1,83 @@
using GeoSus.Client;
using System;
using UnityEngine;
using System.Linq;
public class Station : IInteractable
{
public StationType Type { get; set; }
public Position Location { get; set; }
public PlayerRole? ReqRole { get; set; }
public float InteractionRange { get; set; }
protected GameObject interfaceInstance;
public GameObject Interface { get; set; } // Prefab pro interakci (napø. UI pro úkol nebo sabotáže)
public virtual void Interact(PlayerRole role)
{
if (ReqRole.HasValue && role != ReqRole.Value)
{
Debug.Log("You do not have the required role to interact with this station.");
return;
}
else
{
interfaceInstance = UnityEngine.Object.Instantiate(Interface); // Zobrazí interakèní UI
}
}
public Station(Position location, float interactionRange)
{
Location = location;
InteractionRange = interactionRange;
}
}
public class TaskStation : Station
{
public string TaskID { get; set; } // Unikátní ID úkolu pro server
private GameClient _gameClient;
public TaskStation(Position pos, float interactionRange, GameClient gameClient, string taskID) : base(pos, interactionRange)
{
Type = StationType.Task;
ReqRole = PlayerRole.Crew;
_gameClient = gameClient;
}
public ITask Task { get; set; }
public override void Interact(PlayerRole role)
{
if(interfaceInstance != null)
{
ResumeTask();
return;
}
base.Interact(role);
Task = interfaceInstance.GetComponent<ITask>();
Task.TaskID = TaskID;
Task.Initialize(OnTaskCompleted);
}
private void ResumeTask()
{
interfaceInstance.SetActive(true); // Zobrazí interakèní UI
}
private void OnTaskCompleted(ITask task)
{
_gameClient.CompleteTask(task.TaskID);
task.ExitTask(OnTaskExit);
Debug.Log($"Task {task.TaskName} completed and sent to server.");
}
private void OnTaskExit(ITask task)
{
if (task.IsCompleted)
{
UnityEngine.Object.Destroy(interfaceInstance); // Znièí interakèní UI
Debug.Log($"Task {task.TaskName} completed and sent to server.");
}
else
{
interfaceInstance.SetActive(false); // Skryje interakèní UI
Debug.Log($"Task {task.TaskName} was not completed, but exited.");
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0ca1825585bf9bc42bd3b11985048465

View File

@@ -7,8 +7,8 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Screenshot 2026-01-03 135505
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Name: TestMaterial
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
@@ -23,6 +23,10 @@ Material:
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}
@@ -44,7 +48,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 422ed5729f838a3478b0aba002d0be9e, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
@@ -61,10 +65,12 @@ Material:
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
@@ -78,7 +84,9 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0, g: 0, b: 0, 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: []
m_AllowLocking: 1

View File

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

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 832a89cb6f62a5240a99d84d09f0a0eb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Scenes.meta Normal file
View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8f736798e2d13f14f903b26a2df0eed8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3e95f16d8e50b3341925e51e50768027
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -1,498 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &149147781
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 149147784}
- component: {fileID: 149147783}
- component: {fileID: 149147782}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &149147782
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149147781}
m_Enabled: 1
--- !u!20 &149147783
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149147781}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.2784314, g: 0.2784314, b: 0.2784314, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 44
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &149147784
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 149147781}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: -13.67, y: 11.45, z: -2.18}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!1 &212819381
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 212819383}
- component: {fileID: 212819382}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &212819382
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 212819381}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &212819383
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 212819381}
serializedVersion: 2
m_LocalRotation: {x: 0.29883623, y: 0.64085644, z: -0.29883623, w: 0.64085644}
m_LocalPosition: {x: -12.9, y: 26, z: -8.131}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: 90, z: 0}
--- !u!1 &401988526
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 401988529}
- component: {fileID: 401988528}
- component: {fileID: 401988527}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &401988527
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 401988526}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.EventSystems.StandaloneInputModule
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &401988528
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 401988526}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.EventSystems.EventSystem
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &401988529
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 401988526}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1343076853
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1343076857}
- component: {fileID: 1343076856}
- component: {fileID: 1343076855}
- component: {fileID: 1343076854}
m_Layer: 0
m_Name: "pozad\xED obrazovky"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &1343076854
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1343076853}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1343076855
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1343076853}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: ce4abc8ba37998a4aa04030374ca8693, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1343076856
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1343076853}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1343076857
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1343076853}
serializedVersion: 2
m_LocalRotation: {x: 0.5, y: -0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 13.94, y: 10.420001, z: -2.32}
m_LocalScale: {x: 1, y: 1, z: 2.089458}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 90, y: -90, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 149147784}
- {fileID: 212819383}
- {fileID: 401988529}
- {fileID: 1343076857}

View File

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

8
Assets/Scripts.meta Normal file
View File

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

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2d992ef55bc28784f81e79dd5cca414b

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8cf96fedb0da0ff4f947cad1c84e352b

View File

@@ -34,7 +34,7 @@ public class MapRenderer : MonoBehaviour
[Header("Misc")]
public float metersPerUnit = 1f; // scale: 1 unit = 1 meter
public float _metersPerUnit = 1f; // scale: 1 unit = 1 meter
[Header("Storage")]
@@ -172,7 +172,7 @@ public class MapRenderer : MonoBehaviour
double R = 6378137.0; // Earth radius in meters
double x = R * dLon * Math.Cos(lat0 * Mathf.Deg2Rad);
double y = R * dLat;
return new Vector3((float)x / metersPerUnit, 0f, (float)y / metersPerUnit);
return new Vector3((float)x / _metersPerUnit, 0f, (float)y / _metersPerUnit);
}
Vector3 NodeIdToLocal(long nodeId)
{
@@ -258,9 +258,9 @@ public class MapRenderer : MonoBehaviour
Vector2 p2 = poly2D[idx2];
int baseIdx = verts.Count;
verts.Add(new Vector3(p0.x, height / metersPerUnit, p0.y));
verts.Add(new Vector3(p1.x, height / metersPerUnit, p1.y));
verts.Add(new Vector3(p2.x, height / metersPerUnit, p2.y));
verts.Add(new Vector3(p0.x, height / _metersPerUnit, p0.y));
verts.Add(new Vector3(p1.x, height / _metersPerUnit, p1.y));
verts.Add(new Vector3(p2.x, height / _metersPerUnit, p2.y));
triangles.Add(baseIdx);
triangles.Add(baseIdx + 1);
@@ -279,10 +279,10 @@ public class MapRenderer : MonoBehaviour
Vector2 p1 = poly2D[iNext];
int baseIdx = verts.Count;
verts.Add(new Vector3(p0.x, height / metersPerUnit, p0.y)); // top left
verts.Add(new Vector3(p0.x, height / _metersPerUnit, p0.y)); // top left
verts.Add(new Vector3(p0.x, 0, p0.y)); // bottom left
verts.Add(new Vector3(p1.x, 0, p1.y)); // bottom right
verts.Add(new Vector3(p1.x, height / metersPerUnit, p1.y)); // top right
verts.Add(new Vector3(p1.x, height / _metersPerUnit, p1.y)); // top right
triangles.Add(baseIdx);
triangles.Add(baseIdx + 1);
@@ -369,8 +369,8 @@ public class MapRenderer : MonoBehaviour
else dir = (pts[i + 1] - pts[i - 1]).normalized;
Vector3 normal = Vector3.Cross(dir, Vector3.up).normalized;
Vector3 left = p + normal * (width * 0.5f / metersPerUnit);
Vector3 right = p - normal * (width * 0.5f / metersPerUnit);
Vector3 left = p + normal * (width * 0.5f / _metersPerUnit);
Vector3 right = p - normal * (width * 0.5f / _metersPerUnit);
verts.Add(left);
verts.Add(right);
uvs.Add(new Vector2(0, i));

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 648d9484af013c346bd5ae603a8c7185

View File

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

8
Assets/Settings.meta Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

8
Assets/TextMesh Pro.meta Normal file
View File

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

View File

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

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 73a79399807f4e8388c2cbb5494681ca
timeCreated: 1484172033
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: 997a43b767814dd0a7642ec9b78cba41
timeCreated: 1484172033
licenseType: Pro
TrueTypeFontImporter:
serializedVersion: 2
fontSize: 16
forceTextureCase: -2
characterSpacing: 1
characterPadding: 0
includeFontData: 1
use2xBehaviour: 0
fontNames: []
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: efe0bf4ac872451e91612d1ae593f480
timeCreated: 1484171296
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: 5dd49b3eacc540408c98eee0de38e0f1
timeCreated: 1484171297
licenseType: Pro
TrueTypeFontImporter:
serializedVersion: 2
fontSize: 16
forceTextureCase: -2
characterSpacing: 1
characterPadding: 0
includeFontData: 1
use2xBehaviour: 0
fontNames: []
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 8a2b9e2a607dd2143b58c44bc32410b4
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Electronic Highway Sign
fontNames:
- Electronic Highway Sign
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d2cf87a8a7a94aa8b80dff1c807c1178
timeCreated: 1484171296
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: c9f6d0e7bc8541498c9a4799ba184ede
timeCreated: 1484171297
licenseType: Pro
TrueTypeFontImporter:
serializedVersion: 2
fontSize: 16
forceTextureCase: -2
characterSpacing: 1
characterPadding: 0
includeFontData: 1
use2xBehaviour: 0
fontNames: []
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f28c334d44214474d9702d3ad79ecb0a
timeCreated: 1484171296
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f0303f887b8fa7243a51432c478ff2f3
timeCreated: 1484171296
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 4beb055f07aaff244873dec698d0363e
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Roboto
fontNames:
- Roboto
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0251f66ebc602a944b35bccd13be2738
timeCreated: 1484171296
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,21 @@
fileFormatVersion: 2
guid: f4eec857a4fdf2f43be0e9f3d1a984e7
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontNames:
- Unity
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5808953df7a24274a851aa6dee52d30e
folderAsset: yes
timeCreated: 1436068007
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: e6b9b44320f4448d9d5e0ee634259966
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: c719e38f25a9480abd2480ab621a2949
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: aadd5a709a48466c887296bb5b1b8110
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 22262639920f43d6be32430e4e58350d
timeCreated: 1473643741
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5bff2544887143f5807c7d5059d07f79
folderAsset: yes
timeCreated: 1436068007
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b06f0e6c1dfa4356ac918da1bb32c603
timeCreated: 1435130987
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: a6e39ced0ea046bcb636c3f0b2e2a745
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: fdad9d952ae84cafb74c63f2e694d042
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d6d3a169ad794942a21da6a552d62f6f
folderAsset: yes
timeCreated: 1436068007
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 479a66fa4b094512a62b0a8e553ad95a
timeCreated: 1468189245
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4c86a3366cd840348ebe8dc438570ee4
timeCreated: 1468443381
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5cf8ae092ca54931b443bec5148f3c59
timeCreated: 1468443381
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 69a525efa7e6472eab268f6ea605f06e
timeCreated: 1468213165
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

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