예제 #1
0
    public void Pickup()
    {
        if (m_TypeHand == Constants.HAND_PRIMARY_USE)
        {
            m_isPressedPrimaryPickup = true;
        }
        if (m_TypeHand == Constants.HAND_SECONDARY_USE)
        {
            m_isPressedSecundaryPickup = true;
        }
        if (m_TypeHand == Constants.HAND_NONE_USE)
        {
            m_isPressedPrimaryPickup   = false;
            m_isPressedSecundaryPickup = false;
        }

        if (m_CurrentTakedSubspace || m_currentIndexSelected < 0)
        {
            return;
        }
        m_CurrentTakedSubspace = m_ContactInteractables[m_currentIndexSelected];
        if (!m_CurrentTakedSubspace)
        {
            return;
        }
        DetectTypeHand();
        if (m_TypeHand == Constants.HAND_PRIMARY_USE)
        {
            Rigidbody targetBody = m_CurrentTakedSubspace.GetComponent <Rigidbody>();
            m_Joint.connectedBody = targetBody;
            m_CurrentTakedSubspace.m_PrimaryHand   = this;
            m_CurrentTakedSubspace.m_SecondaryHand = null;
            m_selectSubspaces++;
            if (m_consoleLeft)
            {
                m_consoleLeft.AddText("m_selectSubspaces: " + m_selectSubspaces);
            }
        }
        if (m_TypeHand == Constants.HAND_SECONDARY_USE)
        {
            m_CurrentTakedSubspace.m_SecondaryHand = this;
            StopJoiningSubspace();
            m_CurrentTakedSubspace.m_distanceInitialForScale = Vector3.Distance(m_CurrentTakedSubspace.m_PrimaryHand.transform.position, transform.position);
            m_CurrentTakedSubspace.m_modeScale = true;
        }
        DetectTypeHand();
    }
예제 #2
0
    IEnumerator ShowConsoleTask()
    {
        yield return(new WaitForSeconds(3));

        int        task    = Convert.ToInt32(m_textTaskId.GetComponent <InputField>().text);
        GameObject console = GameObject.Find("ConsoleTV");

        if (console)
        {
            Console current_console = console.GetComponent <Console>();
            current_console.Clear();
            switch (task)
            {
            case 1:
                current_console.AddText("Selecione o artista com mais músicas do gênero Punk entre 2005 e 2010.");
                break;

            case 2:
                current_console.AddText("1 - Selecione a música mais diferente da maioria das músicas do gênero Folk entre 2005 e 2010.");
                current_console.AddText("2 - Selecione o artista mais similar da música selecionada.");
                break;

            case 3:
                current_console.AddText("1 - Filtre a música entre 1990 e 2000.");
                current_console.AddText("2 - Filtre a música entre 2001 e 2005.");
                current_console.AddText("3 - Selecione o gênero com o menor número de músicas comuns dos dois períodos.");
                break;
            }
        }
    }
예제 #3
0
    IEnumerator ShowConsoleWait()
    {
        yield return(new WaitForSeconds(3));

        string task = m_textTaskId.GetComponent <InputField>().text;

        if (task.Length > 0)
        {
            GameObject console = GameObject.Find("ConsoleTV");
            if (console)
            {
                Console current_console = console.GetComponent <Console>();
                if (VR)
                {
                    current_console.AddText("Tire os oculus e responda a perguntas. Aguarde instruções...");
                }
                else
                {
                    current_console.AddText("Responda a perguntas. Aguarde instruções...");
                }
            }
        }
    }
예제 #4
0
    void Start()
    {
        m_myHand    = GetComponent <Hand>();
        m_otherHand = m_myHand.GetOtherMacroHand();
        if (interactions)
        {
            m_interactionsCoordinated = interactions.GetComponent <Interaction>();
        }
        if (console)
        {
            m_console = console.GetComponent <Console>();
            m_console.AddText("MACRO HAND NAME: " + transform.name);
        }

        GameObject consoleLeft = GameObject.Find("ConsoleLeft");

        if (consoleLeft)
        {
            m_consoleLeft = consoleLeft.GetComponent <Console>();
        }
        StartCoroutine(InitCoroutine());
    }
예제 #5
0
    void Update()
    {
        if (m_myHand.modeAnswer)
        {
            return;
        }

        m_totalTime += Time.deltaTime;

        if (m_Joint.connectedBody)
        {
            m_pickupTime += Time.deltaTime;
            if (m_CurrentTakedSubspace && m_CurrentTakedSubspace.subspacesChild.Count > 0)
            {
                m_navSlaving += Time.deltaTime;
            }
        }


        if (m_CurrentTakedSubspace && m_CurrentTakedSubspace.m_modeScale)
        {
            m_scaleTime += Time.deltaTime;
        }

        /** FIX BUG**/
        if (!m_isPressedPrimaryPickup && m_Joint.connectedBody)
        {
            m_CurrentTakedSubspace = null;
            Subspace joined = m_Joint.connectedBody.GetComponent <Subspace>();
            joined.m_PrimaryHand   = null;
            joined.m_SecondaryHand = null;
            m_Joint.connectedBody  = null;
            if (m_console)
            {
                m_console.AddText("FIX BUG");
            }
            return;
        }

        if (SteamVR_Actions._default.GrabGrip.GetStateDown(m_Pose.inputSource))
        {
            if (printEvents)
            {
                print(Time.deltaTime + " " + m_Pose.inputSource + " Pickup");
            }
            if (m_console)
            {
                m_console.AddText("PICKUP()");
            }
            Pickup();
            if (m_console)
            {
                m_console.AddText("m_currentIndexSelected: " + m_currentIndexSelected);
            }
            return;
        }

        if (SteamVR_Actions._default.TouchXbutton.GetStateDown(m_Pose.inputSource))
        {
            if (printEvents)
            {
                print(Time.deltaTime + " " + m_Pose.inputSource + " Clone");
            }
            if (m_console)
            {
                m_console.AddText("CLONE()");
            }
            Clone();
            return;
        }

        if (SteamVR_Actions._default.GrabGrip.GetStateUp(m_Pose.inputSource))
        {
            if (printEvents)
            {
                print(Time.deltaTime + " " + m_Pose.inputSource + " Drop");
            }
            if (m_console)
            {
                m_console.AddText("DROP()");
            }
            Drop();
            if (m_console)
            {
                m_console.AddText("m_currentIndexSelected: " + m_currentIndexSelected);
            }
            return;
        }

        /**
         * if (m_ContactInteractables.Count > 1 && SteamVR_Actions._default.GrabPinch.GetStateDown(m_Pose.inputSource) &&
         *  !m_isPressedPrimaryPickup && !m_isPressedSecundaryPickup)
         * {
         *  if (printEvents) print(Time.deltaTime + " " + m_Pose.inputSource + " ChangeCurrentSelectionSpace");
         *  if (m_console) m_console.AddText("CHANGECURRENTSELECTIONSPACE()");
         *  ChangeCurrentSelectionSpace();
         *  return;
         * }**/

        if (m_ContactInteractables.Count > 0 && !m_currentDialog && !m_myHand.m_FinishTaskDialog && SteamVR_Actions._default.TouchYbutton.GetStateDown(m_Pose.inputSource) &&
            !m_isPressedPrimaryPickup)
        {
            if (printEvents)
            {
                print(Time.deltaTime + " " + m_Pose.inputSource + " EnableToDelete");
            }
            if (m_console)
            {
                m_console.AddText("ENABLETODELETE()");
            }
            EnableToDelete();
            return;
        }


        /**
         * if (m_CurrentTakedSubspace && SteamVR_Actions._default.TouchXbutton.GetStateDown(m_Pose.inputSource) && m_ContactInteractables.Count > 1)
         * {
         *  if (printEvents) print(Time.deltaTime + " " + m_Pose.inputSource + "SetTransformForSimilar");
         *  if (m_console) m_console.AddText("SETTRANSFORMFORSIMILAR()");
         *  SetTransformForSimilar();
         *  return;
         * }**/
    }