IsHighlighted() static public method

Returns whether the widget should be currently highlighted as far as the UICamera knows.
static public IsHighlighted ( GameObject go ) : bool
go GameObject
return bool
    private void OnEnable()
    {
        //IL_000d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0012: Expected O, but got Unknown
        //IL_004a: Unknown result type (might be due to invalid IL or missing references)
        //IL_007d: Unknown result type (might be due to invalid IL or missing references)
        if (mStarted)
        {
            OnHover(UICamera.IsHighlighted(this.get_gameObject()));
        }
        if (UICamera.currentTouch != null)
        {
            if (trigger == Trigger.OnPress || trigger == Trigger.OnPressTrue)
            {
                mActivated = (UICamera.currentTouch.pressed == this.get_gameObject());
            }
            if (trigger == Trigger.OnHover || trigger == Trigger.OnHoverTrue)
            {
                mActivated = (UICamera.currentTouch.current == this.get_gameObject());
            }
        }
        UIToggle component = this.GetComponent <UIToggle>();

        if (component != null)
        {
            EventDelegate.Add(component.onChange, OnToggle);
        }
    }
Example #2
0
    /// <summary>
    /// Remove the selection.
    /// </summary>

    void OnDisable()
    {
        if (UICamera.IsHighlighted(gameObject))
        {
            OnSelect(false);
        }
    }
Example #3
0
 private void OnDisable()
 {
     if (UICamera.IsHighlighted(base.gameObject))
     {
         this.OnSelect(false);
     }
 }
Example #4
0
    void OnEnable()
    {
                #if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return;
        }
                #endif
        if (mStarted)
        {
            OnHover(UICamera.IsHighlighted(gameObject));
        }

        if (UICamera.currentTouch != null)
        {
            if (trigger == Trigger.OnPress || trigger == Trigger.OnPressTrue)
            {
                mActivated = (UICamera.currentTouch.pressed == gameObject);
            }

            if (trigger == Trigger.OnHover || trigger == Trigger.OnHoverTrue)
            {
                mActivated = (UICamera.currentTouch.current == gameObject);
            }
        }

        UIToggle toggle = GetComponent <UIToggle>();
        if (toggle != null)
        {
            EventDelegate.Add(toggle.onChange, OnToggle);
        }
    }
Example #5
0
    /// <summary>
    /// If the object is currently highlighted, it should also be selected.
    /// </summary>

    void OnEnable()
    {
        if (UICamera.IsHighlighted(gameObject))
        {
            OnSelect(true);
        }
    }
Example #6
0
 private void OnEnable()
 {
     if (mStarted)
     {
         OnHover(UICamera.IsHighlighted(base.gameObject));
     }
 }
Example #7
0
 private void OnEnable()
 {
     if (UICamera.IsHighlighted(base.gameObject))
     {
         OnSelect(isSelected: true);
     }
 }
Example #8
0
 void OnEnable()
 {
     if (target != null)
     {
         target.spriteName = UICamera.IsHighlighted(gameObject) ? hoverSprite : normalSprite;
     }
 }
Example #9
0
    /// <summary>
    /// Set the initial state.
    /// </summary>

    protected virtual void OnEnable()
    {
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return;
        }
#endif
        if (mInitDone)
        {
            OnHover(UICamera.IsHighlighted(gameObject));
        }

        if (UICamera.currentTouch != null)
        {
            if (UICamera.currentTouch.pressed == gameObject)
            {
                OnPress(true);
            }
            else if (UICamera.currentTouch.current == gameObject)
            {
                OnHover(true);
            }
        }
    }
Example #10
0
    /// <summary>
    /// Remove the selection.
    /// </summary>

    protected override void Disable()
    {
        if (UICamera.IsHighlighted(receiver))
        {
            OnSelect(false);
        }
    }
Example #11
0
    void OnEnable()
    {
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return;
        }
#endif
        if (mStarted)
        {
            OnHover(UICamera.IsHighlighted(gameObject));
        }

        if (UICamera.currentTouch != null)
        {
            if (trigger == Trigger.OnPress || trigger == Trigger.OnPressTrue)
            {
                mActivated = (UICamera.currentTouch.pressed == gameObject);
            }

            if (trigger == Trigger.OnHover || trigger == Trigger.OnHoverTrue)
            {
                mActivated = (UICamera.currentTouch.current == gameObject);
            }
        }
    }
Example #12
0
    /// <summary>
    /// If the object is currently highlighted, it should also be selected.
    /// </summary>

    protected override void Enable()
    {
        if (UICamera.IsHighlighted(receiver))
        {
            OnSelect(true);
        }
    }
Example #13
0
 protected override void Enable()
 {
     if (mStarted && mHighlighted)
     {
         OnHover(UICamera.IsHighlighted(receiver));
     }
 }
Example #14
0
 private void OnEnable()
 {
     if (this.mStarted && this.mHighlighted)
     {
         this.OnHover(UICamera.IsHighlighted(base.gameObject));
     }
 }
Example #15
0
 void OnEnable()
 {
     if (mStarted && mHighlighted)
     {
         OnHover(UICamera.IsHighlighted(gameObject));
     }
 }
Example #16
0
 private void OnEnable()
 {
     if (UICamera.IsHighlighted(base.gameObject))
     {
         this.OnSelect(true);
     }
 }
Example #17
0
 void OnPress(bool isPressed)
 {
     if (enabled)
     {
         TweenPosition.Begin(tweenTarget.gameObject, duration, isPressed ? mPos + pressed :
                             (UICamera.IsHighlighted(gameObject) ? mPos + hover : mPos)).method = UITweener.Method.EaseInOut;
     }
 }
Example #18
0
 void OnPress(bool isPressed)
 {
     if (enabled)
     {
         TweenScale.Begin(tweenTarget.gameObject, duration, isPressed ? Vector3.Scale(mScale, pressed) :
                          (UICamera.IsHighlighted(gameObject) ? Vector3.Scale(mScale, hover) : mScale)).method = UITweener.Method.EaseInOut;
     }
 }
Example #19
0
 void OnPress(bool isPressed)
 {
     if (enabled)
     {
         TweenRotation.Begin(tweenTarget.gameObject, duration, isPressed ? mRot * Quaternion.Euler(pressed) :
                             (UICamera.IsHighlighted(gameObject) ? mRot * Quaternion.Euler(hover) : mRot)).method = UITweener.Method.EaseInOut;
     }
 }
Example #20
0
    public void RunTweenScale()
    {
        Vector3 b          = new Vector3(1.1f, 1.1f, 1.1f);
        Vector3 b2         = new Vector3(1.05f, 1.05f, 1.05f);
        Vector3 localScale = base.gameObject.transform.localScale;
        bool    flag       = true;

        TweenScale.Begin(base.gameObject, 0f, (!flag) ? ((!UICamera.IsHighlighted(base.gameObject)) ? localScale : Vector3.Scale(localScale, b)) : Vector3.Scale(localScale, b2)).method = UITweener.Method.EaseInOut;
    }
Example #21
0
    static int IsHighlighted(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        GameObject arg0 = (GameObject)LuaScriptMgr.GetUnityObject(L, 1, typeof(GameObject));
        bool       o    = UICamera.IsHighlighted(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Example #22
0
 private void OnEnable()
 {
     //IL_000d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0012: Expected O, but got Unknown
     if (mStarted)
     {
         OnHover(UICamera.IsHighlighted(this.get_gameObject()));
     }
 }
Example #23
0
 void UpdateImage()
 {
     if (this.enabled && this.target != null)
     {
         if (!string.IsNullOrEmpty(this.normalSprite) && !string.IsNullOrEmpty(this.hoverSprite))
         {
             this.target.spriteName = UICamera.IsHighlighted(gameObject) ? this.hoverSprite : this.normalSprite;
         }
     }
 }
Example #24
0
 public virtual void OnPress(bool isPressed)
 {
     if (base.enabled)
     {
         if (!this.mStarted)
         {
             this.Start();
         }
         TweenColor.Begin(this.tweenTarget, this.duration, !isPressed ? (!UICamera.IsHighlighted(base.gameObject) ? this.mColor : this.hover) : this.pressed);
     }
 }
Example #25
0
 public virtual void OnPress(bool isPressed)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(gameObject) ? hover : mColor));
     }
 }
Example #26
0
 public virtual void OnPress(bool isPressed)
 {
     if (base.enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : ((!UICamera.IsHighlighted(base.gameObject)) ? mColor : hover));
     }
 }
Example #27
0
 private void OnPress(Boolean isPressed)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenScale.Begin(tweenTarget.gameObject, duration, (!isPressed) ? ((!UICamera.IsHighlighted(gameObject)) ? mScale : Vector3.Scale(mScale, hover)) : Vector3.Scale(mScale, pressed)).method = UITweener.Method.EaseInOut;
     }
 }
Example #28
0
 protected virtual void OnPress(bool isPressed)
 {
     if (!mInitDone)
     {
         Init();
     }
     if (enabled)
     {
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(gameObject) ? hover : mColor));
     }
 }
Example #29
0
 protected virtual void OnPress(bool isPressed)
 {
     if (!this.mInitDone)
     {
         this.Init();
     }
     if (base.enabled)
     {
         TweenColor.Begin(this.tweenTarget, this.duration, !isPressed ? (!UICamera.IsHighlighted(base.gameObject) ? this.mColor : this.hover) : this.pressed);
     }
 }
Example #30
0
	private void OnPress(bool isPressed)
	{
		if (base.enabled)
		{
			if (!this.mStarted)
			{
				this.Start();
			}
			TweenRotation.Begin(this.tweenTarget.gameObject, this.duration, (!isPressed) ? ((!UICamera.IsHighlighted(base.gameObject)) ? this.mRot : (this.mRot * Quaternion.Euler(this.hover))) : (this.mRot * Quaternion.Euler(this.pressed))).method = UITweener.Method.EaseInOut;
		}
	}