Skip to content
Snippets Groups Projects
Commit d197177f authored by CUNIN Clemence's avatar CUNIN Clemence
Browse files

Fixed line mode prefab instanciation position

parent 98a75459
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bef838976e2f1f141a74c4f3545f83ac, type: 3}
m_Name:
m_EditorClassIdentifier:
IpAdress: 10.129.32.159
IpAdress: 10.129.32.241
--- !u!114 &1008238107981065913
MonoBehaviour:
m_ObjectHideFlags: 0
......
......@@ -17,7 +17,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &1638680199649653231
Transform:
m_ObjectHideFlags: 0
......
......@@ -3,6 +3,8 @@ using System.Collections.Generic;
using System;
using UnityEngine;
using UnityEngine.XR.MagicLeap;
using System.Text.RegularExpressions;
using Unity.Mathematics;
/// <summary>
/// The action class handle the AR projections
......@@ -359,8 +361,15 @@ public class Action : MonoBehaviour
// Configuring the LineRenderer for the current alert
LineRenderer lineRenderer = previousLine.GetComponent<LineRenderer>();
if (lineRenderer != null) {
lineRenderer.positionCount = 2;
lineRenderer.enabled = true; // Enable the LineRenderer
Vector3 lineStart = Camera.main.transform.position + Camera.main.transform.forward * 0.5f;
// Update the line renderer positions
lineRenderer.SetPositions(new Vector3[] { lineStart, SetupPos.GetAlertPos(alertId) });
previousLine.SetActive(true);
// Start the coroutine for the new or updated alert
currentCoroutine = StartCoroutine(UpdateLinePosition(lineRenderer, Camera.main, targetPos, alertId));
......@@ -592,7 +601,7 @@ public class Action : MonoBehaviour
map = Instantiate(prefab_map, canva.transform);
if (map != null) {
Debug.Log("Map instantiated successfully");
map.transform.localScale = new Vector3(5, 5, 5); /// Set the scale of the map
map.transform.localScale = new Vector3(3, 3, 3); /// Set the scale of the map
/// Add the spheres to the dictionary and list
/// Loop through the number of spheres and add them to the dictionary and list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment