forked from cgvr/DeltaVR
shape scanner emits particles on config complete
This commit is contained in:
@@ -84,7 +84,7 @@ namespace _PROJECT.Multiplayer.NewBow
|
||||
|
||||
public void SetLaunchDirection(Vector3 direction)
|
||||
{
|
||||
Debug.Log("Setting launch direction: " + direction);
|
||||
// Debug.Log("Setting launch direction: " + direction);
|
||||
if (direction != Vector3.zero)
|
||||
{
|
||||
_networkBehavior.SetLaunchDirection(direction);
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -46,6 +46,7 @@ public class ShapeScanner : MonoBehaviour
|
||||
public Transform rayParent;
|
||||
public TextMeshProUGUI currentConfigurationDisplay;
|
||||
public TextMeshProUGUI correctPercentageDisplay;
|
||||
public ParticleSystem particles;
|
||||
public XRInteractionManager interactionManager;
|
||||
|
||||
[Header("Materials")]
|
||||
@@ -134,7 +135,7 @@ public class ShapeScanner : MonoBehaviour
|
||||
UpdateDisplay(calculateCorrectPercentage());
|
||||
}
|
||||
|
||||
private void DestroyCollidingObjects()
|
||||
private void OnConfigurationComplete()
|
||||
{
|
||||
HashSet<GameObject> allCollidingObjects = new HashSet<GameObject>();
|
||||
foreach (ShapeScannerRay ray in existingRays)
|
||||
@@ -157,6 +158,10 @@ public class ShapeScanner : MonoBehaviour
|
||||
collidingObject.transform.position = Vector3.zero;
|
||||
Destroy(collidingObject);
|
||||
}
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ShapeScannerSuccess, gameObject);
|
||||
if (!particles.isPlaying) particles.Play();
|
||||
particles.Emit(100);
|
||||
}
|
||||
|
||||
private float calculateCorrectPercentage()
|
||||
@@ -176,16 +181,13 @@ public class ShapeScanner : MonoBehaviour
|
||||
if (correctPercentage >= configurations[currentConfiguration].requiredCorrectPercentage)
|
||||
{
|
||||
UpdateCurrentConfigurationDisplay(currentConfiguration + 1);
|
||||
OnConfigurationComplete();
|
||||
if (currentConfiguration + 1 < configurations.Count)
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ShapeScannerSuccess, gameObject);
|
||||
DestroyCollidingObjects();
|
||||
currentConfiguration++;
|
||||
InitializeConfiguration(configurations[currentConfiguration]);
|
||||
} else
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ShapeScannerSuccess, gameObject);
|
||||
DestroyCollidingObjects();
|
||||
// Initialize configuration with all rays requiring collision
|
||||
List<BoolRow> rows = Enumerable.Repeat(new BoolRow(Enumerable.Repeat(false, 6).ToList()), 6).ToList();
|
||||
ShapeScannerConfiguration configuration = new ShapeScannerConfiguration(6, 100, rows);
|
||||
|
||||
@@ -74,7 +74,6 @@ public class TwoHandScaleGrabInteractable : XRGrabInteractable
|
||||
return;
|
||||
|
||||
float ratio = current / initialHandsDistance;
|
||||
Debug.Log("distance ratio: " + ratio);
|
||||
|
||||
Vector3 desired = initialScale * ratio;
|
||||
float uniform = Mathf.Clamp(desired.x, minScale, maxScale);
|
||||
|
||||
Reference in New Issue
Block a user