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); }
// Use this for initialization void Awake() { // ensure singleton if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
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; } } } }
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); }
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; }
void Awake() { instance = this; InputTracking.nodeAdded += AddNode; updateInputDevices(); }
public RequestKey(ProxyFeedbackRequest request) { m_Control = request.control; m_TooltipText = request.tooltipText; }
public void UpdateValues(ProxyFeedbackRequest request) { m_Control = request.control; m_TooltipText = request.tooltipText; }