Ejemplo n.º 1
0
        private IEnumerator PlayAction(Interaction action, string animation)
        {
            this.Activate();

#if UNITY_MODULES_AUDIO
            if (interaction != null)
            {
                interaction.PlayAction(action, transform);
            }
#endif
#if UNITY_MODULES_ANIMATION
            return(animator.PlayCoroutine(animation));
#else
            return(null);
#endif
        }
Ejemplo n.º 2
0
        public virtual void PlayInteraction(Interaction action)
        {
            if (interaction != null &&
                (Time.unscaledTime > finishTime ||
                 action != lastAction))
            {
                lastAction = action;
                finishTime = Time.unscaledTime + interaction.PlayAction(action, Probe.Cursor, Haptics, false);
            }

            if (action == Interaction.Entered)
            {
                curLaserPointerMaterial = LaserPointerEnabledMaterial;
            }
            else if (action == Interaction.EnteredDisabled)
            {
                curLaserPointerMaterial = LaserPointerDisabledMaterial;
            }
            else if (action == Interaction.Exited)
            {
                curLaserPointerMaterial = LaserPointerNormalMaterial;
            }
        }