more wires to archery range, connecting buttons
This commit is contained in:
@@ -20,11 +20,14 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
|
||||
public Transform wire;
|
||||
public Material wireActiveMaterial;
|
||||
|
||||
private bool modelGenerationInProgress;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
imageGenerationButton.OnButtonPressed += InvokeImageGeneration;
|
||||
modelGenerationButton.OnButtonPressed += InvokeModelGeneration;
|
||||
modelGenerationInProgress = false;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -47,11 +50,16 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
|
||||
Sprite sprite = CreateSprite(GeneratedTexture);
|
||||
imageDisplay.sprite = sprite;
|
||||
|
||||
imageGenerationButton.MoveButtonUp();
|
||||
imageGenerationButton.Deactivate();
|
||||
if (!modelGenerationInProgress)
|
||||
{
|
||||
modelGenerationButton.Deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
private async void InvokeModelGeneration()
|
||||
{
|
||||
modelGenerationInProgress = true;
|
||||
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
|
||||
byte[] encodedModel = await TrellisClient.Instance.GenerateModel(encodedTexture);
|
||||
|
||||
@@ -63,7 +71,8 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
|
||||
GeneratedModel = spawnedObject;
|
||||
|
||||
OnModelReady();
|
||||
modelGenerationButton.MoveButtonUp();
|
||||
modelGenerationButton.Deactivate();
|
||||
modelGenerationInProgress = false;
|
||||
}
|
||||
|
||||
private Texture2D CreateTexture(byte[] imageBytes)
|
||||
|
||||
Reference in New Issue
Block a user