// Update is called once per frame void Update() { if (enableAutomaticSpawn) { if (Random.Range(1, (ruleAndUi.GetSpawnRate())) == Random.Range(1, (ruleAndUi.GetSpawnRate()))) { SpawnNow(); } } }
// Use this for initialization void Start() { ResourcesMoney = GameObject.Find("ResourcesMoney").GetComponent <Text>(); MoneyText = GameObject.Find("MoneyText").GetComponent <Text>(); ScoreHolderGameObject = GameObject.Find("ScoreHolderGameObject"); score = ScoreHolderGameObject.GetComponent <ScoreHolder>(); soundManagement = GameObject.Find("GameplaySoundManagementGameObject"); gs = soundManagement.GetComponent <GameplaySoundMangement>(); ruleAndUi = GameObject.Find("GamePlayUIandRuleManagement").GetComponent <OptionSetting>(); SpawnRate = SpawnRate + ruleAndUi.GetSpawnRate(); }