mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 14:44:17 +00:00
if there is only 1 player, always spawn him on the same place - no randomization
This commit is contained in:
parent
92508905a3
commit
f6833c31bf
1 changed files with 7 additions and 3 deletions
|
@ -87,9 +87,13 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
public static bool GetSpawnPositionFromFocus(Transform focusPos, out TransformDataStruct transformData)
|
||||
{
|
||||
transformData = new TransformDataStruct(
|
||||
focusPos.position + Random.insideUnitCircle.ToVector3XZ() * 15f,
|
||||
Quaternion.Euler(0f, Random.Range(0f, 360f), 0f));
|
||||
if (Player.AllPlayersList.Count <= 1)
|
||||
// if there is only 1 player, always spawn him on the same place - no randomization
|
||||
transformData = new TransformDataStruct(focusPos);
|
||||
else
|
||||
transformData = new TransformDataStruct(
|
||||
focusPos.position + Random.insideUnitCircle.ToVector3XZ() * 15f,
|
||||
Quaternion.Euler(0f, Random.Range(0f, 360f), 0f));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue