Advertisement
Guest User

Untitled

a guest
May 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Paths : MonoBehaviour {
  5.    
  6.     public Material lineMaterial;
  7.     private ArrayList lines = new ArrayList();
  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.        
  23.        
  24.         if( pathCount > 0 )
  25.         {
  26.            
  27.            
  28.            
  29.             for( int i=0;i<pathCount;i++ )
  30.             {
  31.                 LineRenderer tmp = new LineRenderer();
  32.                 //tmp = this.gameObject.AddComponent (typeof(LineRenderer)) as LineRenderer;
  33.                
  34.                 tmp.SetWidth( 0.3f,0.3f );
  35.                 //tmp.SetVertexCount(2);
  36.                 //tmp.renderer.enabled = true;
  37.                
  38.                 lines.Add( tmp );
  39.             }
  40.            
  41.         }
  42.        
  43.        
  44.        
  45.        
  46.     }
  47.    
  48.     void Update()
  49.     {
  50.         /*
  51.         if( pathCount > 0 )
  52.         {
  53.             for( int i=0;i<pathCount;i++ )
  54.             {
  55.                 //draw lines
  56.                 line[i].SetPosition(0, thisTrans.position );
  57.                 line[i].SetPosition(1, availableWays[i].position );
  58.             }
  59.         }
  60.         */
  61.     }
  62.    
  63.    
  64.    
  65.    
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement