Advertisement
Guest User

Untitled

a guest
May 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Paths : MonoBehaviour {
  5.    
  6.     public Material lineMaterial;
  7.     private LineRenderer[] lines;
  8.    
  9.     public Transform[] availableWays;
  10.  
  11.     private Transform thisTrans;
  12.    
  13.    
  14.     int pathCount = 0;
  15.    
  16.    
  17.     void Start()
  18.     {
  19.         thisTrans = transform;
  20.         pathCount = availableWays.Length;
  21.        
  22.         if( pathCount > 0 )
  23.         {
  24.            
  25.             lines = new LineRenderer[pathCount];
  26.            
  27.             for( int i=0;i<pathCount;i++ )
  28.             {
  29.                 DoStuffWithLineRenderer();
  30.             }
  31.            
  32.         }
  33.        
  34.        
  35.        
  36.        
  37.     }
  38.    
  39.     void Update()
  40.     {
  41.         /*
  42.         if( pathCount > 0 )
  43.         {
  44.             for( int i=0;i<pathCount;i++ )
  45.             {
  46.                 //draw lines
  47.                 line[i].SetPosition(0, thisTrans.position );
  48.                 line[i].SetPosition(1, availableWays[i].position );
  49.             }
  50.         }
  51.         */
  52.     }
  53.    
  54.    
  55.    
  56.    
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement