//Looks for the next nav point along the navigation path
 public void GetNextNavPoint()
 {
     pathCount = (pathCount + 1);
     if (pathCount >= path.Length)
     {
         pathCount = 0;
     }
     ai.SetTarget(path[pathCount].transform);
 }
Esempio n. 2
0
//	public void SetTimeN(float currentTime){
//		if(!init){
//			if(WpresentFrom < WpresentTo){
//				if(WpresentFrom < currentTime){
//					if(currentTime < WpresentTo){
//					} else {
//						gameObject.SetActive(false);
//					}
//				} else {
//					gameObject.SetActive(false);
//				}
//			} else {
//				if(currentTime < WpresentTo){
//				} else {
//					gameObject.SetActive(false);
//				}
//			}
//			init = true;
//		}
//	}

    public void SetRandomDestination()
    {
        if (_AIController != null)
        {
            GameObject newTarget = GameSettings.GetRandomTarget();

            if (newTarget != null && _AIController.isActiveAndEnabled)
            {
//				Debug.Log(gameObject.name + " is now moving toward " + newTarget.gameObject.name);
                _AIController.SetTarget(newTarget.transform);
            }
        }
    }
Esempio n. 3
0
    //setting object to target
    public void SetNewTarget(string thingToTarget)
    {
        Transform target = this.transform;

        if (thingToTarget == "Player")
        {
            target = enemyToChase.transform;
        }

        else if (thingToTarget == "Patrol")
        {
            int i = UnityEngine.Random.Range(0, navPoints.Length);
            target    = navPoints[i].transform;
            targetSet = true;
        }
        else if (thingToTarget == "None")
        {
            target    = this.transform;
            targetSet = true;
        }

        ai.SetTarget(target);
    }
Esempio n. 4
0
 public void GoToPosition(Transform position)
 {
     StandardIAControl.SetTarget(position);
     StartCoroutine(TestIfStopped());
 }
Esempio n. 5
0
 void TargetTV()
 {
     selfLargeAI.SetTarget(tv.transform);
 }