private void Awake() { triggerCollider = GetComponent<SphereCollider>(); triggerCollider.enabled = Enabled; tracker = GetComponentInChildren<CollectibleTracker>(); SceneManager.CollectibleCount++; }
private void Awake() { triggerCollider = GetComponent <SphereCollider>(); triggerCollider.enabled = Enabled; tracker = GetComponentInChildren <CollectibleTracker>(); SceneManager.CollectibleCount++; }
private void Awake() { _shiftable = GetComponent<Shiftable>(); _rotateSpeed = Random.insideUnitSphere * RotateSpeed; _destructor = GetComponent<SelfDestructor>(); _lifeTimeCooldown = Random.Range(MinLifetime, MaxLifetime); _fadeCooldown = FadeTime; _collectibleTracker = GetComponent<CollectibleTracker>(); }
public IEnumerator StartSpawningLevelCollectibles( Vector3 pos, Palette palette, CollectibleTracker tracker ) { int collectibleCount = GetNumCollectiblesToSpawn(); _scores.ReportSpawnSiteCollectibles( collectibleCount ); for( int i = 0; i < collectibleCount; i++ ) { //TODO need to set palette. Collectible newCollectible = SpawnCollectible( pos ); newCollectible.palette = palette; newCollectible.tracker = tracker; tracker.AddCollectible( newCollectible ); if ( i == collectibleCount - 1 ) { tracker.SetAllCollectiblesSpawned(); } yield return new WaitForSeconds( _collectibleSpawnTime ); } }