Ejemplo n.º 1
0
 public void ConstantOff(float time = 0.25f)
 {
     if (highlighter)
     {
         highlighter.ConstantOff(time);
     }
 }
Ejemplo n.º 2
0
        public virtual void DoFocus(Selector cursor, bool state)
        {
            // OVERRIDE THIS VIRTUALLY to allow vodgets to highlight before DoGrab.
            if (state)
            {
#if USING_HIGHLIGHTING
                Highlighter h = transform.gameObject.GetComponent <Highlighter>();
                if (h != null)
                {
                    h.ConstantOn(0.1f);
                }
#endif
                cursor.Rumble(3999);
            }
            else
            {
#if USING_HIGHLIGHTING
                Highlighter h = transform.gameObject.GetComponent <Highlighter>();
                if (h != null)
                {
                    h.ConstantOff(0.1f);
                }
#endif
            }

            if (onFocus != null)
            {
                onFocus.Invoke(state);
            }
        }
    /// <summary>
    /// 关闭高亮
    /// </summary>
    public void HighlightOff()
    {
        //Highlighter h = transform.parent.gameObject.AddMissingComponent<Highlighter>();
        Highlighter h = gameObject.AddMissingComponent <Highlighter>();

        h.ConstantOff();
    }
 public void HideHighlight()
 {
     if (_highlighter != null)
     {
         _highlighter.ConstantOff();
     }
 }
Ejemplo n.º 5
0
    IEnumerator DeHighlight(float delay)
    {
        yield return(new WaitForSeconds(delay));

        highlighter.ConstantOff(1);

        iTween.ValueTo(gameObject, iTween.Hash("from", instadMaterial.GetColor("_EmissionColor"), "to", originalEmissionColor, "time", 0.5f, "onupdate", "OnEmissionUpdate"));
//		instadMaterial.DOColor (originalEmissionColor, "_EmissionColor", 0.5f);
    }
Ejemplo n.º 6
0
 //
 private void UpdateInternal()
 {
     if (revealCount > 0)
     {
         h.ConstantOn(revealColor);
     }
     else
     {
         h.ConstantOff();
     }
 }
Ejemplo n.º 7
0
 // Update is called once per frame
 void Update()
 {
     if (Show)
     {
         hlighter.ConstantOn(Color.white);
     }
     else
     {
         hlighter.ConstantOff();
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 关闭闪烁
 /// </summary>
 public void ConstantOff()
 {
     if (RenderObj.GetComponent <Highlighter>() != null)
     {
         Highlighter h = RenderObj.AddMissingComponent <Highlighter>();
         h.ConstantOff();
         //SetRendererEnable(false);
     }
     else
     {
         Debug.LogError(string.Format("{0} Highlighter is null", gameObject.name));
     }
 }
Ejemplo n.º 9
0
    public void lightOff()
    {
        if (highlighter == null)
        {
            return;
        }

        highlighter.ConstantOff();
        highlighter.FlashingOff();
        timer = 0.0f;

        state = HighligerState.Off;
    }
        protected override void OnInitialize()
        {
            highlighter = GetComponent <Highlighter>();

            Core.IsAlive.Subscribe(x =>
            {
                if (x)
                {
                    highlighter.ConstantOnImmediate(this.PlayerId.ToColor());
                }
                else
                {
                    highlighter.ConstantOff();
                }
            });
        }
Ejemplo n.º 11
0
        private static void Restore(Part part, bool recursive)
        {
            try
            {
                // Restore the part to default.
                part.SetHighlightDefault();
                part.SetHighlight(false, recursive);

                Highlighter highlighter = part.highlighter;
                highlighter.ConstantOff();
                highlighter.SeeThroughOff();
            }
            catch (NullReferenceException)
            {
                // Nothing to do here except swallow it, the part was likely deleted and now attempting to restore it is going to fail because
                // the object is being torn down.

                // Maybe only do actual part tracking during repaint?
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 是否打开高亮阴影
        /// </summary>
        /// <param name="isShow"></param>
        public void OpenOrNotFullViewModel(bool isShow)
        {
            if (!mIsShowShadowModel)
            {
                return;
            }
            if (mViewGameObject == null)
            {
                return;
            }
            mViewGameObject.SetActive(isShow);
            Highlighter highlighter = mViewGameObject.AddSingleComponent <Highlighter>();

            if (isShow)
            {
                highlighter.ConstantOn(Color.black);
            }
            else
            {
                highlighter.ConstantOff();
            }
        }
Ejemplo n.º 13
0
    /// <summary>
    /// API:修改物体是否开启高亮
    /// </summary>
    /// <param name="showHightlight">是否开启高亮</param>
    /// <param name="type">高亮类型</param>
    public void SwithHightlight(bool showHightlight, HighlightType type)
    {
        switch (type)
        {
        case HighlightType.Once:
            if (showHightlight)
            {
                h.ConstantOnImmediate(highlightColor);
            }
            else
            {
                h.ConstantOffImmediate();
            }
            break;

        case HighlightType.Constant:
            if (showHightlight)
            {
                h.ConstantOn(highlightColor);
            }
            else
            {
                h.ConstantOff();
            }
            break;

        case HighlightType.Flash:
            if (showHightlight)
            {
                h.FlashingOn(highlightColor, new Color(0, 0, 0, 0));
            }
            else
            {
                h.TweenStop();
            }
            break;
        }
    }
Ejemplo n.º 14
0
 void SetHightlight()
 {
     ray = Camera.main.ScreenPointToRay(Input.mousePosition);
     if (Physics.Raycast(ray, out hitInfo))
     {
         GameObject go = hitInfo.collider.gameObject;
         if (go.tag == "Player")
         {
             if (lastHighlighter == null)
             {
                 lastHighlighter = go.GetComponent <Highlighter>();
                 lastHighlighter.ConstantOn(Color.green);
             }
         }
         else
         {
             if (lastHighlighter != null)
             {
                 lastHighlighter.ConstantOff();
                 lastHighlighter = null;
             }
         }
     }
 }
Ejemplo n.º 15
0
 public void ConstantLightOff()
 {
     h.ConstantOff();
 }
Ejemplo n.º 16
0
 //
 public void Shine()
 {
     h.FlashingOff();
     h.ConstantOnImmediate(Color.cyan);
     h.ConstantOff();
 }
Ejemplo n.º 17
0
 public void HideHighlighter()
 {
     mHighlight.ConstantOff();
 }