25 lines
696 B
C#
25 lines
696 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Mirror;
|
|
|
|
public class MinigameManager : NetworkBehaviour
|
|
{
|
|
|
|
public void SetRespawn(GameObject player){
|
|
StartCoroutine(setRespawn(player));
|
|
}
|
|
|
|
IEnumerator setRespawn(GameObject player){
|
|
if(isServer){
|
|
player.SetActive(false);
|
|
yield return new WaitForSeconds(3);
|
|
Vector3 RespawnPoint = NetworkManager.startPositions[Random.Range(0, NetworkManager.startPositions.Count-1)].position;
|
|
|
|
player.GetComponent<SpaceshipController>().Respawn(RespawnPoint);
|
|
}else{
|
|
yield return new WaitForSeconds(1);
|
|
}
|
|
}
|
|
}
|