当前位置:网站首页>Judge the position of the monster in the role under unity3d

Judge the position of the monster in the role under unity3d

2022-07-05 04:54:00 yaohuiyaoo

1.AudioSource Used to obtain audio components
2.AudioClip Audio path
3.Resources.Load() Dynamically load audio
3.aduio.PlayOneShot(clip) Play the audio once
4.audio.play() Play the audio
5.Invoke(“ Method name ”, Time ) How many times will it be called
6.InvokeRepeating(“ Method name ”, Time , Time ) How often is it called , After a call , How many seconds does it take to call
7.Vector3.Dot( In front of the player , Enemy coordinates - Player coordinates );// Multiply two points
Be careful : After multiplication, the enemy is greater than zero in front of the player , Less than zero enemies are behind the player
8.Vector3.Cross( Enemy coordinates , Player coordinates )// Return to coordinates
notes :Vector3 pos=Vector3.Cross(enemy.position,transform.position)
pos.x=enemy.position.ytransfrom.positon.z-enemy.position.ztransfrom.positon.y;
pos.y=enemy.positon.xtransfrom.position.z-enemy.position.ztransfrom.positon.x;
pos.z=enemy.position.xtransfrom.position.y-enemy.position.ytransfrom.position.x;
If pos.y Less than 0, The enemy is on the left of the player

原网站

版权声明
本文为[yaohuiyaoo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140626298923.html