forked from cgvr/DeltaVR
use voice transcription box and model gen box in archery range
This commit is contained in:
@@ -26,6 +26,7 @@ public class ArcheryRange : NetworkBehaviour
|
||||
public float roundLength = 60f;
|
||||
public float targetSpawnTime = 3f;
|
||||
|
||||
public ModelGenerationBox modelGenerationBox;
|
||||
public KeyboardManager keyboardManager;
|
||||
|
||||
private List<ArcheryTarget> _targets;
|
||||
@@ -37,8 +38,6 @@ public class ArcheryRange : NetworkBehaviour
|
||||
private float _nextTargetTime;
|
||||
private bool _roundActive;
|
||||
|
||||
private string targetModelName;
|
||||
|
||||
private readonly List<XROrigin> _presentPlayers = new();
|
||||
|
||||
private XROrigin _scoredPlayer;
|
||||
@@ -132,7 +131,8 @@ public class ArcheryRange : NetworkBehaviour
|
||||
async private Task<ArcheryTarget> SpawnTarget(Vector3 randomPos)
|
||||
{
|
||||
var targetObject = Instantiate(targetPrefab, randomPos, Quaternion.identity, null);
|
||||
GameObject targetReplacement = await PipelineManager.Instance.SpawnModel(targetModelName);
|
||||
string targetModelPath = modelGenerationBox.LastModelPath;
|
||||
GameObject targetReplacement = await PipelineManager.Instance.SpawnModel(targetModelPath);
|
||||
// TODO: replace target prefab's child with the generated model
|
||||
targetReplacement.transform.parent = targetObject.transform;
|
||||
targetReplacement.transform.position = targetObject.transform.position;
|
||||
@@ -183,12 +183,10 @@ public class ArcheryRange : NetworkBehaviour
|
||||
SetTimeLeftText("");
|
||||
}
|
||||
|
||||
async public void StartRound()
|
||||
public void StartRound()
|
||||
{
|
||||
if (!IsServer) return;
|
||||
|
||||
targetModelName = await PipelineManager.Instance.GenerateModelAsync("unicorn with golden horn and long fluffy tail and butterfly wings");
|
||||
|
||||
_roundEndTime = Time.time + roundLength;
|
||||
_nextTargetTime = Time.time;
|
||||
_roundActive = true;
|
||||
|
||||
Reference in New Issue
Block a user