Exemplo n.º 1
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     Debug.Log("entrou");
     playerController.SetObjectOnHand(this.gameObject, true);
     DuplicateSizeInVR();
     OnFinish();
 }
Exemplo n.º 2
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     if (!interactAgainToRevert)
     {
         if (!currentlyPlaying)
         {
             currentlyPlaying          = true;
             anim[animationName].speed = 1;
             anim.Play(animationName);
         }
     }
     {
         if (!currentlyPlaying)
         {
             currentlyPlaying          = true;
             anim[animationName].speed = isOn ? -1 : 1;
             if (isOn)
             {
                 anim[animationName].time = anim.isPlaying ? anim[animationName].time : anim[animationName].length;
             }
             else
             {
                 anim[animationName].time = 0;
             }
             anim.Play(animationName);
         }
     }
 }
Exemplo n.º 3
0
    public override void OnInteractionTrigger(InteractionModes mode)
    {
        print($"Interacted here: {mode} with {this.gameObject.name} !");
        OnFinish();
        //Do something specific
        switch (mode)
        {
        case InteractionModes.Over:
            break;

        case InteractionModes.Out:
            break;

        case InteractionModes.Click:
            break;

        case InteractionModes.DoubleClick:
            break;

        case InteractionModes.Up:
            break;

        case InteractionModes.Grab:
            break;

        case InteractionModes.Release:
            break;

        default:
            break;
        }
    }
Exemplo n.º 4
0
    //QUANDO O BOTAO É ATIVADO, ESSA FUNCAO EH CHAMADA. AQUI VOCE DEVE PROGRAMAR O SEU CODIGO PARA O SEU BOTAO...
    public override void OnInteractionTrigger(InteractionModes modes)
    {
        switch (modes)
        {
        case InteractionModes.Over:
            break;

        case InteractionModes.Out:
            countDownToTurnOff = 0;
            skinnedMeshRenderer.SetBlendShapeWeight(blendShapeIndex, 0);
            break;

        case InteractionModes.Click:
            countDownToTurnOff = totalLerpDuration;
            lerpA = skinnedMeshRenderer.GetBlendShapeWeight(blendShapeIndex);
            lerpB = 100;
            break;

        case InteractionModes.DoubleClick:
            break;

        case InteractionModes.Up:
            countDownToTurnOff = totalLerpDuration;
            lerpA = skinnedMeshRenderer.GetBlendShapeWeight(blendShapeIndex);
            lerpB = 0;
            break;

        case InteractionModes.Grab:
            break;

        default:
            break;
        }
    }
Exemplo n.º 5
0
 void FireInteraction(InteractionModes mode)
 {
     for (int i = 0; i < targets.Count; i++)
     {
         targets[i].OnInteractionTrigger(mode);
     }
 }
Exemplo n.º 6
0
 //QUANDO O BOTAO É ATIVADO, ESSA FUNCAO EH CHAMADA. AQUI VOCE DEVE PROGRAMAR O SEU CODIGO PARA O SEU BOTAO...
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     //print($"OnInteractionTrigger {this.gameObject}");
     target.material       = defaultMaterial;
     target.material.color = cor;
     OnFinish();
 }
Exemplo n.º 7
0
    //Implement the interaction desired here
    public override void OnInteractionTrigger(InteractionModes mode)
    {
        //My code goes here...


        OnFinish();
    }
Exemplo n.º 8
0
    async public override void OnInteractionTrigger(InteractionModes mode)
    {
        teleportIsOver = false;

        StartCoroutine(cameraFade.BeginFadeOut(fadeTime, false));

        if (audioClip)
        {
            ReferenceManagerIndependent.Instance.PlayAudioClip(audioClip);
        }

        CharacterController playerChar = who.GetComponent <CharacterController>();

        if (playerChar)
        {
            referenceManagerIndependent.PlatformManager.GetPlayerController().enabled = false;
            playerChar.enabled = false;
        }

        await new WaitForSeconds(fadeTime);
        who.transform.position = teleportDestiny;


        StartCoroutine(cameraFade.BeginFadeIn(fadeTime, false));

        if (playerChar)
        {
            referenceManagerIndependent.PlatformManager.GetPlayerController().enabled = true;
            playerChar.enabled = true;
        }

        teleportIsOver = true;

        OnFinish();
    }
Exemplo n.º 9
0
        public override void OnInteractionTrigger(InteractionModes mode)
        {
            Collider other  = gameObject.GetComponent <Collider>();
            Mallet   mallet = other.gameObject.GetComponent <Mallet>();

            _Press = Press(other, mallet);
            StartCoroutine(_Press);
        }
Exemplo n.º 10
0
 async public override void OnInteractionTrigger(InteractionModes mode)
 {
     if (delayToProcess > 0)
     {
         await new WaitForSeconds(delayToProcess);
     }
     target.SetActive(rollBack ? (timeToRollback ? !willActivate : willActivate) : willActivate);
     timeToRollback = !timeToRollback;
     OnFinish();
 }
Exemplo n.º 11
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     // pegar toogle
     toggle = transform.GetComponent <Toggle>();
     if (!toggle.isOn)
     {
         toggle.isOn = !toggle.isOn;
     }
     // ativar toogle e desativor o parent no mesmo nível
     //Debug.Log(toggle.isOn);
 }
Exemplo n.º 12
0
        /// <summary>
        /// controllers register to get polled
        /// </summary>
        public static void RegisterNewController(IController c)
        {
            if (_controllers == null) //if first controller added...
            {
                _controllers = new PerControllerData[1];

                _controllers[0] = new PerControllerData
                {
                    Active = c.GetGameObject().activeInHierarchy,
                    Ctrlr  = c,
                    Trans  = c.GetGameObject().transform
                };

                _templateOutlineObj = c.GetOutlineTemplateObject();
            }
            else //..adding additional 2nd, 3rd, etc. controller
            {
                PerControllerData[] oldControllers = _controllers;
                int oldNumCtrlrs = oldControllers.Length;
                _controllers = new PerControllerData[oldNumCtrlrs + 1];

                for (int i = 0; i < oldNumCtrlrs; i++)
                {
                    _controllers[i] = oldControllers[i];
                }

                _controllers[oldNumCtrlrs] = new PerControllerData
                {
                    Active = c.GetGameObject().activeInHierarchy,
                    Ctrlr  = c,
                    Trans  = c.GetGameObject().transform
                };

                if (_templateOutlineObj == null)
                {
                    _templateOutlineObj = c.GetOutlineTemplateObject();
                }
            }

            ControllerDesktop  cDesktop  = c.GetGameObject().GetComponent <ControllerDesktop>();
            ControllerOculusGo cOculusGo = c.GetGameObject().GetComponent <ControllerOculusGo>();

            //ControllerSteamVR cSteamVR = c.GetGameObject().GetComponent<ControllerSteamVR>();
            if (cDesktop != null)
            {
                InteractionMode = InteractionModes.Desktop;
            }
            if (cOculusGo != null)
            {
                InteractionMode = InteractionModes.VR3DOF;
            }
            //if (cSteamVR != null) InteractionMode = InteractionModes.VR6DOF;
        }
Exemplo n.º 13
0
    public override void OnInteractionTrigger(InteractionModes mode)
    {
        switch (mode)
        {
        case InteractionModes.Over:
            currentSpeed = angularSpeed;
            break;

        case InteractionModes.Out:
        default:
            currentSpeed = 0;
            break;
        }
    }
Exemplo n.º 14
0
        void toggleMode(InteractionModes mode)
        {
            print(mode);

            this.currentMode = mode;
            timeline.toggleMode(mode);

            if (this.currentMode == InteractionModes.Create)
            {
                buttonImage.sprite = playButtonSprite;
            }
            else if (this.currentMode == InteractionModes.Present)
            {
                buttonImage.sprite = pauseButtonSprite;
            }
        }
Exemplo n.º 15
0
    async public override void OnInteractionTrigger(InteractionModes mode)
    {
        if (CheckIfMinDistance())
        {
#if NESTLE_RV
            ReferenceManagerDependent.Instance.LongeFrame.SetActive(true);
#endif
            Debug.Log("Too far to get object:" + Vector3.Distance(playerController.transform.position, this.transform.position));
            return;
        }
        await new WaitForEndOfFrame();
        handController.SetObjectOnHand(objectBeingPushed.gameObject, true);

        objectBeingPushed.enabled = true;
        objectBeingPushed.ActivateMover(this.gameObject, true);
        objectBeingPushed.OnExecuted += Finished;
    }
Exemplo n.º 16
0
        public override void OnInteractionTrigger(InteractionModes mode)
        {
            switch (mode)
            {
            case InteractionModes.Over:
                // When the user looks at the VRInteractiveItem the textures should start playing.
                m_Playing = true;
                StartCoroutine(PlayTextures());
                break;

            case InteractionModes.Out:
            default:
                // When the user looks away from the VRInteractiveItem the textures should no longer be playing.
                m_Playing = false;
                break;
            }
        }
Exemplo n.º 17
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     if (!particle.isPlaying)
     {
         particle.Play();
         currentlyPlaying = true;
     }
     else
     {
         if (interactAgainToStop)
         {
             currentlyPlaying = false;
             particle.Stop();
             OnFinish();
         }
     }
 }
Exemplo n.º 18
0
    //QUANDO O BOTAO É ATIVADO, ESSA FUNCAO EH CHAMADA. AQUI VOCE DEVE PROGRAMAR O SEU CODIGO PARA O SEU BOTAO...
    override public void OnInteractionTrigger(InteractionModes mode)
    {
        switch (mode)
        {
        case InteractionModes.Out:
        case InteractionModes.Up:
            switch (currentState)
            {
            case buttonHoldingStates.notstarted:
            default:
                break;

            case buttonHoldingStates.holdStart:
                TreatFailing();
                break;

            case buttonHoldingStates.holdOver:
                currentState = buttonHoldingStates.notstarted;
                OnFinish();
                break;
            }
            m_Selection.gameObject.SetActive(false);
            break;

        case InteractionModes.Click:
            currentState = buttonHoldingStates.notstarted;
            switch (currentState)
            {
            case buttonHoldingStates.notstarted:
            default:
                countDown = Time.deltaTime;
                OnHoldStart?.Invoke(this.gameObject);
                currentState = buttonHoldingStates.holdStart;
                break;

            case buttonHoldingStates.holdStart:
                break;

            case buttonHoldingStates.holdOver:
                break;
            }
            break;
        }
    }
Exemplo n.º 19
0
    public override void OnInteractionTrigger(InteractionModes mode)
    {
        switch (mode)
        {
        case InteractionModes.Over:
            totalLerpDuration  = transitionOutDuration;
            countDownToTurnOff = totalLerpDuration;
            lerpA   = 0;
            lerpB   = 1;
            myColor = myImageComponent.color;
            break;

        case InteractionModes.Out:
        default:
            // When the user looks away from the rendering of the scene, hide the radial.
            totalLerpDuration  = transitionInDuration;
            countDownToTurnOff = totalLerpDuration;
            lerpA = 1;
            lerpB = 0;
            break;
        }
    }
Exemplo n.º 20
0
        /// <summary>
        ///  This method is used to declare a new tag type and register it with our dictionary so it can be located by name later.
        /// </summary>
        /// <param name="name">The name you'll refer to this tag type by.  Used mostly as a dictionary key.</param>
        /// <param name="promptString">A string, or resource ID, for a "what to do with this" prompt.  May become obsolete.</param>
        /// <param name="activity">An activity, usually a new instance of (the specific Activity-derived class) you want such tags to launch.</param>
        /// <param name="directive">Any additional information you wish to bundle up and include when the Activity is being launched (like "calibration" rather than the real thing) should be stringified into this.</param>
        /// <param name="flags">Android ActivityFlag(s) describing how the launched activity behaves - does it claim the foreground (the default), does it move straight to background, etc.</param>
        /// <returns></returns>
        public static InteractionMode DefineInteractionMode(string name, stringOrID promptString, Activity activity, stringOrID directive = default(stringOrID), ActivityFlags flags = ActivityFlags.SingleTop)
        {
            var             direc   = (stringOrID)directive;
            InteractionMode newMode = new InteractionMode
            {
                Name       = name,
                PromptText = promptString,
                Launches   = activity,
                Directive  = direc,
                Flags      = flags
            };

            if (InteractionModes.ContainsKey(name))
            {
                InteractionModes[name] = newMode;
            }
            else
            {
                InteractionModes.Add(name, newMode);
            }
            return(newMode);
        }
Exemplo n.º 21
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     target.enabled = (rollBack ? (timeToRollback ? !willActivate : willActivate) :  willActivate);
     timeToRollback = !timeToRollback;
     OnFinish();
 }
Exemplo n.º 22
0
 /// <summary>
 /// Modes the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns>TooltipsBuilder.</returns>
 public TooltipsBuilder Mode(InteractionModes value)
 {
     _component.Mode = value;
     return(this);
 }
Exemplo n.º 23
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     isOn = !isOn;
     RenderSettings.skybox = isOn ? newSkybox : oldSkybox;
     OnFinish();
 }
Exemplo n.º 24
0
        public static void UpdateInteraction(Rect rect)
        {
            int   controlId = GUIUtility.GetControlID("Slider".GetHashCode(), FocusType.Passive);
            Event current   = Event.current;

            switch (current.GetTypeForControl(controlId))
            {
            case EventType.MouseDown:
                if (rect.Contains(current.mousePosition) && rect.width > 50f && current.isMouse)
                {
                    GUIUtility.hotControl = controlId;
                    current.Use();
                    EditorGUIUtility.SetWantsMouseJumping(1);

                    switch (current.button)
                    {
                    default:
                        MODE = InteractionModes.Orbit;
                        break;

                    case 1:
                        MODE = InteractionModes.Offset;
                        break;
                    }
                }
                break;

            case EventType.MouseUp:
                if (GUIUtility.hotControl == controlId)
                {
                    GUIUtility.hotControl = 0;
                }
                EditorGUIUtility.SetWantsMouseJumping(0);
                break;

            case EventType.MouseDrag:
                if (GUIUtility.hotControl == controlId)
                {
                    switch (MODE)
                    {
                    case InteractionModes.Orbit:
                        DRAG  -= current.delta * (!current.shift ? 1 : 0.3f) / Mathf.Min(rect.width, rect.height) * 140f;
                        DRAG.y = Mathf.Clamp(DRAG.y, -90f, 90f);
                        if (RESTRICT_ROTATION)
                        {
                            DRAG.x = Mathf.Clamp(DRAG.x, -90f, 90f);
                        }

                        break;

                    case InteractionModes.Offset:
                        OFFSET.x += -current.delta.x * INTERACTION_SCALE;
                        OFFSET.y += current.delta.y * INTERACTION_SCALE;
                        break;
                    }
                    current.Use();
                    GUI.changed = true;
                }
                break;

            case EventType.ScrollWheel:
                if (rect.Contains(current.mousePosition) && rect.width > 50f)
                {
                    ZOOM = Mathf.Clamp(ZOOM + current.delta.y * 0.01f, 0.1f, 2);
                    current.Use();
                    GUI.changed = true;
                }
                break;
            }
        }
Exemplo n.º 25
0
 public void toggleMode(InteractionModes mode)
 {
     this.workspace.toggleMode(mode);
 }
Exemplo n.º 26
0
 public void toggleMode(InteractionModes mode)
 {
     // Handle change in mode
     print("toggling");
 }
Exemplo n.º 27
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 28
0
        /// <summary>
        /// Validates the software trial/demo/license status. This method will
        /// determine the status and will either preset the user with that
        /// information or just log it.
        /// </summary>
        /// <remarks>
        /// If the state of Scutex cannot be verified, for example the
        /// data file or Licensing assembly was tampered with, this method
        /// will warn the user and kill the entire process.
        /// </remarks>
        /// <param name="interactionMode">
        /// Determines how, or if, Scutex will report critical information
        /// to the user.
        /// </param>
        public ScutexLicense Validate(InteractionModes interactionMode)
        {
            ScutexLicense scutexLicense;

            if (_options != null && String.IsNullOrEmpty(_options.DataFileLocation) == false)
            {
                scutexLicense = licenseManagerService.GetScutexLicense(_options.DataFileLocation);
            }
            else
            {
                scutexLicense = licenseManagerService.GetScutexLicense();
            }

            if (scutexLicense == null)
            {
                throw new ScutexAuditException();
            }

            if (scutexLicense.IsLicensed == false)
            {
                switch (interactionMode)
                {
                case InteractionModes.None:
                    IEventLogInteractionService eventLogInteractionService = ObjectLocator.GetInstance <IEventLogInteractionService>();
                    eventLogInteractionService.Validate(scutexLicense);

                    break;

                case InteractionModes.Gui:
                    ShowLicensingWindow(scutexLicense);

                    if (FormLicense != null)
                    {
                        scutexLicense = FormLicense;
                    }

                    if (ClientLicense != null)
                    {
                        scutexLicense.IsLicensed  = ClientLicense.IsLicensed;
                        scutexLicense.IsActivated = ClientLicense.IsActivated;
                        scutexLicense.ActivatedOn = ClientLicense.ActivatedOn;
                    }

                    break;

                case InteractionModes.Console:
                    IConsoleInteractionService consoleInteractionService = ObjectLocator.GetInstance <IConsoleInteractionService>();
                    consoleInteractionService.Validate(scutexLicense);

                    break;

                case InteractionModes.Silent:
                    ISilentInteractionService silentInteractionService = ObjectLocator.GetInstance <ISilentInteractionService>();
                    silentInteractionService.Validate(scutexLicense);

                    break;

                case InteractionModes.Component:
                    break;
                }
            }

            scutexLicense.InterfaceInteraction = InterfaceInteraction;

            return(scutexLicense);
        }
Exemplo n.º 29
0
 public override void OnInteractionTrigger(InteractionModes mode)
 {
     soundSelector.PlaySound(audioSource);
     OnFinish();
 }
Exemplo n.º 30
0
        /// <summary>
        /// Validates the software trial/demo/license status. This method will
        /// determine the status and will either preset the user with that
        /// information or just log it.
        /// </summary>
        /// <remarks>
        /// If the state of Scutex cannot be verified, for example the 
        /// data file or Licensing assembly was tampered with, this method 
        /// will warn the user and kill the entire process.
        /// </remarks>
        /// <param name="interactionMode">
        /// Determines how, or if, Scutex will report critical information 
        /// to the user.
        /// </param>
        public ScutexLicense Validate(InteractionModes interactionMode)
        {
            ScutexLicense scutexLicense = licenseManagerService.GetScutexLicense();

            if (scutexLicense == null)
                throw new ScutexAuditException();

            if (scutexLicense.IsLicensed == false)
            {
                switch (interactionMode)
                {
                    case InteractionModes.None:
                        IEventLogInteractionService eventLogInteractionService = ObjectLocator.GetInstance<IEventLogInteractionService>();
                        eventLogInteractionService.Validate(scutexLicense);

                        break;
                    case InteractionModes.Gui:
                        ShowLicensingWindow(scutexLicense);

                        if (FormLicense != null)
                            scutexLicense = FormLicense;

                        if (ClientLicense != null)
                        {
                            scutexLicense.IsLicensed = ClientLicense.IsLicensed;
                            scutexLicense.IsActivated = ClientLicense.IsActivated;
                            scutexLicense.ActivatedOn = ClientLicense.ActivatedOn;
                        }

                        break;
                    case InteractionModes.Console:
                        IConsoleInteractionService consoleInteractionService = ObjectLocator.GetInstance<IConsoleInteractionService>();
                        consoleInteractionService.Validate(scutexLicense);

                        break;
                    case InteractionModes.Silent:
                        break;
                }
            }

            scutexLicense.InterfaceInteraction = InterfaceInteraction;

            return scutexLicense;
        }
Exemplo n.º 31
0
        public override void OnInteractionTrigger(InteractionModes mode)
        {
#if NESTLE_RV
            DoLogin();
#endif
        }