moveLocalY() public static method

public static moveLocalY ( GameObject gameObject, float to, float time ) : LTDescr,
gameObject GameObject
to float
time float
return LTDescr,
 private void UpSlime()
 {
     LeanTween.moveLocalY(slimesText, 1500f, 0.5f).setEase(LeanTweenType.easeInBack);
 }
Beispiel #2
0
 private void OnMouseExit()
 {
     LeanTween.moveLocalY(gameObject, defaultPosition.y, time)
     .setEase(easeType);
 }
 private void MouseExit()
 {
     LeanTween.alpha(image.rectTransform, 1, 0.3f);
     LeanTween.moveLocalY(_cancelButton, 39.5f, 0.3f);
     LeanTween.scale(_cancelButton, new Vector3(1, 1, 1), 0.3f);
 }
    void TurnOffBlender()
    {
        AudioController.getSingleton().PlaySFX("Sounds/Toggle-SoundBible.com-231290292");

        LeanTween.moveLocalY(gameObject, (str.y), 0.3f);
    }
 public void OpenDoors(int index)
 {
     LeanTween.moveLocalY(doors[index], 2.65f, 2f);
 }
Beispiel #6
0
 public void cardsClick()
 {
     LeanTween.moveLocalY(cards, -484, 1f);
 }
Beispiel #7
0
 private void MoveUp()
 {
     LeanTween.moveLocalY(gameObject, HiddenYPos, TweenTime).setEase(LeanTweenType.easeOutExpo).setOnComplete(PrepareForNextTime);
 }
 private void moveFinished()
 {
     LeanTween.moveLocalY(gameObject, oldPos.y - MoveBounce, bounceTime).setLoopPingPong(1).setOnComplete(DropFinished);
     LeanTween.moveLocalY(RootPanel.gameObject, RootPanel.localPosition.y - RootPanelShakeDistance, RootPanelShakeTime).setLoopPingPong(RootPanelshakeCount).setDelay(RootPanelShakeTimeDelay);
 }
Beispiel #9
0
 private void ShowList()
 {
     LeanTween.moveLocalY(listRect, 0, 0.3f).setEase(LeanTweenType.easeOutQuad);
     LeanTween.alpha(background.rectTransform, 0.55f, 0.3f).setRecursive(false);
 }
Beispiel #10
0
 public void MoveOutToTop(GameObject selectedObject)
 {
     LeanTween.moveLocalY(selectedObject, 1080f, duration).setOnComplete(GameManager.instance.MoveBackground);
 }
Beispiel #11
0
 public void MoveOutToBottom(GameObject selectedObject)
 {
     LeanTween.moveLocalY(selectedObject, -1080f, duration).setOnComplete(GameManager.instance.StartGame);
 }
 private void Start()
 {
     LeanTween.moveLocalY(_imgIcon.gameObject, 50, 1.0f).setEase(LeanTweenType.easeOutSine);
     LeanTween.alphaCanvas(_group, 1, 1.0f).setDelay(0.85f);
 }
Beispiel #13
0
 private void OnEnable()
 {
     LeanTween.moveLocalY(gameObject, moveToY, time);
 }
Beispiel #14
0
    public void SetState(EState state)
    {
        switch (state)
        {
        case EState.Start:
            jumpBGM.Play();
            LeanTween.moveY(this.gameObject, 1.0f, 0.27f).setDelay(0.3f);
            animation.StartAnimation(characterRenderer, (int)EState.Start, 0.1f, () =>
            {
                fadebox.gameObject.SetActive(true);
                LeanTween.alphaCanvas(fadebox, 1, 0.2f).setOnComplete(() => {
                    loading.gameObject.SetActive(true);
                    LeanTween.alphaCanvas(fadebox, 0, 0.2f).setOnComplete(() => {
                        fadebox.gameObject.SetActive(false);
                        loading.gameObject.SetActive(true);
                        LeanTween.alphaCanvas(loading.GetComponent <CanvasGroup>(), 0, 0.3f).setOnComplete(() => {
                            loading.gameObject.SetActive(false);
                            SetGameSetting();
                        }).setDelay(1.0f);
                    });
                });
            }, false);
            break;

        case EState.Finish:

            if (block)
            {
                return;
            }

            ////
            block = true;

            cutAni.gameObject.SetActive(false);
            LeanTween.moveLocalY(this.gameObject, -6.2f, 0.5f).setEaseInBack().setOnComplete(() => {
                shake.MakeShake(10);

                toMain.gameObject.SetActive(true);
                LeanTween.alphaCanvas(toMain, 1, 0.4f).setDelay(0.7f);

                score.text = (meter + 100 * (500 - gameEngine.bossPanel.value)).ToString();
                score.gameObject.SetActive(true);
                LeanTween.scale(score.gameObject, new Vector3(1, 1), 0.4f).setEaseInOutElastic();
                LeanTween.alphaCanvas(score.GetComponent <CanvasGroup>(), 1.0f, 0.4f).setOnComplete(() => {
                    LeanTween.moveLocalY(score.gameObject, 750, 0.4f).setEaseInExpo();
                });
            });


            break;

        case EState.Fly:
            upAni.gameObject.SetActive(true);
            upAni.StartAnimation(upAni.GetComponent <SpriteRenderer>(), 0, 0, null, true);
            THHPManager.Instance.HPDamageStop();
            animation.StartAnimation(characterRenderer, (int)EState.Fly, 0.2f, null, true);

            level += 1;     //레벨 업
            THHPManager.Instance.SetHPToLevel(level);


            if (!fiberBar.isFiberTime)
            {
                fiberBar.gameObject.SetActive(false);
                LeanTween.moveLocalY(characterRenderer.gameObject, 7.5f, 0.6f)
                .setDelay(0.05f)
                .setEaseOutBack()
                .setOnComplete(() => {
                    upAni.gameObject.SetActive(false);
                    SetGameSetting();
                });
            }
            break;

        default:
            break;
        }
    }
Beispiel #15
0
    void Update()
    {
        if (Vector3.Distance(Vector3.zero, transform.position) > 50)
        {
            Application.LoadLevel(GameManager.instance.currentLevel);
        }

        xDirection = Input.GetAxisRaw("Horizontal");

        if (Input.GetButtonDown("Jump") && state == PlayerState.onGround)
        {
            state = PlayerState.jumping;
            AudioManager.instance.PlayJump();
            LeanTween.moveLocalY(gameObject, transform.localPosition.y + jumpForce, 0.3f).setEase(jumpEase).setIgnoreTimeScale(true).setOnComplete(SetFalling);
        }

        if (Mathf.Abs(xDirection) < 0.01f)
        {
            xDirection = 0f;
        }

        if (state == PlayerState.falling)
        {
            yDirection    = gravity - gravityAdder;
            gravityAdder += 1f;
        }
        else
        {
            gravityAdder = 0f;
            yDirection   = 0f;
        }

        RaycastHit hitRight;
        RaycastHit hitLeft;
        RaycastHit hitCenter;

        Debug.DrawRay(transform.position, rayDirection * rayCastDist, Color.red);
        Debug.DrawRay(transform.position + new Vector3(0.5f, 0, 0), rayDirection * rayCastDist, Color.red);
        Debug.DrawRay(transform.position - new Vector3(0.5f, 0, 0), rayDirection * rayCastDist, Color.red);

        if (Physics.Raycast(transform.position + new Vector3(0.5f, 0, 0), rayDirection, out hitRight, rayCastDist) ||
            Physics.Raycast(transform.position - new Vector3(0.5f, 0, 0), rayDirection, out hitLeft, rayCastDist) ||
            Physics.Raycast(transform.position, rayDirection, out hitCenter, rayCastDist))
        {
            if (hitLeft.collider != null && hitLeft.collider.tag.Equals("DeathCube") ||
                hitRight.collider != null && hitRight.collider.tag.Equals("DeathCube") ||
                hitCenter.collider != null && hitCenter.collider.tag.Equals("DeathCube"))
            {
                if (!reloading)
                {
                    StartCoroutine("ReloadLevel");
                }
            }

            if (hitLeft.collider != null && hitLeft.collider.tag.Equals("Gate") ||
                hitRight.collider != null && hitRight.collider.tag.Equals("Gate") ||
                hitCenter.collider != null && hitCenter.collider.tag.Equals("Gate"))
            {
                GameManager.instance.GoToNextLevel();
            }


            if (state != PlayerState.onGround)
            {
                CameraShake.instance.ShakeCamera();
                state = PlayerState.onGround;
            }
        }
        else
        {
            if (state != PlayerState.jumping)
            {
                state = PlayerState.falling;
            }
        }

        movementVector = new Vector3(xDirection * playerSpeed, yDirection, 0) * Time.deltaTime / Time.timeScale;

        transform.Translate(movementVector);
    }
Beispiel #16
0
 private void HideList()
 {
     LeanTween.moveLocalY(listRect, 1124, 0.3f).setEase(LeanTweenType.easeInQuad);
     LeanTween.alpha(background.rectTransform, 0, 0.3f).setRecursive(false);
 }
Beispiel #17
0
 // Start is called before the first frame update
 void Start()
 {
     LeanTween.moveLocalY(gameObject, transform.localPosition.y - .5f, 2f).setEaseInOutQuad().setLoopPingPong();
     LeanTween.scale(gameObject, new Vector3(1.1f, 1.1f, 1.1f), 1.8f).setEaseInOutQuad().setLoopPingPong();
 }
 void Start()
 {
     LeanTween.moveLocalY(ArrowObj, BounceDistance, BOUNCE_SPEED).setLoopPingPong().setLoopCount(-1).setEase(LeanTweenType.easeInOutSine);
 }
Beispiel #19
0
    public void carbonClick()
    {
        LeanTween.moveLocalY(cards, -917, 1f);

        Instantiate(carbon, content.transform);
    }
Beispiel #20
0
 private void OnDoorwayOpen()
 {
     LeanTween.moveLocalY(gameObject, riseAmount, 0.9f).setEaseOutQuad();
 }
    // Update is called once per frame
    void Update()
    {
        //Change HP bar based on size
        if (hp == 3)
        {
            bar.localScale = new Vector3(1.0f, 1.0f, 1.0f);
        }

        else if (hp == 2)
        {
            bar.localScale = new Vector3(0.6f, 1.0f, 1.0f);
        }

        else if (hp == 1)
        {
            bar.localScale = new Vector3(0.3f, 1.0f, 1.0f);
        }

        else if (hp == 0)
        {
            bar.localScale = new Vector3(0.0f, 1.0f, 1.0f);
            if (!dead)
            {
                StartCoroutine(SetInactive());
            }
        }

        //Changing size to notice player to press key
        if (changeSize)
        {
            LeanTween.scale(spriteObject, spriteObject.transform.localScale * 1.7f, 0.25f).setEase(LeanTweenType.easeOutBounce);
            LeanTween.moveLocalY(canvas.gameObject, -1.2f, 0.25f).setEase(LeanTweenType.easeOutBounce);
            changeSize = false;
        }

        //If player press the right key no slash will appear and some particles will appear and call the SetInactive function
        if (startPressing)
        {
            if (!startMissTimer)
            {
                StartCoroutine(SetMiss());
                startMissTimer = true;
            }

            if (Input.anyKeyDown)
            {
                if (Input.inputString == tm.text.ToLower())
                {
                    GetComponent <AudioSource>().Play();
                    ps.Play();
                    LeanTween.scale(spriteObject, originalSize, 0.25f);

                    LeanTween.moveLocalY(canvas.gameObject, -0.75f, 0.25f).setEase(LeanTweenType.easeOutBounce);

                    color.a = 150.0f / 255.0f;
                    LeanTween.color(spriteObject, color, 0.25f);

                    startPressing   = false;
                    pressedRightKey = true;
                    changeKey       = true;
                }
            }
        }

        else
        {
            if (Input.anyKeyDown)
            {
                if (Input.inputString == tm.text.ToLower())
                {
                    Input.ResetInputAxes();
                    StartCoroutine(MarkWrong());
                    if (hp > 0)
                    {
                        hp--;
                    }
                }
            }
        }
    }
Beispiel #22
0
 private void OnDoorwayClose()
 {
     LeanTween.moveLocalY(gameObject, yPosStart, 0.7f).setEaseOutQuad();
 }
Beispiel #23
0
 public static LTDescr LeanMoveLocalY(this Transform transform, float to, float time)
 {
     return(LeanTween.moveLocalY(transform.gameObject, to, time));
 }
Beispiel #24
0
 private void moveButtonUp()
 {
     LeanTween.moveLocalY(buttonFace.gameObject, 0.1f, 0.1f);
 }
 public void CloseDoors(int index)
 {
     LeanTween.moveLocalY(doors[index], 0f, 2f);
 }
Beispiel #26
0
 public static void MoveLocalY(GameObject obj, float endPos, float duration, LeanTweenType easetype = LeanTweenType.linear)
 {
     LeanTween.moveLocalY(obj, endPos, duration).setEase(easetype);
 }
 private void MouseEnter()
 {
     LeanTween.alpha(image.rectTransform, 0.1f, 0.3f);
     LeanTween.moveLocalY(_cancelButton, 0, 0.3f);
     LeanTween.scale(_cancelButton, new Vector3(1.5f, 1.5f, 1.5f), 0.3f);
 }
Beispiel #28
0
 // Use this for initialization
 void Start()
 {
     LeanTween.moveLocalY(this.gameObject, this.transform.localPosition.y + 0.6f, this.Time / 4).setEase(LeanTweenType.easeOutQuad);
     LeanTween.moveLocalY(this.gameObject, 0, 3 * this.Time / 4).setEase(LeanTweenType.easeInQuad).setDelay(this.Time / 4);
 }
Beispiel #29
0
 public static LTDescr LeanMoveLocalY(this GameObject gameObject, float to, float time)
 {
     return(LeanTween.moveLocalY(gameObject, to, time));
 }
 private void Up()
 {
     LeanTween.moveLocalY(congratsText, 1500f, 0.5f).setEase(LeanTweenType.easeInBack);
 }