public override void OnActive() { // If we made it to advanced mode, we should be gone. if (PanelManager.m_Instance.AdvancedModeActive()) { m_Request = RequestingState.ToHide; m_CustomHintObject.Activate(false); return; } // If we're looking at the admin panel, tick down our dismiss timer. BasePanel adminPanel = PanelManager.m_Instance.GetAdminPanel(); if (SketchControlsScript.m_Instance.IsUserLookingAtPanel(adminPanel)) { m_ReadDismissTimer -= Time.deltaTime; m_CustomHintObject.Activate(true); } else { // If we're not looking at the admin panel, keep our timer refreshed. if (m_ReadDismissTimer > 0.0f) { m_ReadDismissTimer = m_TimeBeforeReadDismiss; } else { // If our timer expired while we were staring, we're done. The user has had enough // time to process the promo, we're going to assume they read it and don't care. m_Request = RequestingState.ToHide; } m_CustomHintObject.Activate(false); } }
public void UpdateLightGizmoHint() { if (m_LightGizmoHoverTimer >= 0) { if (!m_LightGizmoHint) { var hint = Instantiate(m_LightGizmoHintPrefab); m_LightGizmoHint = hint.GetComponent<HintObjectScript>(); } // TODO: Fix this. // This assumes there is only one panel of type Lights created. BasePanel basePanel = PanelManager.m_Instance.GetPanelByType(BasePanel.PanelType.Lights); LightsPanel lightsPanel = basePanel as LightsPanel; if (lightsPanel != null) { if (lightsPanel.IsLightGizmoBeingDragged) { m_LightGizmoHoverTimer = -1; if (m_LightGizmoHint.IsActive()) { m_LightGizmoHint.Activate(false); } } else if (lightsPanel.IsLightGizmoBeingHovered) { m_LightGizmoHoverTimer += Time.deltaTime; if (m_LightGizmoHoverTimer > m_LightGizmoHoverTimeBeforeHint) { if (!m_LightGizmoHint.IsActive()) { m_LightGizmoHint.Activate(true); } m_LightGizmoHint.transform.position = lightsPanel.ActiveLightGizmoPosition; m_LightGizmoHint.transform.rotation = lightsPanel.transform.rotation; } } else { m_LightGizmoHint.Activate(false); m_LightGizmoHoverTimer = m_LightGizmoHoverTimeBeforeHint / 2; } } } }