Пример #1
0
    public int CalcNewPathDist()
    {
        Path p = seeker.GetNewPath(transform.position, targetPosition);

        print("PathNodeCompacity: " + p.vectorPath.Capacity);
        return(p.vectorPath.Capacity);
    }
Пример #2
0
 static int GetNewPath(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         Seeker obj = (Seeker)ToLua.CheckObject <Seeker>(L, 1);
         UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2);
         UnityEngine.Vector3 arg1 = ToLua.ToVector3(L, 3);
         Pathfinding.ABPath  o    = obj.GetNewPath(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #3
0
	void OnEnable()
	{
		//int i = Random.Range(0, sprites.Length);

		//GetComponentInChildren<SpriteRenderer>().sprite = sprites[i];
	
		GenerateNewWord();
		float r = Random.Range(-10.0f, 10.0f);
		//spawn at random point at the top of the screen.
		m_Pos = new Vector3(r, .75f, 2);
		m_Target = GameObject.FindGameObjectWithTag("Player").transform.position;
		transform.position = m_Pos;

		//StartCoroutine ("GetCompon");
		seek = GetComponent<Seeker> ();
		//ask instead of being told.
		seek.GetNewPath (m_Pos, m_Target);
	}
Пример #4
0
 public void Repath()
 {
     if(target != null)
     {
         //Debug.Log(transform.position+" : "+target.transform.position);
         targetPosition = target.transform.position;
         seeker = GetComponent<Seeker>();
         Path p = seeker.GetNewPath (transform.position, target.transform.position);
         seeker.StartPath (p, OnPathComplete);
     }
 }