コード例 #1
0
ファイル: AIFlee.cs プロジェクト: Devonlg98/IntroToC-
 void Movement()
 {
     v                   = ((transform.position - enemyTarget.position) * maxVelocity).normalized;
     force               = v - CurrentVelocity;
     CurrentVelocity    += force * Time.deltaTime;
     transform.position += CurrentVelocity * Time.deltaTime;
     aiMan.mass          = aiMan.startMass;
     aiMan.maxSpeed      = aiMan.startMaxSpeed;
     aiMan.AiSteer(v);
 }
コード例 #2
0
ファイル: AISeek.cs プロジェクト: Devonlg98/IntroToC-
 void Movement()
 {
     //Not needed can fix, look into Djikastro/navmesh
     v                   = ((tmpTarget.position + aiEnem.velocity - transform.position) * maxVelocity).normalized;
     force               = v - CurrentVelocity;
     CurrentVelocity    += force * Time.deltaTime;
     transform.position += CurrentVelocity * Time.deltaTime;
     aiMan.mass          = aiMan.startMass;
     aiMan.AiSteer(v);
 }
コード例 #3
0
ファイル: AIWander.cs プロジェクト: Devonlg98/IntroToC-
 // Update is called once per frame
 void Update()
 {
     v                   = ((transform.position) * maxVelocity);
     force               = v - CurrentVelocity;
     CurrentVelocity    += force * Time.deltaTime;
     transform.position += CurrentVelocity * Time.deltaTime;
     aiMan.AiSteer(v);
 }
コード例 #4
0
ファイル: BasicSeek.cs プロジェクト: Devonlg98/IntroToC-
 void Seek()
 {
     v                   = ((tmpTarget.position - transform.position) * maxVelocity).normalized;
     force               = v - CurrentVelocity;
     CurrentVelocity    += force * Time.deltaTime;
     transform.position += CurrentVelocity * Time.deltaTime;
     aiMan.AiSteer(v);
 }