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
Exemplo n.º 1
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
        //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);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Remove the selection.
    /// </summary>

    void OnDisable()
    {
        if (UICamera.IsHighlighted(gameObject))
        {
            OnSelect(false);
        }
    }
Exemplo n.º 3
0
 private void OnDisable()
 {
     if (UICamera.IsHighlighted(base.gameObject))
     {
         this.OnSelect(false);
     }
 }
Exemplo n.º 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);
        }
    }
Exemplo n.º 5
0
    /// <summary>
    /// If the object is currently highlighted, it should also be selected.
    /// </summary>

    void OnEnable()
    {
        if (UICamera.IsHighlighted(gameObject))
        {
            OnSelect(true);
        }
    }
Exemplo n.º 6
0
 private void OnEnable()
 {
     if (mStarted)
     {
         OnHover(UICamera.IsHighlighted(base.gameObject));
     }
 }
Exemplo n.º 7
0
 private void OnEnable()
 {
     if (UICamera.IsHighlighted(base.gameObject))
     {
         OnSelect(isSelected: true);
     }
 }
Exemplo n.º 8
0
 void OnEnable()
 {
     if (target != null)
     {
         target.spriteName = UICamera.IsHighlighted(gameObject) ? hoverSprite : normalSprite;
     }
 }
Exemplo n.º 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);
            }
        }
    }
Exemplo n.º 10
0
    /// <summary>
    /// Remove the selection.
    /// </summary>

    protected override void Disable()
    {
        if (UICamera.IsHighlighted(receiver))
        {
            OnSelect(false);
        }
    }
Exemplo n.º 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);
            }
        }
    }
Exemplo n.º 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);
        }
    }
Exemplo n.º 13
0
 protected override void Enable()
 {
     if (mStarted && mHighlighted)
     {
         OnHover(UICamera.IsHighlighted(receiver));
     }
 }
Exemplo n.º 14
0
 private void OnEnable()
 {
     if (this.mStarted && this.mHighlighted)
     {
         this.OnHover(UICamera.IsHighlighted(base.gameObject));
     }
 }
Exemplo n.º 15
0
 void OnEnable()
 {
     if (mStarted && mHighlighted)
     {
         OnHover(UICamera.IsHighlighted(gameObject));
     }
 }
Exemplo n.º 16
0
 private void OnEnable()
 {
     if (UICamera.IsHighlighted(base.gameObject))
     {
         this.OnSelect(true);
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
    }
Exemplo n.º 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);
    }
Exemplo n.º 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()));
     }
 }
Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 25
0
 public virtual void OnPress(bool isPressed)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(gameObject) ? hover : mColor));
     }
 }
Exemplo n.º 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));
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 28
0
 protected virtual void OnPress(bool isPressed)
 {
     if (!mInitDone)
     {
         Init();
     }
     if (enabled)
     {
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(gameObject) ? hover : mColor));
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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;
		}
	}