Exemplo n.º 1
0
    private void Init(string tip)
    {
        imageObj = MonoBehaviour.Instantiate(Resources.Load("Tips/TipsImage")) as GameObject;
        imageObj.GetComponent <RectTransform>().SetParent(tipParent);
        imageObj.transform.localPosition = new Vector3(0, -100, 0);

        image         = imageObj.GetComponent <Image>();
        imageforblack = image.transform.Find("for more black").GetComponent <Image>();
        text          = imageforblack.transform.Find("my lable").GetComponent <Text>();

        text.text = tip;

        HOTween.Init();
        TweenParms parms = new TweenParms();

        parms.Prop("localPosition", new PlugVector3Y(50));
        parms.Ease(EaseType.EaseOutCubic);
        parms.Delay(0.1f);
        parms.OnComplete(MyComplete);
        HOTween.To(image.rectTransform, 1.5f, parms);

        #region Legacy DoTween
        //DOTween.Init();

        //Tweener tweener = image.rectTransform.DOMoveY(250f, 1f);
        //tweener.SetEase(Ease.Linear);

        //image.material.DOColor(Color.clear,1.5f);
        //text.material.DOColor(Color.clear, 1.5f);

        //tweener.OnComplete(MyComplete);
        #endregion
    }
Exemplo n.º 2
0
    private void Show()
    {
        GoodsItemVO vo = currSelectedVO;

        //todo:根据数据初始化整个详情
        SetName(vo.name);
        SetOwn(vo.own);
        SetDetails(vo.description, vo.extraDescription);
        SetCost(vo.totalcost, vo.cout, vo.goodsCostType);
        Convert();

        if (temp == null)
        {
            this.mTrans.localScale = new Vector3(0.1f, 0.1f, 0.1f);
            HOTween.Init();
            parms = new TweenParms();
            parms.Prop("localScale", new Vector3(1f, 1f, 1f));
            parms.Ease(EaseType.EaseOutBack);
            parms.Delay(0.1f);
            parms.AutoKill(false);
            temp       = HOTween.To(this.mTrans, 0.2f, parms);
            temp.intId = 1;
        }
        temp.PlayForward();
    }
    public void returnHome()
    {
        ParentHand = null;
        TweenParms parms = new TweenParms();

        parms.Prop("position", m_homeWorldPosition);
        parms.Prop("rotation", m_homeWorldRotation);
        parms.Ease(EaseType.EaseInOutExpo);
        parms.Delay(0.25f);
        parms.OnComplete(returnHomeCompleted);
        HOTween.To(transform, 0.5f, parms);
    }
Exemplo n.º 4
0
        private void ScaleRoot(bool isOut)
        {
            var param = new TweenParms();

            if (!isOut)
            {
                param.Delay(UnityEngine.Random.Range(_scaleDelayRange.x, _scaleDelayRange.y));
            }
            param.Prop("localScale", isOut ? Vector3.zero : Vector3.one);
            param.Ease(EaseType.Linear);
            param.OnComplete(() => transform.localPosition = _initialPosition);

            HOTween.To(transform, SCALE_DURATION, param);
        }
Exemplo n.º 5
0
        public void reset()
        {
            TweenParms parms = new TweenParms();

            //移动
            parms.Prop("localPosition", oriPosition);
            parms.Prop("localRotation", oriRotation);
            parms.Prop("localScale", oriScale);
            //运动的类型
            parms.Ease(EaseType.EaseInOutCirc);
            //延迟一秒
            parms.Delay(0.1f);
            //执行动画
            HOTween.To(this.transform, 0.5f, parms);
        }
Exemplo n.º 6
0
    public void Move()
    {
        TweenParms parms = new TweenParms();

        //移动
        parms.Prop("localPosition", MovedPos);
        parms.Prop("localRotation", new Vector3(0, 0, 0));
        parms.Prop("localScale", new Vector3(1, 1, 1));
        //运动的类型
        parms.Ease(EaseType.EaseInOutCirc);
        //延迟一秒
        parms.Delay(0.1f);
        //执行动画
        HOTween.To(this.transform, 0.5f, parms);
    }
Exemplo n.º 7
0
    private void SetRefreshChoiceOpen()
    {
        refreshT.gameObject.SetActive(true);

        if (parms == null)
        {
            refreshT.localScale = new Vector3(0.1f, 0.1f, 0.1f);
            parms = new TweenParms();
            parms.Prop("localScale", new Vector3(1f, 1f, 1f));
            parms.Ease(EaseType.EaseOutBack);
            parms.Delay(0.1f);
            parms.AutoKill(false);
            temp = HOTween.To(refreshT, 0.2f, parms);
        }
        temp.PlayForward();
    }
Exemplo n.º 8
0
        public void reset()
        {
            TweenParms parms = new TweenParms();

            //移动
            parms.Prop("localPosition", new Vector3(0, 0, 0));
            parms.Prop("localRotation", new Vector3(0, 0, 0));
            parms.Prop("localScale", new Vector3(1, 1, 1));
            //运动的类型
            parms.Ease(EaseType.EaseInOutCirc);
            //延迟一秒
            parms.Delay(0.1f);
            //执行动画
            HOTween.To(this.transform, 0.5f, parms);
            GetComponent <AudioSource>().clip = resetAudioClip;
            GetComponent <AudioSource>().Play();
        }
Exemplo n.º 9
0
        public IEnumerator ShowChars(Action onComplete)
        {
            for (var i = 0; i < BoardList.Count; i++)
            {
                var param = new TweenParms();
                param.Prop("scale", _initCharScaleList[i]);
                param.Delay(SHOW_ITEM_DELAY * BoardList[i].Index);

                HOTween.To(BoardList[i].CharSprite, SHOW_ITEM_DURATION, param);
            }

            yield return(new WaitForSeconds(BoardList.FindMax(x => x.Index) * SHOW_ITEM_DELAY));

            if (onComplete != null)
            {
                onComplete();
            }
        }
Exemplo n.º 10
0
    public void fadeOutAlphaAndDistroy(float delay = 0.3f, float time = 0.3f, bool addToKillList = true)
    {
        //Debug.Log ("alpha:"+alpha.ToString());
        ///////////////////////////////////////////////////////////
        TweenParms parms = new TweenParms();

        parms.Ease(EaseType.Linear);         // Easing type
        parms.Prop("alpha", 0.0f);
        parms.Delay(delay);
        parms.OnComplete(fadeAlphaComplete, 0);
        if (addToKillList)
        {
            Game.tweensToKillArr.Add(HOTween.To(this, time, parms));
        }
        else
        {
            HOTween.To(this, time, parms);
        }

        ///////////////////////////////////////////////////////////
    }
Exemplo n.º 11
0
    public Poker close(Del func, float delay = 0)
    {
        scaleType = "close";

        if (!isOpen)
        {
            return(this);
        }
        funcAfterClose = func;
        // C#
        TweenParms parms = new TweenParms();

        //parms.Prop("localPosition", new Vector3((float)j*(card_wid+gap)+card_wid/2.0f+start_x,hei_750-start_y-card_hei/2.0f-((float)i)*back_next_dis,0)); // Position tween
        parms.Ease(EaseType.Linear); // Easing type
        parms.Delay(delay);          // Initial delay
        //parms.OnStart(onStart,card);
        parms.Prop("localScale", new Vector3(0f, 1f * Game.card_scale, 1f * Game.card_scale));
        parms.OnComplete(scale0Complete, this.gameObject.name);
        HOTween.To(this.gameObject.transform, 0.1f, parms);

        return(this);
    }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        //Tween Parameters
        initSclHeader = new Vector3(0.0f, 1.0f, 1.0f);
        initSclBody   = new Vector3(1.0f, 0.0f, 1.0f);
        initPosHeader = new Vector3(10.0f, 0.0f, 0.0f);
        initPosBody   = new Vector3(-5.0f, 5.0f, 0.0f);

        //Expand
        paramHeader.Prop("localScale", panelHeader.transform.localScale);
        paramHeader.Prop("position", panelHeader.transform.position);
        paramHeader.Ease(EaseType.EaseOutQuad);
        paramHeader.Delay(0.5f);

        paramBody.Prop("localScale", panelBody.transform.localScale);
        paramBody.Prop("position", panelBody.transform.position);
        paramBody.Ease(EaseType.EaseOutQuad);
        paramBody.Delay(0.8f);

        //Shrink
        paramBodyR.Prop("localScale", initSclBody);
        paramBodyR.Prop("position", initPosBody);
        paramBodyR.Ease(EaseType.EaseOutQuad);
        paramBodyR.Delay(0.5f);

        paramHeaderR.Prop("localScale", initSclHeader);
        paramHeaderR.Prop("postision", initPosHeader);
        paramHeaderR.Ease(EaseType.EaseOutQuad);
        paramHeaderR.Delay(0.8f);


        //Panel Initial State
        panelHeader.transform.localScale = initSclHeader;
        panelBody.transform.localScale   = initSclBody;
        panelHeader.transform.position   = initPosHeader;
        panelBody.transform.position     = initPosBody;
    }
Exemplo n.º 13
0
    private void Show()
    {
        //todo:根据数据初始化整个详情
        if (currSelectedVO != null)
        {
            TitleText.text  = currSelectedVO.title;
            DetailText.text = currSelectedVO.content;
        }
        //Convert();

        if (temp == null)
        {
            this.mTrans.localScale = new Vector3(0.1f, 0.1f, 0.1f);
            HOTween.Init();
            parms = new TweenParms();
            parms.Prop("localScale", new Vector3(1f, 1f, 1f));
            parms.Ease(EaseType.EaseOutBack);
            parms.Delay(0.1f);
            parms.AutoKill(false);
            temp       = HOTween.To(this.mTrans, 0.2f, parms);
            temp.intId = 1;
        }
        temp.PlayForward();
    }
Exemplo n.º 14
0
    void Start()
    {
        stairPieces     = new List <GameObject>();
        stairPieceTween = new List <Tweener>();

        TweenParms parms = new TweenParms();

        parms.Ease(EaseType.EaseInOutExpo);
        parms.Loops(-1, LoopType.Yoyo);

        int i = 0;

        foreach (Transform child in transform.Cast <Transform>().OrderBy(t => t.position.y).Reverse())
        {
            GameObject gameObject = child.gameObject;
            stairPieces.Add(gameObject);

            parms.Prop("localPosition", gameObject.transform.localPosition + new Vector3(-5, 0, 0));
            parms.Delay(i * 0.2f);
            Tweener tweener = HOTween.To(gameObject.transform, 1, parms);
            stairPieceTween.Add(tweener);
            i++;
        }
    }
Exemplo n.º 15
0
    public bool tryRemoveCompletedCards()
    {
        bool hasComp   = false;
        bool isLinked  = true;
        int  memoryNum = 1;

        if (pokerArr.Count >= 13)
        {
            Poker first = getLastPoker().GetComponent <Poker> ();
            if (first.num == 1)
            {
                string startType = first._type;
                for (int i = pokerArr.Count - 2; i >= 0; i--)
                {
                    GameObject go = pokerArr [i] as GameObject;
                    Poker      p  = go.GetComponent <Poker>();
                    if (p.num == memoryNum + 1 && p._type.Equals(startType))
                    {
                        if (memoryNum == 12)
                        {
                            break;
                        }
                        memoryNum++;
                    }
                    else
                    {
                        isLinked = false;
                        break;
                    }
                }

                if (isLinked)
                {
                    hasComp = true;
                    int d_time = 0;
                    Game.isRemoving = true;
                    for (int i = pokerArr.Count - 1; i > pokerArr.Count - 14; i--)
                    {
                        d_time++;
                        GameObject go = pokerArr [i] as GameObject;
                        // C#
                        TweenParms parms = new TweenParms();

                        Vector3 pos;                        // = new Vector3(Game.baseX+Game.game_wid - Game.card_wid/2.0f-Game.start_x,Game.baseY-Game.card_hei/2.0f-Game.start_y+Game.hei_750-Game.back_next_dis_normal/2.0f*Game.completedCount*Game.card_scale,go.transform.position.z);

                        pos = new Vector3(Game.complete_glow.transform.position.x, Game.complete_glow.transform.position.y - Game.back_next_dis_normal / 2.0f * Game.completedCount * Game.card_scale, Game.complete_glow.transform.position.z);
                        parms.Prop("position", pos);                        // Position tween
                        parms.Ease(EaseType.Linear);                        // Easing type
                        parms.Delay(((float)d_time) * 0.05f);               // Initial delay

                        if (i == pokerArr.Count - 13)
                        {
                            parms.OnComplete(comp, 1, go);
                        }
                        else
                        {
                            parms.OnComplete(comp, 0, go);
                        }

                        HOTween.To(go.transform, 0.15f, parms);
                    }

                    int removeNum = 13;

                    while (removeNum != 0)
                    {
                        removeNum--;

                        pokerArr.RemoveAt(pokerArr.Count - 1);
                    }

                    Game.completedCount++;
                }
            }
        }

        return(hasComp);
    }