Author SHA1 Message Date
AsanoRema f41e14971a Added new stanok 2026-08-13 08:33:12 +03:00
AsanoRema badcd41077 ok 2026-08-13 08:25:15 +03:00
SueDoStefan f8b22af4bf add main-blockscene 2026-08-12 16:24:25 +03:00
42 changed files with 135709 additions and 2537 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
+2 -3
View File
@@ -39,7 +39,6 @@ Material:
disabledShaderPasses: disabledShaderPasses:
- MOTIONVECTORS - MOTIONVECTORS
- DepthOnly - DepthOnly
- SHADOWCASTER
m_LockedProperties: m_LockedProperties:
m_SavedProperties: m_SavedProperties:
serializedVersion: 3 serializedVersion: 3
@@ -69,7 +68,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 2800000, guid: a75118087a5b8ea41a9f58ce5debb2d2, type: 3} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MetallicGlossMap: - _MetallicGlossMap:
@@ -137,7 +136,7 @@ Material:
- _ZWrite: 0 - _ZWrite: 0
m_Colors: m_Colors:
- _BaseColor: {r: 0, g: 0, b: 0, a: 1} - _BaseColor: {r: 0, g: 0, b: 0, a: 1}
- _Color: {r: 0, g: 0, b: 0, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0.9705882, g: 0.947554, b: 0.9063581, a: 1} - _EmissionColor: {r: 0.9705882, g: 0.947554, b: 0.9063581, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []
+3 -1
View File
@@ -11,7 +11,9 @@ Material:
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_Parent: {fileID: 0} m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0 m_ModifiedSerializedProperties: 0
m_ValidKeywords: [] m_ValidKeywords:
- _GLOSSINESS_FROM_BASE_ALPHA
- _SPECULAR_COLOR
m_InvalidKeywords: [] m_InvalidKeywords: []
m_LightmapFlags: 4 m_LightmapFlags: 4
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
@@ -25,7 +25,6 @@ Material:
m_Parent: {fileID: 0} m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0 m_ModifiedSerializedProperties: 0
m_ValidKeywords: m_ValidKeywords:
- _ENVIRONMENTREFLECTIONS_OFF
- _SPECULARHIGHLIGHTS_OFF - _SPECULARHIGHLIGHTS_OFF
m_InvalidKeywords: m_InvalidKeywords:
- _GLOSSYREFLECTIONS_OFF - _GLOSSYREFLECTIONS_OFF
@@ -12,7 +12,6 @@ Material:
m_Parent: {fileID: 0} m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0 m_ModifiedSerializedProperties: 0
m_ValidKeywords: m_ValidKeywords:
- _ENVIRONMENTREFLECTIONS_OFF
- _SPECULARHIGHLIGHTS_OFF - _SPECULARHIGHLIGHTS_OFF
m_InvalidKeywords: m_InvalidKeywords:
- _GLOSSYREFLECTIONS_OFF - _GLOSSYREFLECTIONS_OFF
@@ -53,7 +52,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 2800000, guid: 4a3ea3eb16909a646a66ff7b19d31788, type: 3} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MetallicGlossMap: - _MetallicGlossMap:
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6bc910aee46640ce911e111e1b7376b2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,149 +0,0 @@
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MapCoordinateSystem))]
public sealed class MapCoordinateSystemEditor : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
EditorGUILayout.HelpBox(
"Select MapCoordinates to display its grid and live crosshair coordinates in the Scene view. " +
"This visualization is not rendered in the Game view or in builds.",
MessageType.Info);
}
private void OnSceneGUI()
{
MapCoordinateSystem coordinateSystem = (MapCoordinateSystem)target;
if (!coordinateSystem.ShowSceneVisualization || !coordinateSystem.HasValidCorners())
return;
DrawGrid(coordinateSystem);
DrawCorners(coordinateSystem);
DrawCrosshairs(coordinateSystem);
DrawTargets(coordinateSystem);
}
private static void DrawGrid(MapCoordinateSystem coordinateSystem)
{
int divisions = coordinateSystem.GridDivisions;
GUIStyle labelStyle = CreateLabelStyle(coordinateSystem.BoundaryColor);
for (int index = 0; index <= divisions; index++)
{
float normalized = (float)index / divisions;
Vector3 verticalStart = Vector3.Lerp(
coordinateSystem.BottomLeft.position,
coordinateSystem.BottomRight.position,
normalized);
Vector3 verticalEnd = Vector3.Lerp(
coordinateSystem.TopLeft.position,
coordinateSystem.TopRight.position,
normalized);
Vector3 horizontalStart = Vector3.Lerp(
coordinateSystem.BottomLeft.position,
coordinateSystem.TopLeft.position,
normalized);
Vector3 horizontalEnd = Vector3.Lerp(
coordinateSystem.BottomRight.position,
coordinateSystem.TopRight.position,
normalized);
bool isBoundary = index == 0 || index == divisions;
Handles.color = isBoundary ? coordinateSystem.BoundaryColor : coordinateSystem.GridColor;
Handles.DrawLine(verticalStart, verticalEnd);
Handles.DrawLine(horizontalStart, horizontalEnd);
if (!coordinateSystem.ShowCoordinateLabels)
continue;
float horizontalCoordinate = coordinateSystem.MaximumCoordinates.x * normalized;
float verticalCoordinate = coordinateSystem.MaximumCoordinates.y * normalized;
Handles.Label(verticalStart, horizontalCoordinate.ToString("0.##"), labelStyle);
Handles.Label(horizontalStart, verticalCoordinate.ToString("0.##"), labelStyle);
}
}
private static void DrawCorners(MapCoordinateSystem coordinateSystem)
{
Handles.color = coordinateSystem.BoundaryColor;
DrawCorner(coordinateSystem.BottomLeft, "(0, 0)", coordinateSystem);
DrawCorner(
coordinateSystem.BottomRight,
$"({coordinateSystem.MaximumCoordinates.x:0.##}, 0)",
coordinateSystem);
DrawCorner(
coordinateSystem.TopLeft,
$"(0, {coordinateSystem.MaximumCoordinates.y:0.##})",
coordinateSystem);
DrawCorner(
coordinateSystem.TopRight,
$"({coordinateSystem.MaximumCoordinates.x:0.##}, " +
$"{coordinateSystem.MaximumCoordinates.y:0.##})",
coordinateSystem);
}
private static void DrawCorner(
Transform corner,
string label,
MapCoordinateSystem coordinateSystem)
{
float size = coordinateSystem.MarkerSize * HandleUtility.GetHandleSize(corner.position);
Handles.SphereHandleCap(0, corner.position, Quaternion.identity, size, EventType.Repaint);
if (coordinateSystem.ShowCoordinateLabels)
Handles.Label(corner.position, label, CreateLabelStyle(coordinateSystem.BoundaryColor));
}
private static void DrawCrosshairs(MapCoordinateSystem coordinateSystem)
{
MapController[] controllers =
Object.FindObjectsByType<MapController>(FindObjectsSortMode.None);
foreach (MapController controller in controllers)
{
if (controller.CoordinateSystem != coordinateSystem || controller.CrosshairVisual == null)
continue;
Vector3 position = controller.CrosshairVisual.position;
Vector2 coordinates = coordinateSystem.WorldPositionToCoordinates(position);
float size = coordinateSystem.MarkerSize * 1.35f * HandleUtility.GetHandleSize(position);
Handles.color = Color.yellow;
Handles.SphereHandleCap(0, position, Quaternion.identity, size, EventType.Repaint);
Handles.Label(
position,
$"Crosshair ({coordinates.x:0.00}, {coordinates.y:0.00})",
CreateLabelStyle(Color.yellow));
}
}
private static void DrawTargets(MapCoordinateSystem coordinateSystem)
{
if (!coordinateSystem.ShowCoordinateLabels)
return;
MapTarget[] targets = Object.FindObjectsByType<MapTarget>(FindObjectsSortMode.None);
foreach (MapTarget mapTarget in targets)
{
if (mapTarget.CoordinateSystem != null && mapTarget.CoordinateSystem != coordinateSystem)
continue;
Vector3 position = mapTarget.transform.position;
Vector2 coordinates = coordinateSystem.WorldPositionToCoordinates(position);
Handles.Label(
position,
$"{mapTarget.name} ({coordinates.x:0.00}, {coordinates.y:0.00})",
CreateLabelStyle(Color.red));
}
}
private static GUIStyle CreateLabelStyle(Color color)
{
GUIStyle style = new(EditorStyles.boldLabel);
style.normal.textColor = color;
return style;
}
}
@@ -1,98 +0,0 @@
using UnityEngine;
[DisallowMultipleComponent]
public sealed class MapController : MonoBehaviour
{
[Header("Main References")]
[SerializeField] private MapCrosshairController crosshair = null;
[SerializeField] private MapCoordinateSystem coordinateSystem = null;
[Header("Target System")]
[SerializeField] private MapTargetController targetController = null;
[SerializeField] private MapTarget targetPrefab = null;
[SerializeField] private Transform targetParent = null;
[SerializeField] private bool createTargetsOnStart = true;
[Header("Radar System")]
[SerializeField] private MapRadarController radarController = null;
[Header("Crosshair Objects")]
[SerializeField] private Transform relayX = null;
[SerializeField] private Transform relayY = null;
[SerializeField] private Transform crosshairVisual = null;
[Header("Input")]
[SerializeField, Min(0f)] private float movementSpeed = 1f;
[SerializeField] private bool useKeyboardInput = true;
public MapCoordinateSystem CoordinateSystem => coordinateSystem;
public Transform CrosshairVisual => crosshairVisual;
private void Awake()
{
if (targetController != null)
{
targetController.Configure(
coordinateSystem,
targetPrefab,
targetParent);
if (createTargetsOnStart)
targetController.CreateAndPlaceTargets();
}
if (radarController != null)
radarController.Configure(coordinateSystem, targetController, targetPrefab);
if (crosshair == null)
return;
crosshair.Configure(
coordinateSystem,
relayX,
relayY,
crosshairVisual,
movementSpeed,
useKeyboardInput,
targetController);
}
public void SetHorizontalAxis(float value)
{
if (crosshair != null)
crosshair.SetHorizontalAxis(value);
}
public void SetVerticalAxis(float value)
{
if (crosshair != null)
crosshair.SetVerticalAxis(value);
}
public Vector2 GetCrosshairCoordinates()
{
return crosshair != null ? crosshair.GetCrosshairCoordinates() : Vector2.zero;
}
public void CreateAndPlaceTargets()
{
if (targetController != null)
targetController.CreateAndPlaceTargets();
}
public bool TryGetNearestTarget(out MapTarget target, out float distance)
{
if (crosshair != null)
return crosshair.TryGetNearestTarget(out target, out distance);
target = null;
distance = -1f;
return false;
}
public bool ActivateRadar()
{
return radarController != null && radarController.ActivateRadar();
}
}
@@ -1,147 +0,0 @@
using UnityEngine;
[DisallowMultipleComponent]
public sealed class MapCoordinateSystem : MonoBehaviour
{
public const float CoordinateMaximum = 10f;
[Header("Coordinate Bounds")]
[SerializeField] private Transform bottomLeft = null;
[SerializeField] private Transform bottomRight = null;
[SerializeField] private Transform topLeft = null;
[SerializeField] private Transform topRight = null;
[Header("Square Bounds")]
[SerializeField, Min(0.001f)] private float squareSize = 5.14925f;
[Header("Scene View Visualization")]
[SerializeField] private bool showSceneVisualization = true;
[SerializeField, Range(1, 20)] private int gridDivisions = 10;
[SerializeField] private bool showCoordinateLabels = true;
[SerializeField] private Color boundaryColor = new(0f, 0.85f, 1f, 1f);
[SerializeField] private Color gridColor = new(0f, 0.85f, 1f, 0.3f);
[SerializeField, Min(0.001f)] private float markerSize = 0.06f;
public Vector2 MaximumCoordinates => new(CoordinateMaximum, CoordinateMaximum);
public float SquareSize => Mathf.Max(0.001f, squareSize);
public bool ShowSceneVisualization => showSceneVisualization;
public int GridDivisions => Mathf.Max(1, gridDivisions);
public bool ShowCoordinateLabels => showCoordinateLabels;
public Color BoundaryColor => boundaryColor;
public Color GridColor => gridColor;
public float MarkerSize => Mathf.Max(0.001f, markerSize);
public Transform BottomLeft => bottomLeft;
public Transform BottomRight => bottomRight;
public Transform TopLeft => topLeft;
public Transform TopRight => topRight;
private void OnValidate()
{
squareSize = Mathf.Max(0.001f, squareSize);
ApplySquareBounds();
}
public void ApplySquareBounds()
{
if (!HasValidCorners())
return;
Vector3 origin = bottomLeft.position;
Vector3 rightDirection = bottomRight.position - origin;
Vector3 upDirection = topLeft.position - origin;
if (rightDirection.sqrMagnitude <= Mathf.Epsilon || upDirection.sqrMagnitude <= Mathf.Epsilon)
return;
rightDirection.Normalize();
upDirection = Vector3.ProjectOnPlane(upDirection, rightDirection);
if (upDirection.sqrMagnitude <= Mathf.Epsilon)
return;
upDirection.Normalize();
float size = SquareSize;
bottomRight.position = origin + rightDirection * size;
topLeft.position = origin + upDirection * size;
topRight.position = origin + (rightDirection + upDirection) * size;
}
public Vector2 ClampCoordinates(Vector2 coordinates)
{
return new Vector2(
Mathf.Clamp(coordinates.x, 0f, CoordinateMaximum),
Mathf.Clamp(coordinates.y, 0f, CoordinateMaximum));
}
public Vector3 CoordinatesToWorldPosition(Vector2 coordinates)
{
if (!HasValidCorners())
return transform.position;
Vector2 clamped = ClampCoordinates(coordinates);
float horizontal = clamped.x / CoordinateMaximum;
float vertical = clamped.y / CoordinateMaximum;
Vector3 bottom = Vector3.Lerp(bottomLeft.position, bottomRight.position, horizontal);
Vector3 top = Vector3.Lerp(topLeft.position, topRight.position, horizontal);
return Vector3.Lerp(bottom, top, vertical);
}
public Vector2 WorldPositionToCoordinates(Vector3 worldPosition)
{
if (!HasValidCorners())
return Vector2.zero;
Vector3 horizontalEdge = bottomRight.position - bottomLeft.position;
Vector3 verticalEdge = topLeft.position - bottomLeft.position;
Vector3 fromBottomLeft = worldPosition - bottomLeft.position;
float horizontal = horizontalEdge.sqrMagnitude > Mathf.Epsilon
? Vector3.Dot(fromBottomLeft, horizontalEdge) / horizontalEdge.sqrMagnitude
: 0f;
float vertical = verticalEdge.sqrMagnitude > Mathf.Epsilon
? Vector3.Dot(fromBottomLeft, verticalEdge) / verticalEdge.sqrMagnitude
: 0f;
for (int iteration = 0; iteration < 6; iteration++)
{
Vector3 current = BilinearPosition(horizontal, vertical);
Vector3 error = worldPosition - current;
Vector3 horizontalDerivative = Vector3.Lerp(
bottomRight.position - bottomLeft.position,
topRight.position - topLeft.position,
vertical);
Vector3 verticalDerivative = Vector3.Lerp(
topLeft.position - bottomLeft.position,
topRight.position - bottomRight.position,
horizontal);
float horizontalLength = Vector3.Dot(horizontalDerivative, horizontalDerivative);
float mixedLength = Vector3.Dot(horizontalDerivative, verticalDerivative);
float verticalLength = Vector3.Dot(verticalDerivative, verticalDerivative);
float determinant = horizontalLength * verticalLength - mixedLength * mixedLength;
if (Mathf.Abs(determinant) <= Mathf.Epsilon)
break;
float horizontalError = Vector3.Dot(horizontalDerivative, error);
float verticalError = Vector3.Dot(verticalDerivative, error);
horizontal += (horizontalError * verticalLength - verticalError * mixedLength) / determinant;
vertical += (verticalError * horizontalLength - horizontalError * mixedLength) / determinant;
}
Vector2 coordinates = new(
horizontal * CoordinateMaximum,
vertical * CoordinateMaximum);
return ClampCoordinates(coordinates);
}
private Vector3 BilinearPosition(float horizontal, float vertical)
{
Vector3 bottom = Vector3.LerpUnclamped(bottomLeft.position, bottomRight.position, horizontal);
Vector3 top = Vector3.LerpUnclamped(topLeft.position, topRight.position, horizontal);
return Vector3.LerpUnclamped(bottom, top, vertical);
}
public bool HasValidCorners()
{
return bottomLeft != null && bottomRight != null && topLeft != null && topRight != null;
}
}
@@ -1,181 +0,0 @@
using UnityEngine;
using UnityEngine.InputSystem;
[DisallowMultipleComponent]
public sealed class MapCrosshairController : MonoBehaviour
{
[Header("Nearest Target (Runtime)")]
[SerializeField] private MapTarget nearestTarget = null;
[SerializeField] private float distanceToNearestTarget = -1f;
private MapCoordinateSystem coordinateSystem;
private MapTargetController targetController;
private Transform relayX;
private Transform relayY;
private Transform crosshairVisual;
private float movementSpeed;
private bool useKeyboardInput;
private float horizontalAxis;
private float verticalAxis;
private Vector2 crosshairCoordinates;
private Vector3 relayXOffset;
private Vector3 relayYOffset;
private bool isConfigured;
public MapCoordinateSystem CoordinateSystem => coordinateSystem;
public void Configure(
MapCoordinateSystem newCoordinateSystem,
Transform newRelayX,
Transform newRelayY,
Transform newCrosshairVisual,
float newMovementSpeed,
bool enableKeyboardInput,
MapTargetController newTargetController)
{
coordinateSystem = newCoordinateSystem;
relayX = newRelayX;
relayY = newRelayY;
crosshairVisual = newCrosshairVisual;
movementSpeed = Mathf.Max(0f, newMovementSpeed);
useKeyboardInput = enableKeyboardInput;
targetController = newTargetController;
crosshairCoordinates = Vector2.zero;
isConfigured = CalibrateObjects();
if (isConfigured)
ApplyCoordinates();
}
private void Update()
{
if (!isConfigured)
return;
if (useKeyboardInput)
ReadKeyboardInput();
Vector2 movement = new(horizontalAxis, verticalAxis);
crosshairCoordinates += movement * (movementSpeed * Time.deltaTime);
crosshairCoordinates = coordinateSystem.ClampCoordinates(crosshairCoordinates);
ApplyCoordinates();
UpdateNearestTarget();
}
public void SetHorizontalAxis(float value)
{
horizontalAxis = Mathf.Clamp(value, -1f, 1f);
}
public void SetVerticalAxis(float value)
{
verticalAxis = Mathf.Clamp(value, -1f, 1f);
}
public Vector2 GetCrosshairCoordinates()
{
return crosshairCoordinates;
}
public MapTarget GetNearestTarget()
{
return nearestTarget;
}
public float GetDistanceToNearestTarget()
{
return distanceToNearestTarget;
}
public bool TryGetNearestTarget(out MapTarget target, out float distance)
{
target = nearestTarget;
distance = distanceToNearestTarget;
return target != null;
}
private void ReadKeyboardInput()
{
Keyboard keyboard = Keyboard.current;
if (keyboard == null)
{
SetHorizontalAxis(0f);
SetVerticalAxis(0f);
return;
}
SetHorizontalAxis(
(keyboard.lKey.isPressed ? 1f : 0f) - (keyboard.jKey.isPressed ? 1f : 0f));
SetVerticalAxis(
(keyboard.iKey.isPressed ? 1f : 0f) - (keyboard.kKey.isPressed ? 1f : 0f));
}
private void ApplyCoordinates()
{
Vector3 targetWorldPosition = coordinateSystem.CoordinatesToWorldPosition(crosshairCoordinates);
crosshairVisual.position = targetWorldPosition;
if (relayX != null)
relayX.position = coordinateSystem.CoordinatesToWorldPosition(
new Vector2(crosshairCoordinates.x, 0f)) + relayXOffset;
if (relayY != null)
relayY.position = coordinateSystem.CoordinatesToWorldPosition(
new Vector2(0f, crosshairCoordinates.y)) + relayYOffset;
}
private bool CalibrateObjects()
{
if (coordinateSystem == null || crosshairVisual == null || !coordinateSystem.HasValidCorners())
return false;
Vector3 origin = coordinateSystem.CoordinatesToWorldPosition(Vector2.zero);
Vector3 horizontalDirection =
coordinateSystem.CoordinatesToWorldPosition(new Vector2(MapCoordinateSystem.CoordinateMaximum, 0f)) -
origin;
Vector3 verticalDirection =
coordinateSystem.CoordinatesToWorldPosition(new Vector2(0f, MapCoordinateSystem.CoordinateMaximum)) -
origin;
if (horizontalDirection.sqrMagnitude <= Mathf.Epsilon ||
verticalDirection.sqrMagnitude <= Mathf.Epsilon)
return false;
horizontalDirection.Normalize();
verticalDirection.Normalize();
if (relayX != null)
relayXOffset = Vector3.ProjectOnPlane(relayX.position - origin, horizontalDirection);
if (relayY != null)
relayYOffset = Vector3.ProjectOnPlane(relayY.position - origin, verticalDirection);
return true;
}
private void UpdateNearestTarget()
{
nearestTarget = null;
distanceToNearestTarget = -1f;
if (targetController == null)
return;
float nearestSqrDistance = float.PositiveInfinity;
foreach (MapTarget target in targetController.Targets)
{
if (target == null)
continue;
float sqrDistance = (target.MapCoordinates - crosshairCoordinates).sqrMagnitude;
if (sqrDistance >= nearestSqrDistance)
continue;
nearestSqrDistance = sqrDistance;
nearestTarget = target;
}
if (nearestTarget != null)
distanceToNearestTarget = Mathf.Sqrt(nearestSqrDistance);
}
}
@@ -1,113 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
[DisallowMultipleComponent]
public sealed class MapRadarController : MonoBehaviour
{
[Header("Radar Settings")]
[SerializeField, Min(0f)] private float cooldown = 5f;
[SerializeField] private bool useKeyboardInput = true;
[Header("Radar State (Runtime)")]
[SerializeField] private float cooldownRemaining;
private readonly List<GameObject> radarMarks = new();
private MapCoordinateSystem coordinateSystem;
private MapTargetController targetController;
private MapTarget radarMarkPrefab;
private float nextActivationTime;
private bool isConfigured;
public float CooldownRemaining => cooldownRemaining;
public bool IsReady => cooldownRemaining <= 0f;
private void OnValidate()
{
cooldown = Mathf.Max(0f, cooldown);
}
public void Configure(
MapCoordinateSystem newCoordinateSystem,
MapTargetController newTargetController,
MapTarget newRadarMarkPrefab)
{
coordinateSystem = newCoordinateSystem;
targetController = newTargetController;
radarMarkPrefab = newRadarMarkPrefab;
isConfigured = coordinateSystem != null &&
coordinateSystem.HasValidCorners() &&
targetController != null &&
radarMarkPrefab != null;
if (targetController != null)
targetController.SetTargetVisualsVisible(false);
}
private void Update()
{
cooldownRemaining = Mathf.Max(0f, nextActivationTime - Time.time);
if (!useKeyboardInput)
return;
Keyboard keyboard = Keyboard.current;
if (keyboard != null && keyboard.oKey.wasPressedThisFrame)
ActivateRadar();
}
public bool ActivateRadar()
{
if (!isConfigured || Time.time < nextActivationTime)
return false;
PlaceRadarMarks();
nextActivationTime = Time.time + Mathf.Max(0f, cooldown);
cooldownRemaining = Mathf.Max(0f, nextActivationTime - Time.time);
return true;
}
private void PlaceRadarMarks()
{
int targetCount = targetController.Targets.Count;
EnsureRadarMarkCount(targetCount);
for (int index = 0; index < radarMarks.Count; index++)
{
bool hasTarget = index < targetCount && targetController.Targets[index] != null;
GameObject radarMark = radarMarks[index];
radarMark.SetActive(hasTarget);
if (!hasTarget)
continue;
MapTarget target = targetController.Targets[index];
radarMark.name = $"Radar Mark - {target.name}";
radarMark.transform.position =
coordinateSystem.CoordinatesToWorldPosition(target.MapCoordinates);
}
}
private void EnsureRadarMarkCount(int requiredCount)
{
while (radarMarks.Count < requiredCount)
{
GameObject radarMark = Instantiate(radarMarkPrefab.gameObject, transform);
PrepareRadarMark(radarMark);
radarMarks.Add(radarMark);
}
}
private static void PrepareRadarMark(GameObject radarMark)
{
MapTarget targetMovement = radarMark.GetComponent<MapTarget>();
if (targetMovement != null)
targetMovement.enabled = false;
foreach (Collider targetCollider in radarMark.GetComponentsInChildren<Collider>(true))
targetCollider.enabled = false;
foreach (Renderer targetRenderer in radarMark.GetComponentsInChildren<Renderer>(true))
targetRenderer.enabled = true;
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 168bf77c50d14e44a54a3a2e6717d012
@@ -1,88 +0,0 @@
using UnityEngine;
[DisallowMultipleComponent]
public sealed class MapTarget : MonoBehaviour
{
[Header("Map Position (Runtime)")]
[SerializeField] private Vector2 mapCoordinates;
private MapCoordinateSystem coordinateSystem;
private Vector2 movementDirection;
private float movementSpeed;
private bool isConfigured;
private Renderer[] targetRenderers;
public Vector2 MapCoordinates => mapCoordinates;
public MapCoordinateSystem CoordinateSystem => coordinateSystem;
public void Configure(
MapCoordinateSystem newCoordinateSystem,
Vector2 startCoordinates,
float newMovementSpeed,
Vector2 initialDirection)
{
coordinateSystem = newCoordinateSystem;
movementSpeed = Mathf.Max(0f, newMovementSpeed);
movementDirection = initialDirection.sqrMagnitude > Mathf.Epsilon
? initialDirection.normalized
: Vector2.right;
isConfigured = coordinateSystem != null && coordinateSystem.HasValidCorners();
SetMapCoordinates(startCoordinates);
}
private void Update()
{
if (!isConfigured || movementSpeed <= 0f)
return;
Vector2 nextCoordinates = mapCoordinates + movementDirection * (movementSpeed * Time.deltaTime);
ReflectAtMapBounds(ref nextCoordinates);
SetMapCoordinates(nextCoordinates);
}
public void SetMapCoordinates(Vector2 coordinates)
{
mapCoordinates = coordinateSystem != null
? coordinateSystem.ClampCoordinates(coordinates)
: new Vector2(
Mathf.Clamp(coordinates.x, 0f, MapCoordinateSystem.CoordinateMaximum),
Mathf.Clamp(coordinates.y, 0f, MapCoordinateSystem.CoordinateMaximum));
if (isConfigured)
transform.position = coordinateSystem.CoordinatesToWorldPosition(mapCoordinates);
}
public Vector2 GetMapCoordinates()
{
return mapCoordinates;
}
public void SetVisualsVisible(bool isVisible)
{
if (targetRenderers == null)
targetRenderers = GetComponentsInChildren<Renderer>(true);
foreach (Renderer targetRenderer in targetRenderers)
{
if (targetRenderer != null)
targetRenderer.enabled = isVisible;
}
}
private void ReflectAtMapBounds(ref Vector2 coordinates)
{
float maximum = MapCoordinateSystem.CoordinateMaximum;
if (coordinates.x < 0f || coordinates.x > maximum)
{
movementDirection.x = -movementDirection.x;
coordinates.x = Mathf.Clamp(coordinates.x, 0f, maximum);
}
if (coordinates.y < 0f || coordinates.y > maximum)
{
movementDirection.y = -movementDirection.y;
coordinates.y = Mathf.Clamp(coordinates.y, 0f, maximum);
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 2ae53f81d9ed4a0fb8d3496feac79ca1
@@ -1,113 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
[DisallowMultipleComponent]
public sealed class MapTargetController : MonoBehaviour
{
[Header("Target Settings")]
[SerializeField, Min(0)] private int targetCount = 5;
[SerializeField, Min(0f)] private float targetMovementSpeed = 1f;
private readonly List<MapTarget> targets = new();
private MapCoordinateSystem coordinateSystem;
private MapTarget targetPrefab;
private Transform targetParent;
private bool isConfigured;
public IReadOnlyList<MapTarget> Targets => targets;
public int TargetCount => targetCount;
public float TargetMovementSpeed => targetMovementSpeed;
private void OnValidate()
{
targetCount = Mathf.Max(0, targetCount);
targetMovementSpeed = Mathf.Max(0f, targetMovementSpeed);
}
public void Configure(
MapCoordinateSystem newCoordinateSystem,
MapTarget newTargetPrefab,
Transform newTargetParent)
{
coordinateSystem = newCoordinateSystem;
targetPrefab = newTargetPrefab;
targetParent = newTargetParent != null ? newTargetParent : transform;
isConfigured = coordinateSystem != null &&
coordinateSystem.HasValidCorners() &&
targetPrefab != null;
}
public void CreateAndPlaceTargets()
{
if (!isConfigured)
{
Debug.LogWarning("Target system is not configured.", this);
return;
}
RegisterExistingTargets();
while (targets.Count < targetCount)
{
MapTarget target = Instantiate(targetPrefab, targetParent);
target.name = $"Target_{targets.Count + 1}";
targets.Add(target);
}
while (targets.Count > targetCount)
{
int lastIndex = targets.Count - 1;
MapTarget target = targets[lastIndex];
targets.RemoveAt(lastIndex);
if (target != null)
Destroy(target.gameObject);
}
for (int index = 0; index < targets.Count; index++)
{
MapTarget target = targets[index];
if (target == null)
continue;
target.Configure(
coordinateSystem,
GetRandomCoordinates(),
targetMovementSpeed,
Random.insideUnitCircle.normalized);
target.SetVisualsVisible(false);
}
}
public void SetTargetVisualsVisible(bool isVisible)
{
foreach (MapTarget target in targets)
{
if (target != null)
target.SetVisualsVisible(isVisible);
}
}
public MapTarget GetTarget(int index)
{
return index >= 0 && index < targets.Count ? targets[index] : null;
}
private void RegisterExistingTargets()
{
targets.Clear();
MapTarget[] existingTargets = targetParent.GetComponentsInChildren<MapTarget>(true);
foreach (MapTarget target in existingTargets)
{
if (target != null && !targets.Contains(target))
targets.Add(target);
}
}
private static Vector2 GetRandomCoordinates()
{
float maximum = MapCoordinateSystem.CoordinateMaximum;
return new Vector2(Random.Range(0f, maximum), Random.Range(0f, maximum));
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 06d2f3ff739a4a4ca04d749ccf14fd9c
@@ -1,124 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4012125527390687084
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2929517388927179322}
- component: {fileID: 1898238889115289471}
- component: {fileID: 5321613745555827914}
- component: {fileID: 212733908007784450}
- component: {fileID: 878491239745611204}
m_Layer: 0
m_Name: TargetTest
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2929517388927179322
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4012125527390687084}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.42, y: 3.280054, z: 2.6187859}
m_LocalScale: {x: 0.39, y: 0.39, z: 0.39}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1898238889115289471
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4012125527390687084}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5321613745555827914
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4012125527390687084}
m_Enabled: 1
m_CastShadows: 1
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_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c57515654cf43eb4995ae19964d2ca0b, 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_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &212733908007784450
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4012125527390687084}
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: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &878491239745611204
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4012125527390687084}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2ae53f81d9ed4a0fb8d3496feac79ca1, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::MapTarget
mapCoordinates: {x: 0, y: 0}
@@ -1,137 +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: Crosshair
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: 8b6daeadfc1e345a792cbbff1ceeabb9, type: 3}
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}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0.632
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.106
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 0.9233861, b: 1, a: 1}
- _Color: {r: 0, g: 0.9233861, b: 1, a: 1}
- _EmissionColor: {r: 0.15221034, g: 1.493739, b: 1.5365998, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &3289058871599513036
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 22474510b3d8cc048bb0bc8679862784
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -1,117 +0,0 @@
fileFormatVersion: 2
guid: 71c6f8835ecab4c489ead4e40a5aafef
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -1,137 +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: Target
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: 8b6daeadfc1e345a792cbbff1ceeabb9, type: 3}
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}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0.632
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.106
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0.050980568, a: 1}
- _Color: {r: 1, g: 0, b: 0.050980546, a: 1}
- _EmissionColor: {r: 2.0907834, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &3289058871599513036
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: c57515654cf43eb4995ae19964d2ca0b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -1,137 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-4452286349835602218
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Test
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 1
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 0b8e0a594b1c84542b029378c039338e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5da4c81b147b7544e9cb44f942ad51f0 guid: 1d3dd768e3784bc6bc270a1ce57ce345
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
@@ -0,0 +1,29 @@
using UnityEngine;
[CreateAssetMenu(
fileName = "ItemProcessingRecipe",
menuName = "FORT-BO/Workstations/Item Processing Recipe")]
public sealed class ItemProcessingRecipe : ScriptableObject
{
[SerializeField] private string recipeId;
[SerializeField] private ItemDefinition inputItem;
[SerializeField] private ItemDefinition outputItem;
[SerializeField, Min(0.05f)] private float processingDuration = 3f;
public string RecipeId => recipeId;
public ItemDefinition InputItem => inputItem;
public ItemDefinition OutputItem => outputItem;
public float ProcessingDuration => processingDuration;
public bool Accepts(NetworkItem item)
{
if (item == null || item.Definition == null || inputItem == null)
return false;
return item.Definition == inputItem ||
(!string.IsNullOrEmpty(inputItem.ItemId) && item.ItemId == inputItem.ItemId);
}
private void OnValidate() =>
recipeId = recipeId?.Trim().ToLowerInvariant();
}
@@ -1,11 +1,11 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: f1eaeed1aba94e03b8f4b98a580444de guid: ea07d1502f6f4abc96ea949c7e688857
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
@@ -0,0 +1,124 @@
using UnityEngine;
using UnityEngine.Events;
[DisallowMultipleComponent]
public class ItemProcessingWorkstationView : MonoBehaviour
{
[SerializeField] private NetworkItemProcessingWorkstation workstation;
[Header("State Events")]
[SerializeField] private UnityEvent onEmpty;
[SerializeField] private UnityEvent onProcessingStarted;
[SerializeField] private UnityEvent onOutputReady;
[Header("Continuous Progress")]
[SerializeField] private UnityEvent<float> onProcessingProgress;
private ItemProcessingWorkstationState previousState;
private bool hasAppliedState;
public NetworkItemProcessingWorkstation Workstation => workstation;
protected virtual void Reset() =>
workstation = GetComponentInParent<NetworkItemProcessingWorkstation>();
protected virtual void Awake()
{
if (workstation == null)
workstation = GetComponentInParent<NetworkItemProcessingWorkstation>();
}
protected virtual void OnEnable()
{
if (workstation != null)
{
workstation.Changed += HandleWorkstationChanged;
ApplyState();
}
}
protected virtual void Start() => ApplyState();
protected virtual void OnDisable()
{
if (workstation != null)
workstation.Changed -= HandleWorkstationChanged;
hasAppliedState = false;
}
protected virtual void Update()
{
if (workstation != null &&
workstation.State == ItemProcessingWorkstationState.Processing)
{
onProcessingProgress?.Invoke(workstation.ProcessProgress);
}
}
protected virtual void HandleStateApplied(ItemProcessingWorkstationState state)
{
}
[ContextMenu("Preview/Empty")]
private void PreviewEmpty()
{
onProcessingProgress?.Invoke(0f);
onEmpty?.Invoke();
HandleStateApplied(ItemProcessingWorkstationState.Empty);
}
[ContextMenu("Preview/Processing Started")]
private void PreviewProcessingStarted()
{
onProcessingProgress?.Invoke(0f);
onProcessingStarted?.Invoke();
HandleStateApplied(ItemProcessingWorkstationState.Processing);
}
[ContextMenu("Preview/Processing 50 Percent")]
private void PreviewProcessingHalfway() => onProcessingProgress?.Invoke(0.5f);
[ContextMenu("Preview/Output Ready")]
private void PreviewOutputReady()
{
onProcessingProgress?.Invoke(1f);
onOutputReady?.Invoke();
HandleStateApplied(ItemProcessingWorkstationState.OutputReady);
}
private void HandleWorkstationChanged() => ApplyState();
private void ApplyState()
{
if (workstation == null || !workstation.IsSpawned)
return;
ItemProcessingWorkstationState currentState = workstation.State;
if (hasAppliedState && currentState == previousState)
return;
previousState = currentState;
hasAppliedState = true;
switch (currentState)
{
case ItemProcessingWorkstationState.Processing:
onProcessingStarted?.Invoke();
onProcessingProgress?.Invoke(workstation.ProcessProgress);
break;
case ItemProcessingWorkstationState.OutputReady:
onProcessingProgress?.Invoke(1f);
onOutputReady?.Invoke();
break;
default:
onProcessingProgress?.Invoke(0f);
onEmpty?.Invoke();
break;
}
HandleStateApplied(currentState);
}
}
@@ -1,11 +1,11 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7206111709094332bdc9b4c7c44695b4 guid: fddbd9f473234f27b85054ee55b89f69
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
@@ -0,0 +1,79 @@
using System.Collections.Generic;
using UnityEngine;
[DisallowMultipleComponent]
[RequireComponent(typeof(Collider))]
public sealed class NetworkItemInputSlot : MonoBehaviour
{
[SerializeField] private NetworkItemProcessingWorkstation workstation;
private readonly Dictionary<NetworkItem, HashSet<Collider>> overlaps = new();
private void Reset()
{
workstation = GetComponentInParent<NetworkItemProcessingWorkstation>();
GetComponent<Collider>().isTrigger = true;
}
private void Awake()
{
if (workstation == null)
workstation = GetComponentInParent<NetworkItemProcessingWorkstation>();
}
private void OnDisable() => overlaps.Clear();
private void OnTriggerEnter(Collider other)
{
RegisterOverlap(other);
TryAccept(other);
}
private void OnTriggerStay(Collider other)
{
RegisterOverlap(other);
TryAccept(other);
}
private void OnTriggerExit(Collider other)
{
if (workstation == null || !workstation.IsServer)
return;
NetworkItem item = other.GetComponentInParent<NetworkItem>();
if (item == null || !overlaps.TryGetValue(item, out HashSet<Collider> colliders))
return;
colliders.Remove(other);
if (colliders.Count > 0)
return;
overlaps.Remove(item);
workstation.NotifyItemExited(item);
}
private void TryAccept(Collider other)
{
if (workstation == null || !workstation.IsServer || !workstation.IsSpawned)
return;
NetworkItem item = other.GetComponentInParent<NetworkItem>();
if (item != null)
workstation.TryAcceptItem(item);
}
private void RegisterOverlap(Collider other)
{
NetworkItem item = other.GetComponentInParent<NetworkItem>();
if (item == null)
return;
if (!overlaps.TryGetValue(item, out HashSet<Collider> colliders))
{
colliders = new HashSet<Collider>();
overlaps.Add(item, colliders);
}
colliders.Add(other);
}
}
@@ -1,11 +1,11 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5a5f18d44c314323a2550f92ba7d988a guid: 67504197a13e4569ab17c8dcefaf8293
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
@@ -0,0 +1,236 @@
using System;
using Unity.Netcode;
using UnityEngine;
public enum ItemProcessingWorkstationState : byte
{
Empty,
Processing,
OutputReady
}
public sealed class NetworkItemProcessingWorkstation : NetworkWorkstationController
{
[Header("Recipe")]
[SerializeField] private ItemProcessingRecipe recipe;
[Header("Slot")]
[SerializeField] private Transform inputPoint;
private readonly NetworkVariable<ItemProcessingWorkstationState> state = new(
ItemProcessingWorkstationState.Empty,
NetworkVariableReadPermission.Everyone,
NetworkVariableWritePermission.Server);
private readonly NetworkVariable<double> processStartedAt = new(
0d,
NetworkVariableReadPermission.Everyone,
NetworkVariableWritePermission.Server);
private readonly NetworkVariable<double> processEndsAt = new(
0d,
NetworkVariableReadPermission.Everyone,
NetworkVariableWritePermission.Server);
private NetworkItem currentItem;
public override bool IsOperating => State == ItemProcessingWorkstationState.Processing;
public ItemProcessingWorkstationState State => state.Value;
public ItemProcessingRecipe Recipe => recipe;
public NetworkItem CurrentItem => currentItem;
public bool CanAcceptItem => IsServer && IsSpawned &&
State == ItemProcessingWorkstationState.Empty &&
recipe != null && recipe.InputItem != null &&
recipe.OutputItem != null && recipe.OutputItem.WorldPrefab != null;
public float ProcessProgress
{
get
{
if (State == ItemProcessingWorkstationState.OutputReady)
return 1f;
if (!IsOperating)
return 0f;
double duration = processEndsAt.Value - processStartedAt.Value;
if (duration <= 0d)
return 1f;
return Mathf.Clamp01((float)((GetNetworkTime() - processStartedAt.Value) / duration));
}
}
public float RemainingSeconds => !IsOperating
? 0f
: Mathf.Max(0f, (float)(processEndsAt.Value - GetNetworkTime()));
public event Action Changed;
public override void OnNetworkSpawn()
{
state.OnValueChanged += HandleStateChanged;
processStartedAt.OnValueChanged += HandleProcessTimeChanged;
processEndsAt.OnValueChanged += HandleProcessTimeChanged;
if (IsServer)
ResetWorkstationOnServer();
Changed?.Invoke();
}
public override void OnNetworkDespawn()
{
state.OnValueChanged -= HandleStateChanged;
processStartedAt.OnValueChanged -= HandleProcessTimeChanged;
processEndsAt.OnValueChanged -= HandleProcessTimeChanged;
}
private void Update()
{
if (!IsServer || !IsSpawned)
return;
if (State == ItemProcessingWorkstationState.Processing)
{
if (currentItem == null || !currentItem.IsSpawned)
{
ResetWorkstationOnServer();
return;
}
if (GetNetworkTime() >= processEndsAt.Value)
CompleteProcessingOnServer();
}
else if (State == ItemProcessingWorkstationState.OutputReady &&
(currentItem == null || !currentItem.IsSpawned))
{
ResetWorkstationOnServer();
}
}
private void LateUpdate()
{
if (!IsServer || !IsSpawned ||
State != ItemProcessingWorkstationState.Processing ||
currentItem == null || inputPoint == null)
{
return;
}
SnapToInputPoint(currentItem.transform);
}
public bool TryAcceptItem(NetworkItem item)
{
if (!CanAcceptItem || item == null || !item.IsSpawned || !recipe.Accepts(item))
return false;
NetworkCarryableInteractable carryable =
item.GetComponent<NetworkCarryableInteractable>();
if (carryable == null || !carryable.TryAcquireExternalControl())
return false;
currentItem = item;
SnapToInputPoint(item.transform);
double now = GetNetworkTime();
processStartedAt.Value = now;
processEndsAt.Value = now + recipe.ProcessingDuration;
state.Value = ItemProcessingWorkstationState.Processing;
Changed?.Invoke();
return true;
}
public void NotifyItemExited(NetworkItem item)
{
if (!IsServer || !IsSpawned ||
State != ItemProcessingWorkstationState.OutputReady ||
item == null || item != currentItem)
{
return;
}
ResetWorkstationOnServer();
}
private void CompleteProcessingOnServer()
{
if (currentItem == null || recipe == null ||
recipe.OutputItem == null || recipe.OutputItem.WorldPrefab == null)
{
ResetWorkstationOnServer();
return;
}
Transform slot = inputPoint != null ? inputPoint : transform;
Vector3 outputPosition = slot.position;
Quaternion outputRotation = slot.rotation;
NetworkObject inputObject = currentItem.NetworkObject;
currentItem = null;
if (inputObject != null && inputObject.IsSpawned)
inputObject.Despawn(true);
NetworkObject outputObject = Instantiate(
recipe.OutputItem.WorldPrefab,
outputPosition,
outputRotation);
outputObject.Spawn();
currentItem = outputObject.GetComponent<NetworkItem>();
if (currentItem == null ||
outputObject.GetComponent<NetworkCarryableInteractable>() == null)
{
Debug.LogError(
$"{name} cannot produce '{recipe.OutputItem.DisplayName}': " +
"the output prefab must contain NetworkItem and " +
"NetworkCarryableInteractable.",
this);
outputObject.Despawn(true);
currentItem = null;
ResetWorkstationOnServer();
return;
}
processStartedAt.Value = 0d;
processEndsAt.Value = 0d;
state.Value = ItemProcessingWorkstationState.OutputReady;
Changed?.Invoke();
}
private void ResetWorkstationOnServer()
{
if (!IsServer)
return;
if (State == ItemProcessingWorkstationState.Processing && currentItem != null &&
currentItem.TryGetComponent(out NetworkCarryableInteractable carryable))
{
carryable.TryReleaseExternalControl();
}
currentItem = null;
processStartedAt.Value = 0d;
processEndsAt.Value = 0d;
state.Value = ItemProcessingWorkstationState.Empty;
Changed?.Invoke();
}
private void SnapToInputPoint(Transform itemTransform)
{
Transform slot = inputPoint != null ? inputPoint : transform;
itemTransform.SetPositionAndRotation(slot.position, slot.rotation);
}
private double GetNetworkTime() => NetworkManager != null
? NetworkManager.ServerTime.Time
: Time.timeAsDouble;
private void HandleStateChanged(
ItemProcessingWorkstationState _,
ItemProcessingWorkstationState __) => Changed?.Invoke();
private void HandleProcessTimeChanged(double _, double __) => Changed?.Invoke();
}
@@ -1,11 +1,11 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7c020017978644e9be71242ece0e6011 guid: 90c3cd35b32140ac86dec106c4bb5035
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
defaultReferences: [] defaultReferences: []
executionOrder: 0 executionOrder: 0
icon: {instanceID: 0} icon: {instanceID: 0}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 985d88cac4b4daa48973a1a464a3d4e5 guid: 4ab7e2daaafed0749b50551d8715902a
PrefabImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:
assetBundleName: assetBundleName:
+20
View File
@@ -84,3 +84,23 @@ MonoBehaviour:
SourcePrefabToOverride: {fileID: 0} SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0 SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0} OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 4609832768900680681, guid: 5cf4d9e867c084847ba82c56bddc456b, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 2182525189444712253, guid: 7f5a91b903d654342bfb77c0b9126aa3, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 3006047789126627680, guid: 802af0722eb96ab46ae2cecf926bc6c9, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 9206541098482503491, guid: 29519dc5d2cfae441b261f3ca68f2290, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
+128
View File
@@ -1633,3 +1633,131 @@ Symbol file LoadedFromMemory is not a mono symbol file
[main 2026-08-11T13:56:24.373Z] update#setState checking for updates [main 2026-08-11T13:56:24.373Z] update#setState checking for updates
[main 2026-08-11T13:56:24.934Z] update#setState idle [main 2026-08-11T13:56:24.934Z] update#setState idle
Symbol file LoadedFromMemory is not a mono symbol file Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
[main 2026-08-11T14:58:24.308Z] update#setState checking for updates
[main 2026-08-11T14:58:24.868Z] update#setState idle
[main 2026-08-11T15:53:13.620Z] update#setState checking for updates
[main 2026-08-11T15:53:17.966Z] update#setState idle
[main 2026-08-11T16:51:42.901Z] update#setState checking for updates
[main 2026-08-11T16:51:47.046Z] update#setState idle
[main 2026-08-11T17:48:11.758Z] [CursorProclistService] Config enabled feature (subsample every 10s; memoryPressureMonitorEnabled=true)
[main 2026-08-11T17:51:46.979Z] update#setState checking for updates
[main 2026-08-11T17:51:47.511Z] update#setState idle
[main 2026-08-11T18:50:48.698Z] update#setState checking for updates
[main 2026-08-11T18:50:49.271Z] update#setState idle
[main 2026-08-11T18:59:29.824Z] [WorktreeCleanupMainService] Granted cleanup lease id=1 owner=window:1 reason="scheduled-worktree-cleanup"
[main 2026-08-11T18:59:34.828Z] [WorktreeCleanupMainService] Releasing cleanup lease id=1 owner=window:1 reason="scheduled-worktree-cleanup" releaseReason="released" heldForMs=5004
[main 2026-08-11T19:56:42.264Z] update#setState checking for updates
[main 2026-08-11T19:56:43.265Z] update#setState idle
[main 2026-08-11T20:52:22.556Z] update#setState checking for updates
[main 2026-08-11T20:52:23.946Z] update#setState idle
[main 2026-08-11T21:49:48.523Z] update#setState checking for updates
[main 2026-08-11T21:49:49.052Z] update#setState idle
[main 2026-08-11T22:46:15.604Z] update#setState checking for updates
[main 2026-08-11T22:46:16.129Z] update#setState idle
[main 2026-08-11T23:51:19.717Z] update#setState checking for updates
[main 2026-08-11T23:51:22.693Z] update#setState idle
[main 2026-08-12T00:48:34.377Z] update#setState checking for updates
[main 2026-08-12T00:48:37.209Z] update#setState idle
[main 2026-08-12T00:59:29.823Z] [WorktreeCleanupMainService] Granted cleanup lease id=2 owner=window:1 reason="scheduled-worktree-cleanup"
[main 2026-08-12T00:59:34.827Z] [WorktreeCleanupMainService] Releasing cleanup lease id=2 owner=window:1 reason="scheduled-worktree-cleanup" releaseReason="released" heldForMs=5004
[main 2026-08-12T01:48:43.467Z] update#setState checking for updates
[main 2026-08-12T01:48:43.989Z] update#setState idle
[main 2026-08-12T02:45:40.670Z] update#setState checking for updates
[main 2026-08-12T02:45:41.218Z] update#setState idle
[main 2026-08-12T03:44:45.205Z] update#setState checking for updates
[main 2026-08-12T03:44:50.429Z] update#setState idle
[main 2026-08-12T04:45:24.271Z] update#setState checking for updates
[main 2026-08-12T04:45:28.863Z] update#setState idle
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
[main 2026-08-12T05:49:25.533Z] update#setState checking for updates
[main 2026-08-12T05:49:26.070Z] update#setState idle
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
[main 2026-08-12T06:45:15.570Z] update#setState checking for updates
[main 2026-08-12T06:45:17.345Z] update#setState idle
[main 2026-08-12T06:59:29.825Z] [WorktreeCleanupMainService] Granted cleanup lease id=3 owner=window:1 reason="scheduled-worktree-cleanup"
[main 2026-08-12T06:59:34.828Z] [WorktreeCleanupMainService] Releasing cleanup lease id=3 owner=window:1 reason="scheduled-worktree-cleanup" releaseReason="released" heldForMs=5003
Symbol file LoadedFromMemory is not a mono symbol file
[main 2026-08-12T07:43:02.489Z] update#setState checking for updates
[main 2026-08-12T07:43:05.316Z] update#setState idle
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
[main 2026-08-12T08:45:05.944Z] update#setState checking for updates
[main 2026-08-12T08:45:06.490Z] update#setState idle
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
[main 2026-08-12T09:40:26.030Z] update#setState checking for updates
[main 2026-08-12T09:40:31.046Z] update#setState idle
Symbol file LoadedFromMemory is not a mono symbol file
Symbol file LoadedFromMemory is not a mono symbol file
abort_threads: Failed aborting id: 0000000000005198, mono_thread_manage will ignore it
abort_threads: Failed aborting id: 0000000000005408, mono_thread_manage will ignore it
abort_threads: Failed aborting id: 0000000000005198, mono_thread_manage will ignore it
abort_threads: Failed aborting id: 0000000000005408, mono_thread_manage will ignore it
Done
Done
Done
Done
Error reading command from socketError reading command from socketError reading command from socketError reading command from socketError reading command from socketError reading command from socketError reading command from socketError reading command from socketError reading command from socketError reading command from socket[main 2026-08-12T10:44:06.348Z] update#setState checking for updates
[main 2026-08-12T10:44:06.936Z] update#setState idle
[main 2026-08-12T11:47:53.297Z] update#setState checking for updates
[main 2026-08-12T11:47:53.846Z] update#setState idle
[main 2026-08-12T12:48:55.457Z] update#setState checking for updates
[main 2026-08-12T12:49:00.973Z] update#setState idle
[main 2026-08-12T12:59:30.201Z] [WorktreeCleanupMainService] Granted cleanup lease id=4 owner=window:1 reason="scheduled-worktree-cleanup"
[main 2026-08-12T12:59:36.169Z] [WorktreeCleanupMainService] Releasing cleanup lease id=4 owner=window:1 reason="scheduled-worktree-cleanup" releaseReason="released" heldForMs=5968
[main 2026-08-12T13:53:48.819Z] update#setState checking for updates
[main 2026-08-12T13:53:54.667Z] update#setState idle
[main 2026-08-12T14:54:19.552Z] update#setState checking for updates
[main 2026-08-12T14:54:24.633Z] update#setState idle
[main 2026-08-12T15:59:34.590Z] update#setState checking for updates
[main 2026-08-12T15:59:35.141Z] update#setState idle
[main 2026-08-12T16:55:04.018Z] update#setState checking for updates
[main 2026-08-12T16:55:04.565Z] update#setState idle
[main 2026-08-12T17:58:09.758Z] update#setState checking for updates
[main 2026-08-12T17:58:10.292Z] update#setState idle
[main 2026-08-12T18:54:24.027Z] update#setState checking for updates
[main 2026-08-12T18:54:24.658Z] update#setState idle
[main 2026-08-12T18:59:30.196Z] [WorktreeCleanupMainService] Granted cleanup lease id=5 owner=window:1 reason="scheduled-worktree-cleanup"
[main 2026-08-12T18:59:36.166Z] [WorktreeCleanupMainService] Releasing cleanup lease id=5 owner=window:1 reason="scheduled-worktree-cleanup" releaseReason="released" heldForMs=5970
[main 2026-08-12T19:50:42.539Z] update#setState checking for updates
[main 2026-08-12T19:50:45.988Z] update#setState downloading
[main 2026-08-12T19:51:03.312Z] update#setState downloaded
[main 2026-08-12T19:51:03.523Z] update#setState updating
[main 2026-08-12T19:51:33.712Z] update#setState ready
[main 2026-08-13T00:59:30.197Z] [WorktreeCleanupMainService] Granted cleanup lease id=6 owner=window:1 reason="scheduled-worktree-cleanup"
[main 2026-08-13T00:59:36.167Z] [WorktreeCleanupMainService] Releasing cleanup lease id=6 owner=window:1 reason="scheduled-worktree-cleanup" releaseReason="released" heldForMs=5970
[main 2026-08-13T05:22:24.497Z] update#recheckOutdatedUpdateOnResume - re-checking pending update freshness unlock-screen
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 01fc6a03af2e2c74a8ef1cd4a6f4ad5e guid: d9bd989d8fda8564eb25fc8a1f22a110
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d88efbc6589a4404caadb566c0e28842 guid: 934bb813ebad34517a1b22565370b2af
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fd35cb16d5e64408eb3f5b252bc0c154
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: