Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removing warning when spawning powerups #90

Merged
merged 3 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ void Update()

GameObject powerUp = m_ObjectPool.GetNetworkObject(m_PowerupPrefab).gameObject;
powerUp.transform.position = pos;
powerUp.GetComponent<Powerup>().buffType.Value = (Buff.BuffType)Random.Range(0, (int)Buff.BuffType.Last);
powerUp.GetComponent<NetworkObject>().Spawn(true);
powerUp.GetComponent<Powerup>().buffType.Value = (Buff.BuffType)Random.Range(0, (int)Buff.BuffType.Last);
}

if (Asteroid.numAsteroids == 0)
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [unreleased] - yyyy-mm-dd

### 2DSpaceShooter

### Fixed
- Removing warning when spawning powerups (#90). Fixed the order in which powerups were spawned and when their NetworkVariable value was initialized. Now they are spawned beforehand.

## [1.1.0] - 2022-12-13

### Client Driven
Expand Down