Exemplo n.º 1
0
 public NetworkNodeAsset(NetworkAsset network, CollectionAsset collection) : base(collection)
 {
     x            = y = z = 0.0f;
     connections  = new ConnectionAsset[0];
     enabled      = true;
     this.network = network;
 }
Exemplo n.º 2
0
 public NetworkAsset(string name, CollectionAsset collection) : base(collection)
 {
     this.name = name;
     x         = y = z = 0;
     sX        = sY = sZ = 10.0f;
     enabled   = true;
 }
Exemplo n.º 3
0
		public WaypointAsset( string name, Vector3 position, float radius, NetworkAsset network, CollectionAsset collection ) : base( network, collection )
		{
			this.Name = name;
			this.Position = position;
			this.radius = radius;
			disableRuntime = true;
		}
Exemplo n.º 4
0
		public NetworkNodeAsset( NetworkAsset network, CollectionAsset collection ) : base( collection )
		{
			x = y = z = 0.0f;
			connections = new ConnectionAsset[ 0 ];
			enabled = true;
			this.network = network;
		}
Exemplo n.º 5
0
		public NetworkAsset( string name, CollectionAsset collection ) : base( collection )
		{
			this.name = name;
			x = y = z = 0;
			sX = sY = sZ = 10.0f;
			enabled = true;
		}
Exemplo n.º 6
0
		public ConnectionAsset( NetworkNodeAsset from, NetworkNodeAsset to, float width, CollectionAsset collection ) : base( collection )
		{
			this.from = from;
			this.to = to;
			this.width = width;
			this.enabled = true;
			this.weightFactor = 1.0f;
		}
Exemplo n.º 7
0
        public bool LoadCollection(IPathAsset asset)
        {
            CollectionAsset collection;

            if (asset == null)
            {
                return(false);
            }

            collection = CollectionAsset.LoadFromData(asset.Data, asset);

            foreach (NetworkAsset network in collection.Networks)
            {
                networks.Add(network);
            }

            Debug.Log("AngryAnt " + Resources.Version + " - loaded collection. Network count now up to " + networks.Count + ".");

            return(true);
        }
Exemplo n.º 8
0
		//private Edge[] border;
		
		
		
		public CellAsset( string name, Vector3 position, TriangleAsset[] triangles, NetworkAsset network, CollectionAsset collection ) : base( network, collection )
		{
			this.Name = name;
			this.Position = position;
			
			foreach( TriangleAsset triangle in triangles )
			{
				triangle.Cell = this;
			}
			
			this.triangles = triangles;
			
			// TODO: Calculate border and position from triangles
			
			/*ArrayList edges, uses;
			Edge edge, existingEdge;
			
			edges = new ArrayList();
			uses = new ArrayList();
			
			foreach( TriangleAsset triangle in triangles )
			{
				for( int i = 0; i < 3; i++ )
				{
					edge = 	( i == 0 ) ? new Edge( triangle.Points[ 0 ], triangles.Points[ 1 ] ) :
							( i == 1 ) ? new Edge( triangle.Points[ 1 ], triangles.Points[ 2 ] ) :
							new Edge( triangle.Points[ 2 ], triangles.Points[ 0 ] );
							
					for( int j = 0; j < edges.Count; j++ )
					{
						existingEdge = edges[ j ];
						
						if( edge.Equals( existingEdge ) )
						{
							uses[ edges.IndexOf( existingEdge ) ]++;
						}
					}
				}
			}*/
		}
Exemplo n.º 9
0
		public void LoadCollection( IPathAsset asset )
		{
			Asset = asset;
			Collection = CollectionAsset.LoadFromData( Asset.Data, Asset );
		}
Exemplo n.º 10
0
 public TaggedAsset(CollectionAsset collection)
 {
     this.collection = collection;
     tags            = new int[0];
 }
Exemplo n.º 11
0
 public void SaveCollection(CollectionAsset collectionAsset, IPathAsset pathAsset)
 {
     editorWindow.SaveCollection(collectionAsset, pathAsset);
 }
Exemplo n.º 12
0
 public WaypointAsset(string name, Vector3 position, float radius, NetworkAsset network, CollectionAsset collection) : base(network, collection)
 {
     this.Name      = name;
     this.Position  = position;
     this.radius    = radius;
     disableRuntime = true;
 }
Exemplo n.º 13
0
 public GridNetworkAsset(string name, CollectionAsset collection) : base(name, collection)
 {
     nodes = new GridNodeAsset[0];
 }
Exemplo n.º 14
0
		public WaypointNetworkAsset( string name, CollectionAsset collection ) : base( name, collection )
		{
			waypoints = new WaypointAsset[ 0 ];
		}
Exemplo n.º 15
0
 public WaypointNetworkAsset(string name, CollectionAsset collection) : base(name, collection)
 {
     waypoints = new WaypointAsset[0];
 }
Exemplo n.º 16
0
 public void SaveCollection( CollectionAsset collectionAsset, IPathAsset pathAsset )
 {
     editorWindow.SaveCollection( collectionAsset, pathAsset );
 }
Exemplo n.º 17
0
        //private Edge[] border;



        public CellAsset(string name, Vector3 position, TriangleAsset[] triangles, NetworkAsset network, CollectionAsset collection) : base(network, collection)
        {
            this.Name     = name;
            this.Position = position;

            foreach (TriangleAsset triangle in triangles)
            {
                triangle.Cell = this;
            }

            this.triangles = triangles;

            // TODO: Calculate border and position from triangles

            /*ArrayList edges, uses;
             * Edge edge, existingEdge;
             *
             * edges = new ArrayList();
             * uses = new ArrayList();
             *
             * foreach( TriangleAsset triangle in triangles )
             * {
             *      for( int i = 0; i < 3; i++ )
             *      {
             *              edge =  ( i == 0 ) ? new Edge( triangle.Points[ 0 ], triangles.Points[ 1 ] ) :
             *                              ( i == 1 ) ? new Edge( triangle.Points[ 1 ], triangles.Points[ 2 ] ) :
             *                              new Edge( triangle.Points[ 2 ], triangles.Points[ 0 ] );
             *
             *              for( int j = 0; j < edges.Count; j++ )
             *              {
             *                      existingEdge = edges[ j ];
             *
             *                      if( edge.Equals( existingEdge ) )
             *                      {
             *                              uses[ edges.IndexOf( existingEdge ) ]++;
             *                      }
             *              }
             *      }
             * }*/
        }
Exemplo n.º 18
0
 public ConnectionAsset(NetworkNodeAsset from, NetworkNodeAsset to, float width, CollectionAsset collection) : base(collection)
 {
     this.from         = from;
     this.to           = to;
     this.width        = width;
     this.enabled      = true;
     this.weightFactor = 1.0f;
 }
Exemplo n.º 19
0
		public GridNodeAsset( string name, GridNetworkAsset network, CollectionAsset collection ) : base( network, collection )
		{
			this.Name = name;
		}
Exemplo n.º 20
0
 public void LoadCollection(IPathAsset asset)
 {
     Asset      = asset;
     Collection = CollectionAsset.LoadFromData(Asset.Data, Asset);
 }
Exemplo n.º 21
0
 public WaypointNetworkAsset( string name, CollectionAsset collection )
     : base(name, collection)
 {
     Clear();
 }
Exemplo n.º 22
0
 public void SaveCollection( CollectionAsset collectionAsset, IPathAsset pathAsset )
 {
     pathAsset.Data = collectionAsset.GetData();
     EditorUtility.SetDirty( ( PathAsset )pathAsset );
 }
Exemplo n.º 23
0
 public NavmeshAsset(string name, CollectionAsset collection) : base(name, collection)
 {
     cells = new CellAsset[0];
 }
Exemplo n.º 24
0
 public GridNodeAsset(string name, GridNetworkAsset network, CollectionAsset collection) : base(network, collection)
 {
     this.Name = name;
 }
Exemplo n.º 25
0
		public GridNetworkAsset( string name, CollectionAsset collection ) : base( name, collection )
		{
			nodes = new GridNodeAsset[ 0 ];
		}
Exemplo n.º 26
0
		public TaggedAsset( CollectionAsset collection )
		{
			this.collection = collection;
			tags = new int[ 0 ];
		}
Exemplo n.º 27
0
		public NavmeshAsset( string name, CollectionAsset collection ) : base( name, collection )
		{
			cells = new CellAsset[ 0 ];
		}