Exemple #1
0
        private void OnTriggerEnter(Collider collider)
        {
            if (collider.GetComponentInParent <GorillaTriggerColliderHandIndicator>() != null)
            {
                GorillaTriggerColliderHandIndicator component = collider.GetComponent <GorillaTriggerColliderHandIndicator>();
                // do stuff
                if (hat != null)
                {
                    if (hat.Descriptor?.HatName != null)

                    {
                        Debug.Log("Swapping to: " + hat.Descriptor.HatName);
                        GorillaCosmetics.selectedHat.Value = hat.Descriptor.HatName;
                        AssetLoader.selectedHat            = AssetLoader.SelectedHatFromConfig();
                    }
                    else
                    {
                        // default hat stuff
                        Debug.Log("Swapping to default hat");
                        GorillaCosmetics.selectedHat.Value = "Default";
                        AssetLoader.selectedHat            = 0;
                    }
                    CosmeticUtils.RefreshAllPlayers();
                }
                if (component != null)
                {
                    GorillaTagger.Instance.StartVibration(component.isLeftHand, GorillaTagger.Instance.tapHapticStrength / 2f, GorillaTagger.Instance.tapHapticDuration);
                }
            }
        }
 private void OnTriggerEnter(Collider collider)
 {
     if (collider.GetComponentInParent <GorillaTriggerColliderHandIndicator>() != null)
     {
         GorillaTriggerColliderHandIndicator component = collider.GetComponent <GorillaTriggerColliderHandIndicator>();
         // do stuff
         if (material != null)
         {
             if (material.Descriptor.MaterialName != null)
             {
                 Debug.Log("Swapping to: " + material.Descriptor.MaterialName);
                 GorillaCosmetics.selectedMaterial.Value = material.Descriptor.MaterialName;
                 AssetLoader.selectedMaterial            = AssetLoader.SelectedMaterialFromConfig(material.Descriptor.MaterialName);
             }
             else
             {
                 Debug.Log("Swapping to default material");
                 GorillaCosmetics.selectedMaterial.Value = "Default";
                 AssetLoader.selectedMaterial            = 0;
             }
             CosmeticUtils.RefreshAllPlayers();
             //GorillaTagger.Instance.offlineVRRig.ChangeMaterial(GorillaTagger.Instance.offlineVRRig.setMatIndex);
         }
         if (component != null)
         {
             GorillaTagger.Instance.StartVibration(component.isLeftHand, GorillaTagger.Instance.tapHapticStrength / 2f, GorillaTagger.Instance.tapHapticDuration);
         }
     }
 }