Begin() static public method

Start the tweening operation.
static public Begin ( GameObject go, float duration, Color color ) : TweenColor,
go GameObject
duration float
color Color
return TweenColor,
コード例 #1
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);
     }
 }
コード例 #2
0
 private void newCellColor(int stroka, int stolbec)
 {
     for (int i = 0; i < controller.cells.Length; i++)
     {
         if (int.Parse(controller.cells [i].name.Substring(4, 1)) == stroka && int.Parse(controller.cells [i].name.Substring(5, 1)) == stolbec)
         {
             TweenColor.Begin(controller.cells [i], 0.2f, Color.green);
             break;
         }
     }
 }
コード例 #3
0
 private void OnHover(Boolean p_isOver)
 {
     if (!m_isButton)
     {
         return;
     }
     if (!m_selected)
     {
         TweenColor.Begin(m_classIcon.gameObject, 0.1f, (!p_isOver) ? m_pBackgroundNormalColor : m_hoverColor);
     }
 }
コード例 #4
0
 protected virtual void OnPress(bool isPressed)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : mColor);
     }
 }
コード例 #5
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);
     }
 }
コード例 #6
0
ファイル: UIButtonColor.cs プロジェクト: antonsmetanin/GeMMa
 protected override void OnPress(bool isPressed)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(receiver) ? hover : mColor));
     }
 }
コード例 #7
0
 protected virtual void OnPress(bool isPressed)
 {
     if (!mInitDone)
     {
         Init();
     }
     if (enabled)
     {
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(gameObject) ? hover : mColor));
     }
 }
コード例 #8
0
 protected virtual void OnDragOver()
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Awake();
         }
         TweenColor.Begin(tweenTarget, duration, pressed);
     }
 }
コード例 #9
0
 void OnPress(bool isPressed)
 {
     if (!mInitDone)
     {
         Init();
     }
     if (enabled)
     {
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : mColor);
     }
 }
コード例 #10
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));
     }
 }
コード例 #11
0
 protected virtual void OnHover(bool isOver)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isOver ? hover : mColor);
     }
 }
コード例 #12
0
 public static void TweenColorBegin(GameObject go, float duration, float a)
 {
     UIWidget[] mWidgets = go.GetComponentsInChildren <UIWidget>();
     foreach (UIWidget mWidget in mWidgets)
     {
         TweenColor.Begin(
             mWidget.gameObject,
             duration,
             new Color(mWidget.color.r, mWidget.color.g, mWidget.color.b, a));
     }
 }
コード例 #13
0
 void OnHover(bool isOver)
 {
     if (!mInitDone)
     {
         Init();
     }
     if (enabled)
     {
         TweenColor.Begin(tweenTarget, duration, isOver ? hover : mColor);
     }
 }
コード例 #14
0
 public virtual void OnPress(bool isPressed)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(gameObject) ? hover : mColor));
     }
 }
コード例 #15
0
 void OnPress(bool _isPressed)
 {
     if (_isPressed)
     {
         TweenColor.Begin(gameObject, m_duration, Color.gray);
     }
     else
     {
         TweenColor.Begin(gameObject, m_duration, Color.white);
     }
 }
コード例 #16
0
    /// <summary>
    /// 目前是自动战斗不受VIP限定
    /// </summary>
    IEnumerator VipOpenAuto()
    {
        StopCoroutine("FadeOut");
        SpeedTips.gameObject.SetActive(true);
        SpeedTips.text  = Core.Data.stringManager.getString(51);
        SpeedTips.color = new Color(1f, 1f, 1f, 0f);
        TweenColor.Begin(SpeedTips.gameObject, 0.1f, Color.white);
        yield return(new WaitForSeconds(1f));

        StartCoroutine("FadeOut");
    }
コード例 #17
0
 protected virtual void OnDragOut()
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, mColor);
     }
 }
コード例 #18
0
    /// <summary>
    /// Update the button's color to either enabled or disabled state.
    /// </summary>
    public void UpdateColor(bool shouldBeEnabled)
    {
        float duration = 0.2f;

        foreach (UIWidget tweenTarget_ in _widgetColors.Keys)
        {
            if (tweenTarget_ != null && NGUITools.GetActive(tweenTarget_.gameObject))
            {
                TweenColor.Begin(tweenTarget_.gameObject, duration, shouldBeEnabled ? _widgetColors[tweenTarget_]: disabledColor);
            }
        }
    }
コード例 #19
0
 private void OnHover(Boolean p_isOver)
 {
     m_isHovered = p_isOver;
     if (m_selected)
     {
         TweenColor.Begin(m_BG.gameObject, 0.1f, (!p_isOver) ? m_selectionColor : m_selectionHoverColor);
     }
     else
     {
         TweenColor.Begin(m_BG.gameObject, 0.1f, (!p_isOver) ? m_pBackgroundNormalColor : m_hoverColor);
     }
 }
コード例 #20
0
    public void PlayHighlight()
    {
        if (m_isPlayingHighlight)
        {
            return;
        }
        m_isPlayingHighlight = true;
        Color bgColor = m_sprBG.color;

        m_sprBG.color = Color.gray;
        TweenColor.Begin(m_sprBG.cachedGameObject, 0.3f, bgColor).SetOnFinished(() => m_isPlayingHighlight = false);
    }
コード例 #21
0
 public void SetSelected(Boolean p_selected)
 {
     m_selected = p_selected;
     if (m_selected)
     {
         TweenColor.Begin(m_selectBackground.gameObject, 0.1f, (!m_isHovered) ? m_selectionColor : m_selectionHoverColor);
     }
     else
     {
         TweenColor.Begin(m_selectBackground.gameObject, 0.1f, (!m_isHovered) ? m_notSelectedColor : m_hoverColor);
     }
 }
コード例 #22
0
    /// <summary>
    /// Fade out or fade in the checkmark and notify the target of OnChecked event.
    /// </summary>

    public void Set(bool state)
    {
        if (!mStarted)
        {
            mChecked      = state;
            startsChecked = state;
            if (checkSprite != null)
            {
                checkSprite.alpha = state ? 1f : 0f;
            }
        }
        else if (mChecked != state)
        {
            // Uncheck all other checkboxes
            if (radioButtonRoot != null && state)
            {
                UICheckbox[] cbs = radioButtonRoot.GetComponentsInChildren <UICheckbox>(true);

                for (int i = 0, imax = cbs.Length; i < imax; ++i)
                {
                    UICheckbox cb = cbs[i];
                    if (cb != this && cb.radioButtonRoot == radioButtonRoot)
                    {
                        cb.Set(false);
                    }
                }
            }

            // Remember the state
            mChecked = state;

            // Tween the color of the checkmark
            if (checkSprite != null)
            {
                Color c = checkSprite.color;
                c.a = mChecked ? 1f : 0f;
                TweenColor.Begin(checkSprite.gameObject, 0.2f, c);
            }

            // Send out the event notification
            if (eventReceiver != null && !string.IsNullOrEmpty(functionName))
            {
                current = this;
                eventReceiver.SendMessage(functionName, mChecked, SendMessageOptions.DontRequireReceiver);
            }

            // Play the checkmark animation
            if (checkAnimation != null)
            {
                ActiveAnimation.Play(checkAnimation, state ? Direction.Forward : Direction.Reverse);
            }
        }
    }
コード例 #23
0
 protected virtual void OnHover(bool isOver)
 {
     if (base.enabled)
     {
         if (!this.mInitDone)
         {
             this.Init();
         }
         TweenColor.Begin(this.tweenTarget, this.duration, (!isOver ? this.mColor : this.hover));
         this.mHighlighted = isOver;
     }
 }
コード例 #24
0
 public virtual void OnHover(bool isOver)
 {
     if (base.enabled)
     {
         if (!this.mStarted)
         {
             this.Start();
         }
         TweenColor.Begin(this.tweenTarget, this.duration, !isOver ? this.mColor : this.hover);
         this.mHighlighted = isOver;
     }
 }
コード例 #25
0
    IEnumerator fadeOutJoystick()
    {
        yield return(new WaitForSeconds(fadeOutDelay));

        foreach (UIWidget widget in widgetsToFade)
        {
            Color lastColor = widget.color;
            Color newColor  = lastColor;
            newColor.a = fadeOutAlpha;
            TweenColor.Begin(widget.gameObject, 0.5f, newColor).method = UITweener.Method.EaseOut;
        }
    }
コード例 #26
0
    protected override UITweener startCloseEffectInternal(GameObject widget)
    {
        if (widget.GetComponent <UIWidget>() != null)
        {
            TweenColor tc = TweenColor.Begin(widget, duration, fadeFrom);
            tc.style = UITweener.Style.Once;
            tc.from  = fadeTo;

            return(tc as UITweener);
        }
        return(null);
    }
コード例 #27
0
 public virtual void OnHover(bool isOver)
 {
     if (enabled)
     {
         if (!mStarted)
         {
             Start();
         }
         TweenColor.Begin(tweenTarget, duration, isOver ? hover : mColor);
         mHighlighted = isOver;
     }
 }
コード例 #28
0
 protected virtual void OnHover(bool isOver)
 {
     if (enabled)
     {
         if (!mInitDone)
         {
             Init();
         }
         TweenColor.Begin(tweenTarget, duration, isOver ? hover : mColor);
         mHighlighted = isOver;
     }
 }
コード例 #29
0
 public void SetSelected(ERace p_race)
 {
     m_selected = (m_race == p_race);
     if (m_selected)
     {
         TweenColor.Begin(m_BG.gameObject, 0.1f, (!m_isHovered) ? m_selectionColor : m_selectionHoverColor);
     }
     else
     {
         TweenColor.Begin(m_BG.gameObject, 0.1f, (!m_isHovered) ? m_pBackgroundNormalColor : m_hoverColor);
     }
 }
コード例 #30
0
 public void TweenLeftTimeColor()
 {
     if (m_bTweenColor)
     {
         m_bTweenColor = false;
         if (MyHead.HourGlassLeftTime)
         {
             TweenColor tc = TweenColor.Begin(MyHead.HourGlassLeftTime.gameObject, 0.5f, Color.red);
             tc.style = UITweener.Style.PingPong;
         }
     }
 }