mirror of
				https://github.com/DerTyp7/traffic-unity.git
				synced 2025-10-31 05:37:07 +01:00 
			
		
		
		
	dfg
This commit is contained in:
		| @@ -9,8 +9,15 @@ public class TrafficNode : MonoBehaviour | ||||
|     [SerializeField] | ||||
|     private float speed = 5.0f; | ||||
|  | ||||
|  | ||||
|     public Color gizmoSphereColor = Color.green; | ||||
|  | ||||
|     private Street parentStreet; | ||||
|  | ||||
|     public float GetSpeed() { return speed; } | ||||
|     public List<TrafficNode> GetNextTrafficNodes() { return nextTrafficNodes; } | ||||
|     public void SetParentStreet(Street newParentStreet) { parentStreet = newParentStreet; } | ||||
|     public Street GetParentStreet() { return parentStreet; } | ||||
|  | ||||
|     public void AddNextNode(TrafficNode newNode) | ||||
|     { | ||||
| @@ -22,9 +29,20 @@ public class TrafficNode : MonoBehaviour | ||||
|         nextTrafficNodes.Remove(node); | ||||
|     } | ||||
|  | ||||
|     public void LateUpdate() | ||||
|     { | ||||
|         if (transform.parent != null) | ||||
|         { | ||||
|             Vector3 parentScale = transform.parent.lossyScale; | ||||
|             transform.localScale = new Vector3(1f / parentScale.x, 1f / parentScale.y, | ||||
|                     1f / parentScale.z); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     private void OnDrawGizmos() | ||||
|     { | ||||
|         Gizmos.color = Color.green; | ||||
|         Gizmos.color = gizmoSphereColor; | ||||
|         Gizmos.DrawSphere(transform.position, 0.2f); | ||||
|         foreach (TrafficNode node in nextTrafficNodes) | ||||
|         { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Janis
					Janis