mirror of
https://github.com/celisej567/forest.git
synced 2026-09-11 20:09:34 +03:00
26 lines
693 B
C#
26 lines
693 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class GameRules : MonoBehaviour
|
|
{
|
|
public int MaxLevelSticks;
|
|
[HideInInspector] public GameObject[] SticksInWorld;
|
|
[HideInInspector] public GameObject[] stickSpawner;
|
|
StickSpawner bebra;
|
|
void Start()
|
|
{
|
|
stickSpawner = GameObject.FindGameObjectsWithTag("Spawner");
|
|
|
|
}
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
SticksInWorld = GameObject.FindGameObjectsWithTag("stick");
|
|
if (MaxLevelSticks > SticksInWorld.Length)
|
|
{
|
|
stickSpawner[Random.Range(0, stickSpawner.Length)].GetComponent<StickSpawner>().CreateStick();
|
|
}
|
|
}
|
|
}
|