23 lines
636 B
C#
23 lines
636 B
C#
|
|
using UnityEngine;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using System.Linq;
|
||
|
|
|
||
|
|
public class HidingPlaceManager : MonoBehaviour
|
||
|
|
{
|
||
|
|
public static HidingPlaceManager Instance { get; private set; }
|
||
|
|
|
||
|
|
// Az összes pályán lévő rejtekhely
|
||
|
|
private HidingSpot[] allHidingSpots;
|
||
|
|
|
||
|
|
private void Awake()
|
||
|
|
{
|
||
|
|
Instance = this;
|
||
|
|
allHidingSpots = FindObjectsOfType<HidingSpot>();
|
||
|
|
}
|
||
|
|
|
||
|
|
// A rendőrök ezt hívják meg, amikor bejönnek
|
||
|
|
public List<HidingSpot> GetSpotsForPoliceToCheck()
|
||
|
|
{
|
||
|
|
return allHidingSpots.OrderBy(x => Random.value).Take(Mathf.Max(1, allHidingSpots.Length / 3)).ToList();
|
||
|
|
}
|
||
|
|
}
|