当前位置: 首页>>代码示例>>C#>>正文


C# Seeker.StartPath方法代码示例

本文整理汇总了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;
		}
	}
开发者ID:BjarkeHou,项目名称:AIMove,代码行数:26,代码来源:AI_Move.cs

示例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 );
 }
开发者ID:Kostas333,项目名称:PiratesDemo,代码行数:7,代码来源:AstarAI.cs

示例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());

    }
开发者ID:Hris21,项目名称:Flaminis,代码行数:29,代码来源:EnemyAi.cs

示例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);
 }
开发者ID:Super-Goat-Herders,项目名称:ProjectGoat,代码行数:7,代码来源:AiStar4.cs

示例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;
		}
	}
开发者ID:kxh337,项目名称:Sephone,代码行数:26,代码来源:GhostTwoPoint.cs

示例6: Start

	// Use this for initialization
	void Start () {

		//target = GameObject.FindGameObjectWithTag("Target").transform;
		seeker = GetComponent<Seeker>();

		seeker.StartPath (transform.position, target.position, OnPathComplete);
	}
开发者ID:JoshuaManricks,项目名称:Orbital,代码行数:8,代码来源:SeekerMissile.cs

示例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;
    }
开发者ID:legionaryu,项目名称:Atom-defender,代码行数:7,代码来源:Creeper.cs

示例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);
 }
开发者ID:hosfordryan,项目名称:Rougelike,代码行数:8,代码来源:EnemyAI.cs

示例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);
	}
开发者ID:NearSingularity,项目名称:TyperTD,代码行数:8,代码来源:TestScript.cs

示例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 );
        }
    }
开发者ID:hosfordryan,项目名称:PapasCabin,代码行数:9,代码来源:AILerp.cs

示例11: Start

    void Start()
    {
        seeker = GetComponent<Seeker>();
        rb = GetComponent<Rigidbody2D>();

        seeker.StartPath(transform.position, target.position, OnPathComplete);

        StartCoroutine(UpdatePath());
    }
开发者ID:flaviold,项目名称:PG2D,代码行数:9,代码来源:AstarTest.cs

示例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);
	}
开发者ID:JoseRego,项目名称:summer-rush,代码行数:10,代码来源:TesteAStar.cs

示例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);
    }
开发者ID:spyrosgames,项目名称:PyramidsValley,代码行数:9,代码来源:AstarAI.cs

示例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);

    }
开发者ID:CarlosMeloStuff,项目名称:EchoLocation,代码行数:9,代码来源:AstarAI.cs

示例15: Start

    // Use this for initialization
    void Start()
    {
        targetPosition = tran.position;

        seeker = GetComponent<Seeker>();

        playerCenterY = transform.localPosition.y;

        seeker.StartPath(transform.position, targetPosition, OnPathComplete);
    }
开发者ID:txdtxd,项目名称:text,代码行数:11,代码来源:Move.cs


注:本文中的Seeker.StartPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。