Skip to content
Snippets Groups Projects
Commit 8844d229 authored by LE-CUDENEC JOFFREY's avatar LE-CUDENEC JOFFREY
Browse files

Système de tracage racadrer par la caméra

parent fe95300a
1 merge request!38Système de tracage racadrer par la caméra
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
using UnityEngine; using UnityEngine;
using Mapbox.Utils;
public class RouteTracer : MonoBehaviour public class RouteTracer : MonoBehaviour
{ {
...@@ -51,8 +52,13 @@ public class RouteTracer : MonoBehaviour ...@@ -51,8 +52,13 @@ public class RouteTracer : MonoBehaviour
DrawLine(objA.transform.position, objB.transform.position, Color.cyan, 1f); DrawLine(objA.transform.position, objB.transform.position, Color.cyan, 1f);
} }
//Recalculer les position relative entre les 2 objets
GameObject.Find("Player").transform.position =
new Vector3(
(float)((GameObject.FindGameObjectWithTag("start_wp").transform.position.x + GameObject.FindGameObjectWithTag("end_wp").transform.position.x) / 2d),
GameObject.Find("Player").transform.position.y,
(float)((GameObject.FindGameObjectWithTag("start_wp").transform.position.z + GameObject.FindGameObjectWithTag("end_wp").transform.position.z) / 2d)
);
} }
void DrawLine(Vector3 start, Vector3 end, Color color, float width) void DrawLine(Vector3 start, Vector3 end, Color color, float width)
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment