Esempio n. 1
0
	public Centipede_list(ref GameObject _body_c, ref GameObject _head_c)
	{			
		list = null;
		aux = null;
		body_c = _body_c;
		head_c = _head_c;
	}
Esempio n. 2
0
	public Centipede_body(Centipede_body _prev, GameObject _body, Centipede_body _next, bool dH=true, bool dV=true)
	{
		prev = _prev;
		body = _body;
		next = _next;
		cDirH = dH;
		cDirV = dV;
	}
Esempio n. 3
0
	public Centipede_body()
	{
		prev = null;
		body = null;
		next = null;
		cDirH = true;
		cDirV = true;
		
	}
Esempio n. 4
0
	public void Centipede_init(GameObject dst)
	{
		float dx=30;
		float dy=-196.1f;
		int numNodes = 5;
		aux = null;
		for(int i=0; i<numNodes; i++)
		{
			list = new Centipede_body();
			
			///aux.set_next(ref );
			list.Set_next(ref aux);
			
			GameObject bd;// = new GameObject("centip_"+i);
			if(list.Get_next()==null)
			{
				headCentip = list;
				bd = (GameObject)Instantiate(head_c, new Vector3(dx,0,dy), Quaternion.identity);
				bd.name = "centip_head";
			}else{
				bd = (GameObject)Instantiate(body_c, new Vector3(dx,0,dy), Quaternion.identity);
				list.Get_next().Set_prev(ref list);
				bd.name = "centip_0";
			}
			//bd.name = "centip_"+i;			
			bd.transform.Rotate(0,180,0);
			bd.transform.parent = dst.transform;
			//Debug.Log(bd.transform.localPosition);
			list.Set_body(bd);
			
			
			aux = list;				
			dx -= 5.3f;
		}
		Debug.Log("++++++++++++++++++");
	}
Esempio n. 5
0
	public void Set_next(ref Centipede_body a){
		next = a;
	}
Esempio n. 6
0
	public void Set_prev(ref Centipede_body a){
		prev = a;
	}