Exemple #1
0
 /**
  * Stop Scale mode and refactor type of Hands
  **/
 private void StopScaleAndAutoDetectHand(Subspace subspace)
 {
     subspace.ResetDistanceInitialForScale();
     // If the output MacroHand is the same that primaryHand
     if (this == subspace.m_PrimaryHand)
     {
         subspace.m_PrimaryHand                 = subspace.m_SecondaryHand;
         subspace.m_SecondaryHand               = null;
         m_CurrentTakedSubspace                 = null;
         m_otherHand.m_isPressedPrimaryPickup   = true;
         m_otherHand.m_isPressedSecundaryPickup = false;
         m_isPressedPrimaryPickup               = false;
         m_isPressedSecundaryPickup             = false;
         m_otherHand.DetectTypeHand();
         m_otherHand.JoiningSubspace();
     }
     else
     {
         subspace.m_SecondaryHand   = null;
         m_CurrentTakedSubspace     = null;
         m_isPressedPrimaryPickup   = false;
         m_isPressedSecundaryPickup = false;
         DetectTypeHand();
         m_otherHand.DetectTypeHand();
         m_otherHand.JoiningSubspace();
     }
     if (subspace.GetNumberUsedHandsInner() == 0)
     {
         subspace.m_PrimaryHand = null;
     }
 }
Exemple #2
0
 /**
  * Disable the Subspace to delete and close the confirmation dialog
  *
  **/
 private void DisableToDelete()
 {
     Destroy(m_currentDialog);
     m_myHand.ShowHand();
     dataToDelete.m_modePrepareToDelete = false;
     if (dataToDelete.GetNumberUsedHandsInner() == 0)
     {
         dataToDelete.GetComponent <Renderer>().material.color = Constants.SPACE_COLOR_WITHOUT_CONTROLLER;
     }
     else
     {
         dataToDelete.GetComponent <Renderer>().material.color = Constants.SPACE_COLOR_WITH_CONTROLLER;
     }
     dataToDelete = null;
     if (!m_custonStatusFingerOtherHand)
     {
         m_otherHand.GetComponent <Hand>().DesactivateFingerHand();
     }
     m_otherHand.GetComponent <Hand>().modeAnswer = false;
 }
Exemple #3
0
    public void OnTriggerExit(Collider other)
    {
        if (!other.gameObject.CompareTag("Subspace"))
        {
            return;
        }
        if (printEvents)
        {
            print(Time.deltaTime + " " + "OnTriggerExit : " + other.gameObject.name);
        }
        if (m_console)
        {
            m_console.AddText("ONTRIGGEREXITIN: " + other.gameObject.name);
        }
        Subspace subspace = other.gameObject.GetComponent <Subspace>();

        m_ContactInteractables.Remove(subspace);
        subspace.m_numControllersInner--;
        subspace.m_HandsActivedInner.Remove(this);

        if (enabled && !subspace.m_modePrepareToDelete && (subspace.GetNumberUsedHandsInner(true) == 0))
        {
            other.GetComponent <Renderer>().material.color = Constants.SPACE_COLOR_WITHOUT_CONTROLLER;
        }

        if (m_currentIndexSelected > m_ContactInteractables.Count - 1)
        {
            m_currentIndexSelected = m_ContactInteractables.Count - 1;
        }

        if (subspace.m_modeScale && subspace.m_PrimaryHand && subspace.m_SecondaryHand)
        {
            stoppingScaleOnTriggerExit = true;
            if (!m_otherHand.stoppingScaleOnTriggerExit)
            {
                StopScaleAndAutoDetectHand(subspace);
            }
            else
            {
                StopScaleBothHands(subspace);
            }
        }

        if (m_ContactInteractables.Count > 0 && !m_CurrentTakedSubspace)
        {
            m_ContactInteractables[m_currentIndexSelected].m_HandsActivedInner.Add(this);
            if (enabled)
            {
                m_ContactInteractables[m_currentIndexSelected].GetComponent <Renderer>().material.color = Constants.SPACE_COLOR_WITH_CONTROLLER;
            }
        }

        if (m_ContactInteractables.Count == 0)
        {
            m_CurrentTakedSubspace = null;
        }

        DetectTypeHand();
        stoppingScaleOnTriggerExit = false;
        if (m_console)
        {
            m_console.AddText("ONTRIGGEREXITIUT: " + other.gameObject.name
                              + " , m_ContactInteractables.Count: " + m_ContactInteractables.Count
                              + " , m_currentIndexSelected: " + m_currentIndexSelected
                              + " , subspace.m_numControllersInner: " + subspace.m_numControllersInner
                              + " , typeHand: " + m_TypeHand);
        }
    }