forked from cgvr/DeltaVR
refactored model generation code out of test box into separate pipeline manager
This commit is contained in:
@@ -118,17 +118,18 @@ public class ArcheryRange : NetworkBehaviour
|
||||
|
||||
var randomPos = targetStartPosition.position + new Vector3(
|
||||
Random.Range(minRandomOffset.x, maxRandomOffset.x),
|
||||
(float)Math.Round(Random.Range(minRandomOffset.y, maxRandomOffset.y)),
|
||||
Random.Range(minRandomOffset.z, maxRandomOffset.z));
|
||||
(float) Math.Round(Random.Range(minRandomOffset.y, maxRandomOffset.y)),
|
||||
Random.Range(minRandomOffset.z, maxRandomOffset.z)
|
||||
);
|
||||
|
||||
var target = SpawnTarget(randomPos);
|
||||
|
||||
_targets.Add(target);
|
||||
}
|
||||
|
||||
private ArcheryTarget SpawnTarget(Vector3 randomPos)
|
||||
{
|
||||
var prefab = Instantiate(targetPrefab, randomPos, Quaternion.identity, null);
|
||||
// TODO: replace target prefab's child with the generated model
|
||||
ArcheryTarget target = prefab.GetComponent<ArcheryTarget>();
|
||||
target.endPosition = targetEndPosition.position;
|
||||
target.addScore = AddScore;
|
||||
@@ -148,7 +149,7 @@ public class ArcheryRange : NetworkBehaviour
|
||||
_targets = new List<ArcheryTarget>();
|
||||
if (_maxScore < _score) _maxScore = _score;
|
||||
|
||||
if(_presentPlayers.Count != 0) // If there are players in the area.
|
||||
if (_presentPlayers.Count != 0) // If there are players in the area.
|
||||
{
|
||||
// Gives the score to the player longest-lasting in the area. It would be better to give it to the player that fired the starting arrow, but I'm not spending 10 hours on this.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user