scaleY() public static method

public static scaleY ( GameObject gameObject, float to, float time ) : LTDescr,
gameObject GameObject
to float
time float
return LTDescr,
Ejemplo n.º 1
0
 public void FinishEffectStart(float delay = 0.3f)
 {
     LeanTween.moveLocalY(gameObject, 0.1f, 0.2f).setDelay(delay).setOnComplete(
         m =>
     {
         LeanTween.scaleY(gameObject, 0.7f, 0.2f).setOnComplete(
             p =>
         {
             gameObject.LeanScaleY(1, 0.2f).setOnComplete(f => { FinishCallback(delay); });
             confitteExplosion.Play();
         });
     });
 }
Ejemplo n.º 2
0
    IEnumerator run()
    {
        LeanTween.scaleY(gameObject, 0.8f, 0.25f);
        yield return(new WaitForSeconds(0.25f));

        LeanTween.scaleY(gameObject, 1f, 0.125f);
        yield return(new WaitForSeconds(0.125f));

        LeanTween.scaleY(gameObject, 0.9f, 0.125f);
        yield return(new WaitForSeconds(0.125f));

        LeanTween.scaleY(gameObject, 1f, 0.125f);
    }
Ejemplo n.º 3
0
    IEnumerator runObject(GameObject ob)
    {
        LeanTween.scaleY(ob, 0.8f, 0.25f);
        yield return(new WaitForSeconds(0.25f));

        LeanTween.scaleY(ob, 1f, 0.125f);
        yield return(new WaitForSeconds(0.125f));

        LeanTween.scaleY(ob, 0.9f, 0.125f);
        yield return(new WaitForSeconds(0.125f));

        LeanTween.scaleY(ob, 1f, 0.125f);
    }
Ejemplo n.º 4
0
    void Start()
    {
        descr        = LeanTween.move(go, new Vector3(0f, 0, 100f), 10f);
        descr.passed = 5f;     // this should put it at the midway
        descr.updateNow();
        descr.pause();         // doesn't matter if pause after or before setting descr.passed I think if I set the passed property and paused the next frame it would work

//		LeanTween.scale(go2, Vector3.one * 4f, 10f).setEasePunch();

        LeanTween.scaleX(go2, (go2.transform.localScale * 1.5f).x, 15f).setEase(LeanTweenType.punch);
        LeanTween.scaleY(go2, (go2.transform.localScale * 1.5f).y, 15f).setEase(LeanTweenType.punch);
        LeanTween.scaleZ(go2, (go2.transform.localScale * 1.5f).z, 15f).setEase(LeanTweenType.punch);
    }
Ejemplo n.º 5
0
    public void HideHelp()
    {
        if (!isOpen)
        {
            return;
        }

        LeanTween.scaleY(helpWindow, 0.0f, 0.25f)
        .setEaseOutCirc()
        .setIgnoreTimeScale(true)
        .setOnComplete(() => helpWindow.SetActive(false));
        isOpen = false;
    }
Ejemplo n.º 6
0
        public void OnMenuClick()
        {
            switch (GameManager.Main.gameState)
            {
            case GameState.InGame:
                menuScreen.SetActive(true);
                LeanTween.scaleY(menuScreen, 1, 0.3f).setOnComplete(Pause);
                break;

            case GameState.InMenu:
                OnResumeClick();
                break;
            }
        }
Ejemplo n.º 7
0
    protected virtual void Animate()
    {
        float xScale   = 0.25f;
        float yScale   = 0.25f;
        float animTime = Random.Range(0.7f, 1.3f);

        LeanTween.scaleX(gameObject, xScale, animTime);
        LeanTween.scaleY(gameObject, 0.3f, animTime).setOnComplete(
            () =>
        {
            LeanTween.scaleX(gameObject, 0.3f, animTime);
            LeanTween.scaleY(gameObject, yScale, animTime).setOnComplete(Animate);
        }
            );
    }
Ejemplo n.º 8
0
    public void ToggleHelp()
    {
        if (isOpen)
        {
            HideHelp();
            return;
        }

        helpWindow.SetActive(true);
        helpWindow.transform.localScale = new Vector3(1, 0, 1);
        LeanTween.scaleY(helpWindow, 1.0f, 0.25f)
        .setEaseOutCirc()
        .setIgnoreTimeScale(true);
        isOpen = true;
    }
    public void OnBackClick()
    {
        GameObject.Find("Zoom background").GetComponent <Image>().raycastTarget = false;
        RectTransform zoomBg = GameObject.Find("Zoom background").GetComponent <RectTransform>();

        LeanTween.alpha(zoomBg, 0f, 0.2f);
        GameObject.Find("Back from zoom").GetComponent <Image>().raycastTarget = false;
        RectTransform backFromZoomButton = GameObject.Find("Back from zoom").GetComponent <RectTransform>();

        LeanTween.alpha(backFromZoomButton, 0f, 0.2f);
        LeanTween.move(theZoomedImage, prevPos, 0.2f);
        LeanTween.scaleX(theZoomedImage, 1f, 0.2f);
        LeanTween.scaleY(theZoomedImage, 1f, 0.2f);
        Destroy(theZoomedImage, 0.2f);
        zoomed = false;
    }
Ejemplo n.º 10
0
    void createElement()
    {
        GameObject clone = Instantiate(element, element.transform.parent);

        clone.transform.position = new Vector3(startpos, height);
        clone.AddComponent <element1move>().setspeed(speed);

        clone.transform.localScale = new Vector3(1.5f, 1.5f);
        LeanTween.scale(clone, new Vector3(1, 1, 1), 0.25f).setOnComplete(() =>
        {
            LeanTween.scaleY(clone, 0.9f, 0.25f).setLoopPingPong();
        });

        createcount += 1;
        currentelements.Add(clone);
        playeraudiosource.PlayOneShot(sfx_create);
    }
Ejemplo n.º 11
0
    private void MoveOnInteract()
    {
        if (currentInteractable.isInteractable)
        {
            string txt = currentInteractable.GetPrimaryInteractText();

            if (txt == null)
            {
                return;
            }

            interactText.SetText(txt);
            LeanTween.scaleY(interactText.gameObject, 1, 0.1f);
            LeanTween.scale(outerCursor, Vector3.one * 1.5f, 0.1f);
            LeanTween.scale(toolTipBack, Vector3.one, 0.1f);
        }
    }
Ejemplo n.º 12
0
        public virtual void AnimateTowerDrop()
        {
            var healthBarScaleX = healthBar.transform.localScale.x;
            var healthBarScaleY = healthBar.transform.localScale.y;

            healthBar.transform.localScale = Vector3.zero;

            var initPos      = initLocalSpritePos;
            var dropPosition = initPos + new Vector3(0, 25, 0);

            sr.transform.localPosition = dropPosition;

            var seq = LeanTween.sequence();

            seq.append(() =>
            {
                LeanTween.moveLocal(sr.gameObject, initPos, 0.3f);
                LeanTween.scale(sr.gameObject, initSpriteScale + new Vector3(0, 0.5f, 0), 0.3f);
            });

            seq.append(0.31f);
            var scale = initSpriteScale;

            scale.x *= 2f;
            scale.y *= 0.5f;
            if (socket != null)
            {
                seq.append(socket.Jiggle);
            }

            seq.append(LeanTween.scale(sr.gameObject, scale, 0.1f));
            seq.append(() =>
            {
                bool isFirstLevelAndIsPlayerBase = LevelInfo.current.IsFirstLevel() && IsPlayerBase();

                if (!isFirstLevelAndIsPlayerBase)
                {
                    Util.objectShake.Shake(GameManager.Instance.cam.gameObject, 0.4f, 0.1f);
                }
            });
            seq.append(LeanTween.scale(sr.gameObject, initSpriteScale, 0.25f).setEaseOutExpo());
            seq.append(() => { LeanTween.scaleX(healthBar.gameObject, healthBarScaleX, 0.4f).setEaseOutElastic(); });
            seq.append(() => { LeanTween.scaleY(healthBar.gameObject, healthBarScaleY, 0.7f).setEaseOutElastic(); });
        }
Ejemplo n.º 13
0
    private void LoopBcg()
    {
        Vector3 transs = bcgs[1].transform.position;

        if (!flipYaxis && !flipXaxis)
        {
            LeanTween.move(bcgs[0], transs, moveBcgDuration).setLoopClamp();
        }
        if (flipYaxis)
        {
            LeanTween.move(bcgs[0], transs, moveBcgDuration).setLoopClamp();
            LeanTween.scaleY(bcgs[0], -1f, flipYaxisDuration).setLoopPingPong();
        }
        if (flipXaxis)
        {
            LeanTween.move(bcgs[0], transs, moveBcgDuration).setLoopClamp();
            LeanTween.scaleX(bcgs[0], -1f, flipXaxisDuration).setLoopPingPong();
        }
    }
Ejemplo n.º 14
0
        private IEnumerator RefreshCoroutine()
        {
            rootPanel.SetActive(true);
            rootPanel.transform.localScale = Vector3.one;

            tipTransform.gameObject.SetActive(false);

            bgTransform.localScale = new Vector3(1, bgStartScaleY, 1);
            LeanTween.scaleY(bgTransform.gameObject, 1, bgScaleTime);
            yield return(new WaitForSeconds(0.066f));

            tipTransform.gameObject.SetActive(true);
            leftArrow.localPosition  = _leftArrowOriginPos;
            rightArrow.localPosition = _rightArrowOriginPos;
            tipTransform.localScale  = new Vector3(tipStartScaleX, 1, 1);
            LeanTween.scaleX(tipTransform.gameObject, 1, tipScaleTime).onComplete = tipScaleComplete;
            yield return(new WaitForSeconds(duringTime));

            LeanTween.scaleY(rootPanel, 0, disappearTime).onComplete = disappearComplete;
        }
Ejemplo n.º 15
0
        public void ShowChildren()
        {
            float time = .2f;

            // Hover button
            LeanTween.cancel(button);
            LeanTween.moveLocalZ(button, 2, time).setEaseInOutCirc();
            // Show children
            LeanTween.cancel(children.gameObject);
            children.transform.localScale = Vector3.one * .75f;
            children.alpha = 1;
            //LeanTween.value(children.gameObject, OnChildAlphaUpdate, children.alpha, 1, time);
            LeanTween.scaleX(children.gameObject, 1, time).setEaseInOutCirc();
            LeanTween.scaleZ(children.gameObject, 1, time).setEaseInOutCirc();
            LeanTween.scaleY(children.gameObject, 1, time).setEaseInOutCirc().setDelay(time * .25f);
            children.gameObject.SetActive(true);

            hoverArea.gameObject.SetActive(true);
            // hoverArea.localScale = Vector3.one * scaleOnHover;
        }
Ejemplo n.º 16
0
    public IEnumerator WaveCard()
    {
        waveCard.SetActive(true);
        waveCard.GetComponent <RectTransform>().anchoredPosition = new Vector3(190, 330, 0);
        waveCard.transform.GetChild(0).GetComponent <Animator>().Play("wavecardopen");
        LeanTween.moveY(waveCard.GetComponent <RectTransform>(), 270, 0.8f);
        yield return(new WaitForSeconds(0.5f));

        LeanTween.scaleY(waveCard.transform.GetChild(1).gameObject, 1, 0.6f);


        yield return(new WaitForSeconds(2));

        waveCard.transform.GetChild(0).GetComponent <Animator>().Play("wavecardclose");
        LeanTween.moveY(waveCard.GetComponent <RectTransform>(), 330, 0.8f);
        LeanTween.scaleY(waveCard.transform.GetChild(1).gameObject, 0, 0.2f);
        yield return(new WaitForSeconds(1));

        waveCard.SetActive(false);
    }
Ejemplo n.º 17
0
        public void Display(Image image)
        {
            image.gameObject.SetActive(true);
            var targetPos = image.transform.localPosition;

            image.transform.localPosition = targetPos + Vector3.down * 200;
            LeanTween.moveLocalY(image.gameObject, targetPos.y, 0.5f)
            .setEaseOutCubic()
            .setIgnoreTimeScale(true);

            LeanTween.scaleY(image.gameObject, 1.1f, 0.25f)
            .setLoopPingPong(1)
            .setIgnoreTimeScale(true)
            .setOnComplete(() =>
            {
                LeanTween.scaleY(image.gameObject, 1.02f, 2.0f)
                .setIgnoreTimeScale(true)
                .setLoopPingPong(-1);
            });
        }
Ejemplo n.º 18
0
    private IEnumerator runContent()
    {
        if (contentList.Count > 0)
        {
            //con content de chay
            if (isRunning == false)
            {
                //chay lan dau tien => hien thanh mau hien
                isRunning = true;
                LeanTween.cancel(contentRect.gameObject);
                LeanTween.scaleY(contentRect.gameObject, 1, TIME_TWEEN_CONTENT).setEaseOutBack();
            }
            if (LeanTween.isTweening(txtRect.gameObject) == false)
            {
                string contentCur = contentList[0];
                contentList.RemoveAt(0);
                txtNotification.text = contentCur;
                yield return(null);

                float widthContent = txtNotification.preferredWidth;

                Vector2 pos       = Vector2.zero;
                float   timeTween = (widthContent / 200.0f) + TIME_TWEEN;
                pos.x = contentRect.sizeDelta.x / 2 + widthContent / 2;
                float targetX = -contentRect.sizeDelta.x / 2 - widthContent / 2 - 500;
                txtRect.anchoredPosition = pos;
                LeanTween.moveLocalX(txtNotification.gameObject, targetX, timeTween).setEaseLinear().setOnComplete(() =>
                {
                    StartCoroutine(runContent());
                });
            }
        }
        else
        {
            //get content de chay
            LeanTween.scaleY(contentRect.gameObject, 0, TIME_TWEEN_CONTENT).setEaseLinear().setOnComplete(() =>
            {
                isRunning = false;
            });
        }
    }
Ejemplo n.º 19
0
    public void DestroyAnimation()
    {
        OnMovementStarted.Raise(); //raise event, input handler should not allow mouse interaction

        //rotating and scaling down block for a cool destroy animation
        for (int i = BlocksToDestroy.Items.Count - 1; i >= 0; i--)
        {
            LeanTween.rotateAround(BlocksToDestroy.Items[i].gameObject, Vector3.forward, DestroyRotateValue.Value, DestroyBlockTimeSec.Value).setEase(LeanTweenType.easeInQuad);
            LeanTween.scaleX(BlocksToDestroy.Items[i].gameObject, DestroyScaleValue.Value, DestroyBlockTimeSec.Value).setEase(LeanTweenType.easeInQuad);

            //if it is the last iteration, send the end signal after movement
            if (i == 0)
            {
                LeanTween.scaleY(BlocksToDestroy.Items[i].gameObject, DestroyScaleValue.Value, DestroyBlockTimeSec.Value).setEase(LeanTweenType.easeInQuad).setOnComplete(DestroyBlocks);
            }
            else
            {
                LeanTween.scaleY(BlocksToDestroy.Items[i].gameObject, DestroyScaleValue.Value, DestroyBlockTimeSec.Value).setEase(LeanTweenType.easeInQuad);
            }
        }
    }
Ejemplo n.º 20
0
 public void ClearSelection(string select, System.Action callback)
 {
     foreach (Transform t in transform)
     {
         if (t.name.CompareTo(select) == 0)
         {
             LeanTween.scaleY(t.gameObject, 0, 0.4f).setEase(LeanTweenType.easeInBack).setOnComplete(() =>
             {
                 foreach (Transform tt in transform)
                 {
                     Destroy(tt.gameObject);
                 }
                 callback();
             });
         }
         else
         {
             LeanTween.scaleY(t.gameObject, 0, 0.25f);
         }
     }
 }
Ejemplo n.º 21
0
    void SetVisibility(bool show)
    {
        isVisible = show;

        var targetPosition = onShowPosition;
        var targetScaleY   = 1f;
        var targetEase     = LeanTweenType.easeOutBounce;

        if (!show)
        {
            reticle.SetBodyScale(0f);

            targetPosition = onHidePosition;
            targetScaleY   = 0f;
            targetEase     = LeanTweenType.easeInSine;

            if (King.placeManager.currentPlace != null && King.placeManager.currentPlace.placeState == Place.PlaceState.Playable)
            {
                King.visitor.sight.enabled = true;
            }

            buttonInFocus = null;

            soundPlayer.PlayOneShot(1);
        }
        else
        {
            body.SetActive(true);

            soundPlayer.PlayOneShot(0);
        }

        LeanTween.cancel(body);

        LeanTween.move(body, targetPosition, 1f).setOnComplete(delegate() {
            body.SetActive(show);
        }).setEase(targetEase);

        LeanTween.scaleY(body, targetScaleY, 1f).setEase(targetEase);
    }
Ejemplo n.º 22
0
    //显示路点提示
    void ShowPathPoint(int point)
    {
        pathPoint.gameObject.SetActive(true);

        string        actionRoot = "Canvas/Scroll View/Viewport/Content/map/action" + point + "/" + point;
        RectTransform root       = GameObject.Find(actionRoot).GetComponent <RectTransform>();

        pathPoint.position = new Vector3(root.position.x, root.position.y + 20, root.position.z);

        //LeanTween.cancel(pathPoint.gameObject);

        pathPoint.localScale = new Vector3(0, 0, 0);

        float at = 0.3f;

        LeanTween.scale(pathPoint.gameObject, new Vector3(1, 1, 1), 0.25f).setOnComplete(() =>
        {
            LeanTween.scaleX(pathPoint.gameObject, 1.2f, at).setEase(LeanTweenType.easeInOutSine).setLoopPingPong();
            LeanTween.scaleY(pathPoint.gameObject, 0.8f, at).setEase(LeanTweenType.easeInOutSine).setLoopPingPong();
        });
        LeanTween.moveY(pathPoint, pathPoint.localPosition.y + 20, at).setLoopPingPong();
    }
Ejemplo n.º 23
0
    void Start()
    {
        //print(GameObject.Find("Phase Handler").GetComponent<PhaseHandler>().music.time);
        //Create and animate the meteor shadow
        meteorShadow      = new GameObject();
        meteorShadow.name = "Meteor Shadow";
        meteorShadow.tag  = "Junk";
        meteorShadow.transform.position   = new Vector2(hitPosX, -0.67f);
        meteorShadow.transform.localScale = new Vector2(0.2f, 0.2f);
        meteorShadow.AddComponent <SpriteRenderer>().sprite = meteorShadowSprite;
        meteorShadow.GetComponent <SpriteRenderer>().color  = new Color(1f, 1f, 1f, 0f);
        LeanTween.scale(meteorShadow, new Vector2(1.25f, 1.25f), fallTimerLength + 0.1f).setEase(LeanTweenType.easeOutCubic);
        LeanTween.alpha(meteorShadow, 1f, fallTimerLength + 0.1f).setEase(LeanTweenType.easeOutCubic);

        //Create and animate the meteor heat
        meteorHeat      = new GameObject();
        meteorHeat.name = "Meteor Heat";
        meteorHeat.tag  = "Junk";
        meteorHeat.transform.position   = meteorShadow.transform.position;
        meteorHeat.transform.localScale = new Vector2(1f, 0.25f);
        meteorHeat.AddComponent <SpriteRenderer>().sprite = meteorHeatSprite;
        meteorHeat.GetComponent <SpriteRenderer>().color  = new Color(1f, 1f, 1f, 0f);
        LeanTween.scaleY(meteorHeat, 2f, fallTimerLength + 0.1f).setEase(LeanTweenType.easeInOutCubic);
        LeanTween.alpha(meteorHeat, 0.5f, fallTimerLength + 0.1f).setEase(LeanTweenType.easeInOutCubic);

        //Wait a set amount of time before creating the actual meteor
        LeanTween.delayedCall(gameObject, fallTimerLength, () =>
        {
            gameObject.GetComponent <SpriteRenderer>().enabled = true;
            Vector3 dir        = new Vector3(hitPosX, -0.67f) - transform.position;     //Get the direction to the object we're pointing at
            float angle        = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;             //Convert that direction into an angle
            transform.rotation = Quaternion.AngleAxis(angle + 90f, Vector3.forward);    //Rotate on the Vector3.forward (z) axis

            LeanTween.move(gameObject, new Vector2(transform.position.x - (transform.position.x - hitPosX), -0.85f), 0.1f).setOnComplete(meteorImpact);
        });

        anim = GetComponent <Animator>();
    }
Ejemplo n.º 24
0
    void CreateNewBlock(int posZ)
    {
        if (!isFakeRoute)
        {
            if (prebSameColor >= maxSameColor || Random.value < GameManager.Instance.fakeRouteRatio)
            {
                if (Random.value < GameManager.Instance.holeRatio)
                {
                    stageBlock[posZ % maxStageBlock].status = BlockStatus.Hole;
                }
                else
                {
                    stageBlock[posZ % maxStageBlock].status = (Random.value < 0.50f) ? BlockStatus.White : BlockStatus.Black;
                }

                isFakeRoute   = true;
                prebSameColor = 0;
            }
            else
            {
                stageBlock[posZ % maxStageBlock].status = stageBlock[(posZ - 1) % maxStageBlock].status;
                prebSameColor++;
            }
        }
        else
        {
            stageBlock[posZ % maxStageBlock].status = (stageBlock[(posZ - 2) % maxStageBlock].status == BlockStatus.White) ? BlockStatus.Black : BlockStatus.White;

            isFakeRoute = false;
        }

        ApplyBlockStatus(stageBlock[posZ % maxStageBlock]);

        LeanTween.scaleY(stageBlock[posZ % maxStageBlock].gameObject, blockHeight, blockPopTime);
        LeanTween.moveY(stageBlock[posZ % maxStageBlock].gameObject, -blockHeight / 2, blockPopTime);
        LeanTween.moveZ(stageBlock[posZ % maxStageBlock].gameObject, posZ, 0.0f);
        LeanTween.alpha(stageBlock[posZ % maxStageBlock].gameObject, 1.0f, blockPopTime).setEase(LeanTweenType.easeOutCubic);
    }
Ejemplo n.º 25
0
 void DeleteImageCallback(int res, System.Object refobj)
 {
     if (res == 1)
     {
         MediaController.Singleton.DeleteImage(swipe.CurrentPage);
         tempImage.sprite = Instantiate(GetCurrentImage());
         tempImage.transform.localScale = Vector3.one;
         tempImage.gameObject.SetActive(true);
         LeanTween.scaleY(tempImage.gameObject, 0, 0.5f).setOnComplete(FileDeleteCompleted);
         swipe.PageCount = MediaController.Singleton.Images.Count;
         if (swipe.PageCount > 0)
         {
             if (swipe.CurrentPage == swipe.PageCount)
             {
                 GotoPage(swipe.CurrentPage - 1);
             }
             else
             {
                 GotoPage(swipe.CurrentPage);
             }
         }
     }
 }
Ejemplo n.º 26
0
    IEnumerator ShowCamerasAtTheSun(float delayFirstCamera, float timeShowCloseCamera)
    {
        //Camera zoom in at the sun
        yield return(new WaitForSeconds(delayFirstCamera));

        cameraSunClose.enabled = true;
        cameraStartSun.enabled = false;

        //Camera at the sun...
        yield return(new WaitForSeconds(timeShowCloseCamera));

        StartCoroutine(FadeOutSound(spaceAudioSource, 0.5f));
        sunAudioSource.Play();
        cameraAtTheSun.enabled = true;
        cameraSunClose.enabled = false;
        yellowSquare.alpha     = 1;
        LeanTween.alphaCanvas(yellowSquare, 0f, 2.5f).setEaseOutQuad();
        //Move sun ground.
        LeanTween.scaleY(sunGround, 1.1f, 5f).setEaseInOutSine().setLoopPingPong();
        yield return(new WaitForSeconds(secToWaitBeforeSunHeroMoves));

        MoveSunHeroAndStartDialogue();
    }
Ejemplo n.º 27
0
    public void ShowTurretOptions()
    {
        // hide all other selections first
        GameObject[] allSelections = GameObject.FindGameObjectsWithTag("TurretOptions");
        foreach (GameObject selection in allSelections)
        {
            if (selection.gameObject == this.gameObject)
            {
                continue;
            }
            selection.GetComponent <TurretSelector>().HideTurretOptions();
        }

        // show current selection, if not already shown
        if (!this.gameObject.activeSelf)
        {
            this.gameObject.SetActive(true);
            this.gameObject.transform.localScale = new Vector3(1, 0, 1);
            LeanTween.scaleY(this.gameObject, 1, 0.75f).setEaseOutElastic();
        }

        StartCoroutine(AutoHideTurretOptionsWhenMouseIsNotOn(3));
    }
Ejemplo n.º 28
0
    public void IncreaseTaskProgress()
    {
        currentTaskProgress++;
        taskProgressBar.fillAmount = currentTaskProgress / (float)currentTaskGoal;
        if (currentTaskProgress >= currentTaskGoal)
        {
            ChooseRandomTask();
        }
        UpdateMouseSprite();

        // Squash and stretch
        LeanTween.cancel(mouseSpriteRenderer.gameObject);
        mouseSpriteRenderer.transform.localScale = Vector3.one;
        LeanTween.scaleY(mouseSpriteRenderer.gameObject, 0.95f, 0.05f);
        LeanTween.scaleX(mouseSpriteRenderer.gameObject, 1.05f, 0.05f).setOnComplete(() =>
        {
            LeanTween.scaleY(mouseSpriteRenderer.gameObject, 1.1f, 0.15f).setEase(LeanTweenType.easeOutQuad);
            LeanTween.scaleX(mouseSpriteRenderer.gameObject, 0.9f, 0.15f).setEase(LeanTweenType.easeOutQuad).setOnComplete(() =>
            {
                LeanTween.scale(mouseSpriteRenderer.gameObject, Vector3.one, 0.1f).setEase(LeanTweenType.easeInQuad);
            });
        });
    }
Ejemplo n.º 29
0
        protected virtual void animDisable()
        {
            switch (disableType)
            {
            case AnimatedType.Alpha: LeanTween.alpha(targetRect, 0, duration); break;

            case AnimatedType.AlphaText: LeanTween.alphaText(targetRect, 0, duration); break;

            case AnimatedType.AlphaVertex: LeanTween.alphaVertex(targetRect.gameObject, 0, duration); break;

            case AnimatedType.Scale: LeanTween.scale(targetRect, Vector3.zero, duration); break;

            case AnimatedType.ScaleX: LeanTween.scaleX(targetRect.gameObject, 0, duration); break;

            case AnimatedType.ScaleY: LeanTween.scaleY(targetRect.gameObject, 0, duration); break;

            case AnimatedType.ScaleZ: LeanTween.scaleZ(targetRect.gameObject, 0, duration); break;

            case AnimatedType.Size: LeanTween.size(targetRect, Vector2.zero, duration); break;

            case AnimatedType.Color: LeanTween.color(targetRect, targetColor, duration); break;
            }
        }
Ejemplo n.º 30
0
        // Code that runs on entering the state.
        public override void OnEnter()
        {
            GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);

            Fsm.Event(onStartEvent);
            LTDescr tween = LeanTween.scaleY(go, scale.Value, time.Value);

            LeanTweenID.Value = tween.id;

            tween.setEase(easeType);
            tween.setDelay(delay.Value);

            if (noOfRepeat.Value > 0)
            {
                tween.setRepeat(noOfRepeat.Value);
            }

            switch (LoopType)
            {
            case LTLoop.clamp:
                tween.setLoopClamp();
                break;

            case LTLoop.once:
                tween.setLoopOnce();
                break;

            case LTLoop.pingpong:
                tween.setLoopPingPong();
                break;
            }

            tween.setOnComplete(doOnComplete);
            tween.setOnUpdate(doOnUpdate);
            tween.setUseEstimatedTime(useEstimatedTime.Value);
            tween.setUseFrames(useFrames.Value);
        }