Beispiel #1
0
  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;
        }
      }
    }
  }
        protected override void OnDisplay()
        {
            AdminPanel adminPanel = PanelManager.m_Instance.GetAdminPanel() as AdminPanel;

            adminPanel.ActivatePromoBorder(true);
            InputManager.m_Instance.TriggerHapticsPulse(InputManager.ControllerName.Wand,
                                                        4, 0.15f, 0.1f);

            // Parent and position the button highlight to our target button.
            PromoManager.m_Instance.ButtonHighlight.transform.parent = adminPanel.AdvancedButton;
            PromoManager.m_Instance.ResetButtonHighlightXf();
            PromoManager.m_Instance.ButtonHighlight.SetActive(true);

            // We're not using BasePromo.m_HintObject because we need to control when it's being shown.
            m_CustomHintObject = adminPanel.AdvancedModeHintObject;
        }