本文整理汇总了C#中Seeker.StartPath方法的典型用法代码示例。如果您正苦于以下问题:C# Seeker.StartPath方法的具体用法?C# Seeker.StartPath怎么用?C# Seeker.StartPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Seeker
的用法示例。
在下文中一共展示了Seeker.StartPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start ()
{
target = GameObject.Find("Player");
cachedTargetPosition = new Vector3(target.transform.position.x,target.transform.position.y,target.transform.position.z);
seeker = GetComponent<Seeker> ();
characterController = GetComponent<CharacterController>();
switch (currentMode) {
case MODE.STRAIGHT:
seeker.StartPath (this.transform.position, target.transform.position, OnPathComplete);
isSearching = true;
break;
case MODE.HUNT:
seeker.StartPath (this.transform.position, target.transform.position, OnPathComplete);
isSearching = true;
break;
case MODE.HIDE:
if(isInLOS()){
Vector3 hidingPoint = findHidingPoint();
seeker.StartPath (this.transform.position, hidingPoint, OnPathComplete);
isSearching = true;
};
break;
default:
break;
}
}
示例2: Start
public void Start ()
{
seeker = GetComponent<Seeker>();
body = GetComponent<Rigidbody2D>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
seeker.StartPath(body.position,target.position,OnPathComplete );
}
示例3: Start
void Start()
{
var distanceFirstPlayer = Vector3.Distance(firstPlayer.transform.position, transform.position);
var distanceSecondPlayer = Vector3.Distance(secondPlayer.transform.position, transform.position);
if (distanceFirstPlayer > distanceSecondPlayer)
{
target = secondPlayer;
}
else
{
target = firstPlayer;
}
startTime = Time.time;
seeker = GetComponent<Seeker>();
rb = GetComponent<Rigidbody2D>();
if (target == null)
{
Debug.Log("pesho");
return;
}
seeker.StartPath(transform.position, target.position, OnPathComplete);
StartCoroutine(UpdatePath());
}
示例4: Start
public void Start()
{
seeker = GetComponent<Seeker>();
controller = GetComponent<CharacterController>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
seeker.StartPath(transform.position, targetPosition, OnPathComplete);
}
示例5: Update
// Update is called once per frame
void Update () {
if(Vector3.Distance(transform.position,player.position)<10){
sighted = true;
target = player.position;
Debug.Log(sighted);
}
float distA = Vector3.Distance(transform.position,pointA.position);
float distB = Vector3.Distance(transform.position,pointB.position);
if(distA<2){
atA = true;
atB = false;
target = pointB.position;
}
if(distB<2){
atB = true;
atA = false;
target = pointA.position;
}
if(Time.time > curTime+waitTime){
seeker = GetComponent<Seeker>();
seeker.StartPath(transform.position,target,OnPathComplete);
charctlr = GetComponent<CharacterController>();
curTime = Time.time;
}
}
示例6: Start
// Use this for initialization
void Start () {
//target = GameObject.FindGameObjectWithTag("Target").transform;
seeker = GetComponent<Seeker>();
seeker.StartPath (transform.position, target.position, OnPathComplete);
}
示例7: Start
void Start () {
pathFinder = GetComponent<Seeker>();
pathFinder.StartPath(transform.position, SceneManager.Instance.creeperTargetPosition);
var waveMultiplier = 1 + (SceneManager.Instance.WaveCount / 5f);
life *= waveMultiplier;
GetComponent<AIPath>().speed *= waveMultiplier;
}
示例8: Start
// Use this for initialization
void Start()
{
oldPosition = targetPosition;
seeker = GetComponent<Seeker>();
StartCoroutine(repathTime());
seeker.StartPath(transform.position,GameObject.Find("Player").transform.position,OnPathComplete);
}
示例9: Start
public void Start () {
targetPosition = GameObject.FindGameObjectWithTag("Player").transform.position;
seeker = GetComponent<Seeker>();
controller = GetComponent<CharacterController>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
seeker.StartPath (transform.position,targetPosition, OnPathComplete);
}
示例10: Start
public void Start()
{
seeker = GetComponent<Seeker>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
if(path==null){
seeker.StartPath( transform.position, target.position, OnPathComplete );
}
}
示例11: Start
void Start()
{
seeker = GetComponent<Seeker>();
rb = GetComponent<Rigidbody2D>();
seeker.StartPath(transform.position, target.position, OnPathComplete);
StartCoroutine(UpdatePath());
}
示例12: Start
// Use this for initialization
void Start () {
if(targetTransform!=null)
target = targetTransform.position;
controller = GetComponent<CharacterController>();
//Get a reference to the seeker component we added earlier
seeker = GetComponent<Seeker>();
seeker.StartPath(transform.position,target,OnPathComplete);
}
示例13: Start
public void Start()
{
player = GameObject.FindWithTag("Player");
seeker = GetComponent<Seeker>();
//controller = GetComponent<CharacterController>();
//Start a new path to the targetPosition, return the result to the MyCompleteFunction
seeker.StartPath (transform.position,player.transform.position, MyCompleteFunction);
}
示例14: Start
public void Start () {
seeker = GetComponent<Seeker>();
controller = GetComponent<CharacterController>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
seeker.StartPath (transform.position,targetPosition.position, OnPathComplete);
InvokeRepeating ("Recalculate", 1.5f, 1.5f);
}
示例15: Start
// Use this for initialization
void Start()
{
targetPosition = tran.position;
seeker = GetComponent<Seeker>();
playerCenterY = transform.localPosition.y;
seeker.StartPath(transform.position, targetPosition, OnPathComplete);
}