// Use this for initialization public void Setup(LevelManager _lm, CollectiblePlaces _place) { base.Setup(_lm); collPlace = _place; PlaceCollectibleToGo = PlacesCollect.Panel; Pop(); value = LevelManager.GlobTuning.Gem_Value; }
// Use this for initialization public void Setup(LevelManager _lm, CollectiblePlaces _place) { base.Setup(_lm); thisType = partType.Spawner; collPlace = _place; name = "Gatepart|" + collPlace.name + Random.Range(0,100).ToString(); PlaceCollectibleToGo = PlacesCollect.Stargate; _animSpr = FETool.findWithinChildren(this.gameObject, "Part").GetComponentInChildren<OTAnimatingSprite>(); Taken = FETool.findWithinChildren(this.gameObject, "Taken").GetComponentInChildren<OTAnimatingSprite>(); Taken.alpha = 0f; Pop(); }
IEnumerator delayedSpawnGem(CollectiblePlaces _placeToSpawn) { yield return new WaitForSeconds(LocalTuning.Gem_SpawnRate); if (LevelManager.GAMESTATE != GameEventManager.GameState.GameOver) { _placeToSpawn.Spawn(this); } }
public void triggerSpawnGem(CollectiblePlaces _origin) { List<CollectiblePlaces> AllPlacesToSpawn = new List<CollectiblePlaces>(); CollectiblePlaces _chosen; foreach (CollectiblePlaces pl in collecPlaces) { AllPlacesToSpawn.Add(pl); AllPlacesToSpawn.Remove(_origin); } _chosen = tools.calculateFarSpawnPlace(ref AllPlacesToSpawn, _player); if (LevelManager.GAMESTATE != GameEventManager.GameState.GameOver && _chosen != null) { StartCoroutine(delayedSpawnGem(_chosen)); } }