Exemple #1
0
    public void changeGameState(GameState change)
    {
        switch (change)
        {
        case GameState.Pause:
            gameObject.SetActive(true);
            tColor.Play(true);
            break;

        case GameState.Play:
            tColor.Play(false);
            StartCoroutine(fadeOut());
            break;
        }
    }
Exemple #2
0
        void FlashTrainCountAction(int newCount)
        {
            Duan_1.text = Duan_0.text;
            Duan_0.text = newCount.ToString();

            TweenPosition tween_p0 = Duan_0.gameObject.GetComponent <TweenPosition>();
            TweenColor tween_c0    = Duan_0.gameObject.GetComponent <TweenColor>();

            tween_p0.ResetToBeginning();
            tween_p0.enabled = true;
            tween_p0.Play(true);

            tween_c0.ResetToBeginning();
            tween_c0.enabled = true;
            tween_c0.Play(true);

            TweenPosition tween_p1 = Duan_1.gameObject.GetComponent <TweenPosition>();
            TweenColor tween_c1    = Duan_1.gameObject.GetComponent <TweenColor>();

            tween_p1.ResetToBeginning();
            tween_p1.enabled = true;
            tween_p1.Play(true);

            tween_c1.ResetToBeginning();
            tween_c1.enabled = true;
            tween_c1.Play(true);
        }
Exemple #3
0
        void FlashTrainStarAction(int newStar)
        {
            Ji_1.text = Ji_0.text;
            Ji_0.text = newStar.ToString();

            TweenPosition tween_p0 = Ji_0.gameObject.GetComponent <TweenPosition>();
            TweenColor tween_c0    = Ji_0.gameObject.GetComponent <TweenColor>();

            tween_p0.ResetToBeginning();
            tween_p0.enabled = true;
            tween_p0.Play(true);

            tween_c0.ResetToBeginning();
            tween_c0.enabled = true;
            tween_c0.Play(true);

            TweenPosition tween_p1 = Ji_1.gameObject.GetComponent <TweenPosition>();
            TweenColor tween_c1    = Ji_1.gameObject.GetComponent <TweenColor>();

            tween_p1.ResetToBeginning();
            tween_p1.enabled = true;
            tween_p1.Play(true);

            tween_c1.ResetToBeginning();
            tween_c1.enabled = true;
            tween_c1.Play(true);
        }
Exemple #4
0
    private void PlayColour(bool direction, GameObject toPlay)
    {
        //play tween colour
        TweenColor twCol = toPlay.GetComponent <TweenColor>();

        twCol.Play(direction);
    }
Exemple #5
0
        protected override void OnPlay()
        {
            base.OnPlay();

            _tween.From = _from;
            _tween.To   = _to;
            _tween.Play();
        }
Exemple #6
0
    private void HighlightNpc(bool highlight = true)
    {
//        inputState = !highlight;

        m_ta?.Play(highlight);
        m_ta2?.Play(highlight);
        m_tb?.Play(highlight);
        m_tc?.Play(highlight);
        moduleGlobal.OnGlobalTween(highlight, 1);
    }
Exemple #7
0
    // Enleve un nombre de mana
    public void removeMana(int count)
    {
        for (int i = mActiveManas - 1; i > mActiveManas - count - 1; i--)
        {
            TweenColor tween = mManas[i].GetComponent <TweenColor> ( );
            tween.delay = (mActiveManas - 1 - i) * tween.duration;
            tween.Play(false);
        }
        mActiveManas -= count;

        updateManaInfos( );
    }
Exemple #8
0
    // Active un nombre total de mana
    public void activeMana(int count)
    {
        mActiveManas = count;
        for (int i = 0; i < count; i++)
        {
            TweenColor tween = mManas[i].GetComponent <TweenColor> ( );
            tween.delay = i * .2f;
            tween.Play(true);
        }

        updateManaInfos( );
    }
Exemple #9
0
    private void PlayHours(bool direction)
    {
        //play tween pos
        TweenPosition twPos = hoursObj.GetComponent <TweenPosition>();

        twPos.Play(direction);

        //play tween colour
        TweenColor twCol = hoursObj.GetComponent <TweenColor>();

        twCol.Play(direction);

        //play tween scale
        TweenScale twSca = hoursObj.GetComponent <TweenScale>();

        twSca.Play(direction);
    }
Exemple #10
0
    protected void FadeIn_()
    {
        //lock UI
        TweenColor colorTweener = fadeTexture.GetComponentInChildren <TweenColor>();

        if (colorTweener == null)
        {
            colorTweener = fadeTexture.gameObject.AddComponent <TweenColor>();
        }

        colorTweener.from = new Color(0f, 0f, 0f, 0f);
        colorTweener.to   = fadeColor;

        colorTweener.duration = appearFadeDuration;
        colorTweener.Reset();
        colorTweener.Play(true);
    }
Exemple #11
0
    public void AddChat(string name, string content, int type = 0)   //0:all 1:Group 2:Someone 3:Sytem 4:Red Notice
    {
        switch (type)
        {
        case 0:
            name = "[DE625B][" + name + "]:[-]";
            break;

        case 1:
            name    = "[7F63FF][" + name + "]:[-]";
            content = "[7F63FF]" + content + "[-]";
            break;

        case 2:
            name    = "[8DF3FE][" + name + "]:[-]";
            content = "[8DF3FE]" + content + "[-]";
            break;

        case 3:
            name    = "[FEFF93][" + name + "]:[-]";
            content = "[FEFF93]" + content + "[-]";
            break;

        case 4:
            name    = "[FF0000][" + name + "]:[-]";
            content = "[FF0000]" + content + "[-]";
            break;
        }

        AddChatItem(name, content, 0);
        if (type != 0)
        {
            AddChatItem(name, content, type);
        }

        if (!IsOpen())
        {
            mOpBtnCol.Play(true);
        }
    }
Exemple #12
0
    private void SetAllInfo(RectTransform rt, PBulletin Info)
    {
        if (Info == null)
        {
            return;
        }
        TweenColor txtmain  = rt.transform.Find("txt/TXT").GetComponent <TweenColor>();
        var        txtother = rt.transform.Find("txt/TXT2");
        Text       Title1   = txtmain?.GetComponent <Text>();
        Text       Title2   = txtother?.GetComponent <Text>();

        if (Title1 != null)
        {
            Util.SetText(Title1, Info.title);
        }
        if (Title2 != null && txtother != null)
        {
            txtother.gameObject.SetActive(!string.IsNullOrEmpty(Info.subTitle));
            Util.SetText(Title2, Info.subTitle);
        }

        GameObject SelectOn = rt.transform.Find("selectbox")?.gameObject;
        Image      NewImg   = rt.transform.Find("new_img")?.GetComponent <Image>();
        bool       isshow   = moduleAnnouncement.NotClick.Exists(a => a == Info.id);

        NewImg.SafeSetActive(isshow);
        var select = Info.id == moduleAnnouncement.PInfo?.id;

        SelectOn?.gameObject.SetActive(select);

        if (select)
        {
            txtmain.Play();
        }
        else
        {
            txtmain.PlayReverse();
        }
    }
Exemple #13
0
    /// <summary>
    /// 侠客死亡
    /// </summary>
    public void OnPlayDie()
    {
        _isControlPause = true;
        mBatManage.RemoveDieHero(this);
        PlayAnimation("death");
        mHeroBlood.ShowBlood();
        SkinnedMeshRenderer render = transform.GetComponentInChildren <SkinnedMeshRenderer>();

        if (render == null)
        {
            return;
        }
        AnimationState state = mAnima["death"];
        TweenColor     tcol  = TweenColor.Begin(render.gameObject, state.clip.length + 0.1f, new Color(120 / 255f, 120 / 255f, 120 / 255f, 0));

        tcol.method = UITweener.Method.EaseIn;
        tcol.style  = UITweener.Style.Once;
        tcol.AddOnFinished(delegate()
        {
            GameObject.DestroyObject(gameObject);
        });
        tcol.Play();
    }
    public static TweenColor ColorTo(bool reset, GameObject go, UITweener.Method method, UITweener.Style style,
                                     float duration, float delay, Color colorTo)
    {
        if (go == null)
        {
            return(null);
        }

        if (reset)
        {
            //go.RemoveComponent<TweenColor>();
        }

        TweenColor comp = UITweenerUtil.Begin <TweenColor>(go, method, style, duration, delay);

        if (reset)
        {
            comp = ResetTween(comp);
        }
        comp.from     = comp.color;
        comp.to       = colorTo;
        comp.duration = duration;
        comp.delay    = delay;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        if (!reset)
        {
            comp = ResetTween(comp);
        }
        comp.Play(true);
        return(comp);
    }
Exemple #15
0
    protected void FadeOut_()
    {
        if (avController != null)
        {
            Destroy(avController.gameObject);
            avController = null;
            Resources.UnloadUnusedAssets();
        }

        TweenColor colorTweener = fadeTexture.GetComponentInChildren <TweenColor>();

        if (colorTweener == null)
        {
            colorTweener = fadeTexture.gameObject.AddComponent <TweenColor>();
        }

        colorTweener.from = new Color(0f, 0f, 0f, 0f);
        colorTweener.to   = fadeColor;

        colorTweener.duration = appearFadeDuration;
        colorTweener.Play(false);

        currentShowAlertParams = null;
    }
Exemple #16
0
 public void ActiveTriggerIndicator(Vector3 pos)
 {
     _pathTarget          = pos;
     _pathIndicatorEnable = true;
     _pathIndicatorEffect.Play(true);
 }