示例#1
0
 // Token: 0x06005543 RID: 21827 RVA: 0x001D67D8 File Offset: 0x001D4BD8
 public static void VRC_Tutorial_ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
 {
     if (TutorialManager.Instance != null)
     {
         TutorialManager.Instance.ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
     }
 }
示例#2
0
 // Token: 0x0600557C RID: 21884 RVA: 0x001D8020 File Offset: 0x001D6420
 private bool IsShowingOtherLabelOfType(TutorialLabelType type, Transform exclude)
 {
     foreach (TutorialManager.ActiveLabel activeLabel in this._activeLabels.Values)
     {
         if (activeLabel.Type == type && activeLabel.TargetObject != exclude && activeLabel.Label.IsActive)
         {
             return(true);
         }
     }
     return(false);
 }
示例#3
0
    // Token: 0x06005577 RID: 21879 RVA: 0x001D7BF8 File Offset: 0x001D5FF8
    private bool ActivateLabel(Transform targetObj, string id, TutorialLabelType type, ControllerHand hand, ControllerInputUI controllerPart, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, Vector3?tetherPos, Vector3?labelPos, AttachMode attachMode, bool showOffscreen, float scale)
    {
        if (!this.AreLabelsEnabled)
        {
            return(false);
        }
        if (this.TutorialLabelPrefab == null)
        {
            return(false);
        }
        bool flag = targetObj == null || type == TutorialLabelType.Popup || type == TutorialLabelType.PopupAttached;

        if (targetObj == null)
        {
            targetObj = this.FloatingLabelTransform;
        }
        TutorialManager.ActiveLabel activeLabel = this.FindActiveLabel(targetObj.GetInstanceID());
        if (activeLabel == null)
        {
            if (flag)
            {
                Vector3 value = TutorialLabel.CalculateFloatingLabelPosition();
                tetherPos = new Vector3?(value);
                labelPos  = new Vector3?(value);
            }
            else if (tetherPos == null || labelPos == null)
            {
                Vector3 value2;
                Vector3 value3;
                TutorialLabel.FindLabelAttachPoints(targetObj, out value2, out value3);
                if (tetherPos == null)
                {
                    tetherPos = new Vector3?(value2);
                }
                if (labelPos == null)
                {
                    labelPos = new Vector3?(value3);
                }
            }
            if (!showOffscreen && !VRCTrackingManager.IsPointWithinHMDView(labelPos.Value))
            {
                return(false);
            }
            activeLabel = new TutorialManager.ActiveLabel();
            activeLabel.TargetObject = targetObj;
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.TutorialLabelPrefab);
            activeLabel.Label = gameObject.GetComponent <TutorialLabel>();
            activeLabel.Label.Init();
            this._activeLabels.Add(activeLabel.TargetObject.GetInstanceID(), activeLabel);
            activeLabel.Label.SetTargetObject(targetObj, attachMode, tetherPos.Value, labelPos.Value, flag);
        }
        else if (activeLabel.Label.IsActive && activeLabel.Priority > priority)
        {
            VRC.Core.Logger.LogOnceEvery(10f, this, string.Concat(new object[]
            {
                "TutorialManager: Existing label (",
                activeLabel.ID,
                ", ",
                activeLabel.TargetObject.name,
                ") \"",
                activeLabel.Label.TextString,
                "\" has higher priority ",
                activeLabel.Priority,
                " > ",
                priority,
                ", discarding new one"
            }));
            return(false);
        }
        activeLabel.ID   = id;
        activeLabel.Type = type;
        activeLabel.SetController(hand, controllerPart);
        activeLabel.ShowOffscreen = showOffscreen;
        activeLabel.Priority      = priority;
        activeLabel.Label.SetText(text, textSecondary);
        activeLabel.Label.SetIcon(action, actionSecondary);
        activeLabel.Label.SetTextScaleOverride(scale);
        bool invertLabelAlignment = type == TutorialLabelType.Controller && hand == ControllerHand.Right && VRCInputManager.LastInputMethod == VRCInputManager.InputMethod.Oculus;

        activeLabel.Label.IsFloatingLabel      = flag;
        activeLabel.Label.InvertLabelAlignment = invertLabelAlignment;
        activeLabel.Label.IsAttachedToView     = (type == TutorialLabelType.PopupAttached);
        activeLabel.Label.RefreshComponentPositions();
        activeLabel.TimeToLive = duration;
        activeLabel.Label.Activate();
        return(true);
    }
示例#4
0
    // Token: 0x0600556E RID: 21870 RVA: 0x001D794C File Offset: 0x001D5D4C
    public void ActivateObjectLabel(Transform targetObject, string id, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
    {
        float scale = (type != TutorialLabelType.AreaMarker) ? 1f : 2f;

        this.ActivateLabel(targetObject, id, type, hand, ControllerInputUI.None, text, action, textSecondary, actionSecondary, duration, priority, null, null, attachMode, showOffscreen, scale);
    }
示例#5
0
 // Token: 0x0600556D RID: 21869 RVA: 0x001D7920 File Offset: 0x001D5D20
 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
 {
     this.ActivateObjectLabel(targetObject, "<no id>", type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
 }
 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
 {
     Tutorial.ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
 }
 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
 {
     Tutorial.ActivateObjectLabel(targetObject, type, hand, text, ControllerActionUI.None, string.Empty, ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
 }