Ejemplo n.º 1
0
        public void OnPostprocessBuild(BuildReport report)
        {
            var receivers = Find.All <ICredentialReceiver>();

            foreach (var receiver in receivers)
            {
                receiver.ClearCredentials();
            }

            Debug.Log("<== Juniper.CredentialResolver ==>: Credentials cleared");
        }
Ejemplo n.º 2
0
        public override void Uninstall()
        {
            base.Uninstall();

            foreach (var mapper in Find.All <MLSpatialMapper>())
            {
                mapper?.transform
                ?.Find("Original")
                ?.gameObject
                ?.Destroy();

                mapper?.Destroy();
            }
        }
Ejemplo n.º 3
0
 public void PauseZone(string zoneName)
 {
     JuniperSystem.OnMainThread(() =>
     {
         var audioSources = Find.All <AudioSource>(a => !a.CompareTag(INTERACTION_SOUND_TAG));
         foreach (var audioSource in audioSources)
         {
             if (audioSource.IsInZone(zoneName) &&
                 audioSource.isPlaying)
             {
                 audioSource.Pause();
             }
         }
     });
 }
Ejemplo n.º 4
0
        public async Task EnableDopplerAsync(bool value)
        {
#if UNITY_MODULES_AUDIO
            await JuniperSystem.OnMainThreadAsync(() =>
            {
                var audioSources = Find.All <AudioSource>();
                var doppler      = value ? dopplerLevel : 0;
                foreach (var audioSource in audioSources)
                {
                    audioSource.dopplerLevel = doppler;
                }
            });
#endif

            // burn a frame
            await Task.Yield();
        }
Ejemplo n.º 5
0
        public override void Awake()
        {
            if (Hand == Hand.None)
            {
                this.Destroy();
            }
            else
            {
                base.Awake();

                if (!MLHands.IsStarted)
                {
                    var result = MLHands.Start();
                    if (result.IsOk)
                    {
                        var poses = (from hand in Find.All <MagicLeapHand>()
                                     from button in hand.nativeButtons.Buttons
                                     select button).ToArray();
                        MLHands.KeyPoseManager.EnableKeyPoses(poses, true);
                    }
                }

                handObj = PointerConfig[NativeHandID];

                bones = KeyPoints.Select((point, i) =>
                                         this.Ensure <Transform>(
                                             $"Bone{i}",
                                             () =>
                {
                    var sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                    sphere.transform.localScale = 0.005f * Vector3.one;
                    if (point.IsValid)
                    {
                        sphere.transform.localPosition = point.Position;
                    }
                    var collid       = sphere.GetComponent <Collider>();
                    collid.isTrigger = true;
                    sphere.Deactivate();
                    return(sphere);
                }).Value).ToArray();
            }
        }
Ejemplo n.º 6
0
 public void PlayZone(string zoneName)
 {
     JuniperSystem.OnMainThread(() =>
     {
         var audioSources = Find.All <AudioSource>(a => !a.CompareTag(INTERACTION_SOUND_TAG));
         foreach (var audioSource in audioSources)
         {
             if (!audioSource.IsInZone(zoneName) &&
                 audioSource.isPlaying)
             {
                 audioSource.Stop();
             }
             else if (audioSource.playOnAwake &&
                      !audioSource.isPlaying)
             {
                 audioSource.Activate();
                 audioSource.Play();
             }
         }
     });
 }
Ejemplo n.º 7
0
 private static List <IInstallable> GetInstallables()
 {
     return(Find.All <IInstallable>().ToList());
 }
Ejemplo n.º 8
0
 private void FindAudioSources()
 {
     Find.All(hasInteractionSoundTag, ref audioSources);
 }