Пример #1
0
            void AddMaterialData(Material material, VRControl control, Renderer renderer, AffordanceTooltip[] tooltips,
                                 AffordanceVisibilityDefinition definition)
            {
                MaterialData materialData;

                if (!m_MaterialDictionary.TryGetValue(material, out materialData))
                {
                    materialData = new MaterialData();
                    m_MaterialDictionary[material] = materialData;
                }

                materialData.AddAffordance(material, control, renderer, tooltips, definition);
            }
Пример #2
0
    // Use this for initialization
    void Awake()
    {
        // ensure singleton
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Пример #3
0
    void LookingDown()
    {
        if (!isPaused)
        {
            float angle = Vector3.Angle(Vector3.down, Camera.main.transform.forward);
            if (!lookingDown)
            {
                if (angle <= lookingDownMaxAngle)
                {
                    lookingDown      = true;
                    lookingDownTimer = 0f;
                }
            }
            else
            {
                if (angle > lookingDownMaxAngle)
                {
                    lookingDown = false;
                    return;
                }

                lookingDownTimer += Time.deltaTime;

                if (lookingDownTimer >= timeLookingDown)
                {
                    for (int i = 0; i < pausableScenes.Length; i++)
                    {
                        if (SceneManager.GetActiveScene().name == pausableScenes [i])
                        {
                            OpenPausePanel();
                            return;
                        }
                    }

                    for (int i = 0; i < returnableScenes.Length; i++)
                    {
                        if (SceneManager.GetActiveScene().name == returnableScenes [i])
                        {
                            VRControl.BackToMenu();
                            return;
                        }
                    }

                    lookingDownTimer = 0f;
                }
            }
        }
    }
Пример #4
0
                public bool GetVisibility(VRControl control)
                {
                    foreach (var kvp in m_AffordanceVisibilityStates)
                    {
                        if (kvp.Key != (int)control)
                        {
                            continue;
                        }

                        if (kvp.Value.visible)
                        {
                            return(true);
                        }
                    }

                    return(false);
                }
Пример #5
0
                public void AddAffordance(Material material, VRControl control, Renderer renderer,
                                          AffordanceTooltip[] tooltips, AffordanceVisibilityDefinition definition)
                {
                    if (m_AffordanceVisibilityStates.ContainsKey(control))
                    {
                        Debug.LogWarning("Multiple affordaces added to " + this + " for " + control);
                    }

                    m_AffordanceVisibilityStates[control] = new VisibilityState(renderer, tooltips, definition, material);

                    switch (definition.visibilityType)
                    {
                    case VisibilityControlType.AlphaProperty:
                        m_OriginalColor = material.GetFloat(definition.alphaProperty) * Color.white;
                        break;

                    case VisibilityControlType.ColorProperty:
                        m_OriginalColor = material.GetColor(definition.colorProperty);
                        break;
                    }

                    m_StartColor   = m_OriginalColor;
                    m_CurrentColor = m_StartColor;
                }
Пример #6
0
 void Awake()
 {
     instance = this;
     InputTracking.nodeAdded += AddNode;
     updateInputDevices();
 }
Пример #7
0
 public RequestKey(ProxyFeedbackRequest request)
 {
     m_Control     = request.control;
     m_TooltipText = request.tooltipText;
 }
Пример #8
0
 public void UpdateValues(ProxyFeedbackRequest request)
 {
     m_Control     = request.control;
     m_TooltipText = request.tooltipText;
 }