moveX() public static method

public static moveX ( GameObject gameObject, float to, float time ) : LTDescr,
gameObject GameObject
to float
time float
return LTDescr,
Example #1
0
    public IEnumerator StarterAnimation()
    {
        yield return(new WaitForSeconds(4f));

        dr.open = true;
        LeanTween.moveX(dr.Panel1.GetComponent <RectTransform>(), -180, 0.5f);
        LeanTween.alphaCanvas(OpaquePanel.GetComponent <CanvasGroup>(), 1, 0.3f);
        OpaquePanel.SetActive(true);
        dr.GetComponent <AudioSource>().PlayOneShot(dr.obook);
        dr.counter = 1;
    }
Example #2
0
    private IEnumerator ResetScore()
    {
        yield return(new WaitForSeconds(0.5f));

        LeanTween.moveX(scoreLoss.GetComponent <RectTransform>(), startPosX, 0.2f);

        yield return(new WaitForSeconds(0.2f));

        scoreLoss.enabled = false;
        scoreAnimReady    = true;
    }
Example #3
0
 void Shake()
 {
     shakeAnimX = LeanTween.moveX(toShake, anchorPos.x - 100f, 0.2f + Random.Range(0, 0.2f)).setEase(LeanTweenType.easeShake);
     shakeAnimY = LeanTween.moveY(toShake, anchorPos.y - 200, 0.15f + Random.Range(0, 0.1f)).setEase(LeanTweenType.easeShake).setOnComplete(
         () => {
         shakeAnimY = LeanTween.moveY(toShake, anchorPos.y + 100f, 0.1f).setEase(LeanTweenType.easeShake).setOnComplete(
             () => {
             shakeAnimY = LeanTween.move(toShake, anchorPos, 0.1f).setEase(LeanTweenType.easeOutSine);
         });
     });
 }
    public void scaleButtonUp()
    {
        //float offset = (Camera.main.orthographicSize * 1.15f) / 5.0f;
        float offset = 1.15f;

        LeanTween.value(gameObject, tweenSize, allRenderers[0].size.x, allRenderers[0].size.x + offset, 0.2f);
        LeanTween.value(selectedOutlineRenderer.gameObject, tweenSelectedOutlineSize, selectedOutlineRenderer.size.x, selectedOutlineRenderer.size.x + offset, 0.2f);
        LeanTween.value(selectedInnerRenderer.gameObject, tweenSelectedInnerSize, selectedInnerRenderer.size.x, selectedInnerRenderer.size.x + offset, 0.2f);
        LeanTween.moveX(gameObject, transform.position.x + offset * transform.localScale.x * 0.5f, 0.2f);
        LeanTween.moveX(canvas.GetComponent <RectTransform>(), canvas.GetComponent <RectTransform>().anchoredPosition.x - offset * 0.5f, 0.2f);
    }
Example #5
0
    public void TogglePanelAnimation()
    {
        if (animate)
        {
            return;
        }
        animate = true;
        var finalPos = visible ? 0f : (int)SlideDirection * _rectTransform.sizeDelta.x;

        LeanTween.moveX(_rectTransform, finalPos, animationTime).setEase(easeType).setOnComplete(ToggleVisible);
    }
Example #6
0
    void Leave()
    {
        LeanTween
        .rotate(gameObject, new Vector3(0f, 0f, 30f), animationScale * 0.25f)
        .setEase(LeanTweenType.easeInCubic);

        LeanTween
        .moveX(gameObject, -5000f, animationScale * 1.5f)
        .setEase(LeanTweenType.easeInCubic)
        .setOnComplete(OnFinish);
    }
Example #7
0
    void MoveX()
    {
        float x = 0.1f;

        if (i % 2 == 0)
        {
            x = -x;
        }
        i++;
        LeanTween.moveX(gameObject, transform.position.x + x, 1f).setOnComplete(MoveX);
    }
Example #8
0
    private void moveOldMissionsAndReplaceWithNew()
    {
        int i = 0;

        LeanTween.moveX(deathMissionsToggleAndText[i].missionToggle.gameObject, EndMissionTextX, timeToRemoveMission).setIgnoreTimeScale(true).setEase(LeanTweenType.easeInOutElastic).setOnComplete(
            () =>
        {
            moveOldMission(i);
        }
            );
    }
Example #9
0
    IEnumerator ExpandTimeList()
    {
        if (moving)
        {
            yield break;
        }
        moving = true;
        LeanTween.moveX(gameTimeUI.GetComponent <RectTransform>(), -500, 0.1f);//.setEase(LeanTweenType.easeOutExpo);
        yield return(new WaitForSeconds(0.1f));

        moving = false;
    }
Example #10
0
    /// <summary>
    /// 교체 배경을 밀어낸다
    /// </summary>
    /// <param name="inResourceName"></param>
    /// <param name="inDirection"></param>
    /// <param name="inTime"></param>
    public void Push(string inResourceName, BehaviorData.EDirection inDirection, float inTime)
    {
        GameObject gameObject = FindResource(inResourceName);

        gameObject.SetActive(true);
        gameObject.GetComponent <Canvas>().sortingOrder = _sortOrder;
        gameObject.GetComponent <CanvasGroup>().alpha   = 1;
        gameObject.transform.position = new Vector2(640 - 1280 + 1280 * (int)inDirection, 360);

        LeanTween.moveX(gameObject, 640, inTime).setEase(LeanTweenType.easeInOutSine);
        _sortOrder++;
    }
Example #11
0
    private IEnumerator GoBackToMenu()
    {
        Time.timeScale = 1f;
        StartCoroutine(ZoonOut());
        LeanTween.moveY(pause, 7.80f, 0.5f);
        LeanTween.alphaCanvas(pauseDarkening.GetComponent <CanvasGroup>(), 0f, 0.5f);
        LeanTween.moveX(transiction_left, 4.020003f, 1f).setIgnoreTimeScale(true);
        LeanTween.moveX(transiction_right, 4.020003f, 1f).setIgnoreTimeScale(true);
        yield return(new WaitForSeconds(1f));

        SceneManager.LoadScene("Menu", LoadSceneMode.Single);
    }
Example #12
0
    public void HideAndDisablePanel()
    {
        if (!gameObject.activeInHierarchy)
        {
            return;
        }
        visible = false;
        var initPos = 0f;

        LeanTween.moveX(_rectTransform, initPos, 0f);
        TogglePanelAnimation(ToggleVisibleDisable);
    }
    // Start is called before the first frame update
    void Start()
    {
        LeanTween.moveX(Mesh1, Mesh1.transform.position.x + 20f, 1f).setLoopPingPong();

        LeanTween.rotateAround(Mesh2, Vector3.up, -360, 8f).setLoopClamp();
        LeanTween.moveX(Mesh2, Mesh2.transform.position.x + 5f, 1f).setLoopPingPong();

        LeanTween.rotateAround(Mesh3, Vector3.up, -360, 25f).setLoopClamp();
        LeanTween.moveY(Mesh3, Mesh3.transform.position.y - 10f, 1f).setEase(LeanTweenType.easeInOutCirc).setLoopPingPong();
        LeanTween.moveX(Mesh3, Mesh3.transform.position.x + 5f, 1f).setEase(LeanTweenType.easeInOutCirc).setLoopPingPong();
        LeanTween.scale(Mesh3, new Vector3(24f, 4f, 47f), 0.5f).setLoopPingPong();
    }
 public void SwapFrame(int frame_idx)
 {
     // Exit current frame to the left
     if (frame_idx != current_frame_idx)
     {
         RectTransform current_frame = frames[current_frame_idx].GetComponent <RectTransform>();
         RectTransform new_frame     = frames[frame_idx].GetComponent <RectTransform>();
         LeanTween.moveX(current_frame, -screen_shift, swap_time).setOnComplete(ResetFramePositions);
         LeanTween.moveX(new_frame, 0, swap_time);
         current_frame_idx = frame_idx;
     }
 }
Example #15
0
    public void OpenContainerView()
    {
        //Debug.Log("OpenContainerView");

        /*// set auto transfer target parent, so the auto transfer from the inventory knows where to put items when this canvas has been opened
         * if(itemAutoTransferTargetParent != null)
         * {
         *  Debug.Log("AUTOPARENT FATHER SET");
         *  InventoryItemHandler.SetAutoTransferTargetParent(itemAutoTransferTargetParent);
         * }*/
        GetComponent <AutoTransferItemCapability>().PrepareAutoTransferTarget();

        foreach (Transform child in transform.GetChild(0))
        {
            if (child.gameObject.name == "PanelTransfer")
            {
                foreach (Transform child2 in child)
                {
                    if (child2.gameObject.name == "ButtonTransferIntoContainer")
                    {
                        child2.gameObject.GetComponent <TransferIntoContainerHandler>().updateButtonActive();
                    }

                    if (child2.gameObject.name == "ButtonTransferOutOfContainer")
                    {
                        child2.gameObject.GetComponent <TransferOutOfContainerHandler>().updateButtonActive();
                    }

                    if (child2.gameObject.name == "ButtonStartCentrifuge")
                    {
                        child2.gameObject.GetComponent <CentrifugeHandler>().updateButtonActive();
                        child2.gameObject.GetComponent <CentrifugeHandler>().UpdateDisplayedSlotsNumber();
                    }
                }
            }
        }

        transform.GetChild(0).localScale = new Vector3(1, 1, 1);

        GameObject.Find("PanelInventory").GetComponent <RectTransform>().anchorMin = new Vector2(0, 1);
        GameObject.Find("PanelInventory").GetComponent <RectTransform>().anchorMax = new Vector2(0, 1);
        GameObject.Find("PanelInventory").GetComponent <RectTransform>().pivot     = new Vector2(0, 0.5f);
        LeanTween.moveX(GameObject.Find("PanelInventory").GetComponent <RectTransform>(), -35, 0);
        inventoryUIBehaviour.OpenInventory(280);
        inventoryUIBehaviour.isLocked = true;
        inventoryUIBehaviour.HideButton();


        if (hasTransferAmountSelection)
        {
            GameObject.Find("PanelTransferAmount").transform.localScale = new Vector3(1, 1, 1);
        }
    }
 private void AnimateButton()
 {
     if (chooseAnim)
     {
         LeanTween.rotate(transformButton, -180.0f, 1f);
     }
     else
     {
         LeanTween.moveX(transformButton, -0.3f, 0.3f).setEase(LeanTweenType.easeShake);        //AnimateForNoData
         StartCoroutine("BlueSplashe");
     }
 }
 private void ResetFramePositions()
 {
     // Set frame positions
     for (int i = 0; i < frames.Count; i++)
     {
         if (i != current_frame_idx)
         {
             RectTransform target_frame = frames[i].GetComponent <RectTransform>();
             LeanTween.moveX(target_frame, screen_shift, 0);
         }
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     // Set frame positions
     for (int i = 0; i < frames.Count; i++)
     {
         if (i != 0)
         {
             RectTransform target_frame = frames[i].GetComponent <RectTransform>();
             LeanTween.moveX(target_frame, screen_shift, 0);
         }
     }
 }
Example #19
0
 // Use this for initialization
 void Start()
 {
     loadingIcon        = Instance.transform.Find("icon").GetComponent <RectTransform>();
     loadingBG          = Instance.transform.Find("LoadingBG").GetComponent <RectTransform>();
     progressText       = Instance.transform.Find("loadingText").GetComponent <Text>();
     LoadingLayer       = Instance.transform.GetComponent <CanvasGroup>();
     progressText.text  = "loading...";
     LoadingLayer.alpha = 0;
     loadingBG.position = new Vector2(640, 0);
     LeanTween.alphaCanvas(transform.GetComponent <CanvasGroup>(), 1, 0.5f);
     LeanTween.moveX(loadingBG, 0, 0.5f);
 }
    public static void ReceiveDamage(GameObject gameObject, Action onComplete = null)
    {
        if (LeanTween.isTweening(gameObject))
        {
            return;
        }

        LeanTween.moveX(gameObject, gameObject.transform.position.x + 0.15f, 0.3f)
        .setEaseShake()
        .setRepeat(2)
        .setOnComplete(onComplete);
    }
Example #21
0
 private void MovePresidentToComputer()
 {
     presidentSkeleton.state.SetAnimation(1, runPresident, true);
     president.transform.localScale = new Vector3(-1f, 1f, 1f);
     LeanTween.moveX(president, president.transform.position.x + distanceMovePresident, presidentMovingSpeed / Time.deltaTime).setOnComplete(() =>
     {
         presidentSkeleton.state.SetAnimation(1, idlePresident, true);
         StartComputerVFX.Play();
         cameraComputerClose.enabled        = true;
         cameraPresidentAndComputen.enabled = false;
         StartCoroutine(WaitAndDisconnectEarth());
     });
 }
    private void Awake()
    {
        rectTransform = gameObject.GetComponent <RectTransform>();

        if (OnRight)
        {
            LeanTween.moveX(rectTransform, rightPosition, 0);
        }
        else
        {
            LeanTween.moveX(rectTransform, leftPosition, 0);
        }
    }
Example #23
0
    public void moveGUI()
    {
        leantweenLT = LeanTween.moveX(this.GetComponent <RectTransform>(), guiPos.x, showTime).setEase(easeType);
        if (this.GetComponent <RectTransform>().localPosition.x >= guiPos.x)
        {
            leantweenLT.setOnComplete(stopLeanTween);
        }

        if (withScale)
        {
            leantweenLT.setOnComplete(scaleGUI);
        }
    }
Example #24
0
 public void MoveStart()
 {
     if (LeanTween.isTweening(shopBtnObj))
     {
         LeanTween.cancel(shopBtnObj);
     }
     if (LeanTween.isTweening(adBtnObj))
     {
         LeanTween.cancel(adBtnObj);
     }
     LeanTween.moveX(adBtnObj, -0.9f, 1.0f).setOnComplete(MoveEnd);
     LeanTween.moveX(shopBtnObj, 0.9f, 1.0f);
 }
Example #25
0
 public void SetUp(string InString)
 {
     CountInstance = 1;
     MultiplierGameObject.SetActive(false);
     LeanTween.cancel(this.gameObject);
     this.rectTransform.localPosition = DefaultPosition;
     Text.text     = InString;
     BackText.text = InString;
     LeanTween.moveY(rectTransform, Distancey, Timey).setEaseInOutQuad();
     LeanTween.moveX(rectTransform, Distancex, Timex).setEaseInOutQuad();
     DoFade = true;
     this.gameObject.SetActive(true);
 }
Example #26
0
 // shoots a smog ball at the player
 void ShootSmogBall()
 {
     if (!isDead)
     {
         AudioManager.Instance.PlayClip("shooterEnemySpit");
         animator.SetBool("Spit", true);
         animator.SetBool("IsSpitMode", false);
         bulletAux = GameObjectUtils.AddChild(null, bulletPrefab);
         bulletAux.transform.position = transform.position;
         LeanTween.moveX(bulletAux, player.transform.position.x, 2.0f);
         StartCoroutine(WaitASecond());
     }
 }
Example #27
0
    private IEnumerator UI_scaling()
    {
        gameObject.transform.localScale             = new Vector3(screenWidth, screenHeight);
        gameObject.transform.GetChild(0).localScale = new Vector3(1f / screenWidth, 1f / screenHeight);
        gameObject.transform.GetChild(1).localScale = new Vector3(1f / screenWidth, 1f / screenHeight);

        LeanTween.moveX(gameObject.transform.GetChild(0).gameObject, screenWidth + screenWidth * 0.2f, 0f);
        LeanTween.moveY(gameObject.transform.GetChild(0).gameObject, screenWidth * 0.05f, 0f);
        LeanTween.moveX(gameObject.transform.GetChild(1).gameObject, -screenWidth * 0.2f, 0f);
        LeanTween.moveY(gameObject.transform.GetChild(1).gameObject, screenHeight - screenWidth * 0.05f, 0f);

        yield return(new WaitForSeconds(0.5f));
    }
Example #28
0
    public void ShowAndEnablePanel()
    {
        if (gameObject.activeInHierarchy)
        {
            return;
        }
        visible = true;
        gameObject.SetActive(true);
        var initPos = -_rectTransform.sizeDelta.x;

        LeanTween.moveX(_rectTransform, initPos, 0f);
        TogglePanelAnimation(ToggleVisible);
    }
Example #29
0
    public void CloseMenu()
    {
        LeanTween.moveX(Content.GetComponent <RectTransform>(), OldPosX, 0.5f).onComplete = delegate
        {
            LeanTween.alpha(BtnMenu.GetComponent <RectTransform>(), 0f, 0.2f).onComplete = delegate
            {
                BtnMenu.GetComponent <Image>().sprite = menu_spr[0];
                LeanTween.alpha(BtnMenu.GetComponent <RectTransform>(), 1f, 0.2f);
            };

            flag = true;
        };
    }
Example #30
0
 // Start is called before the first frame update
 void Start()
 {
     if (good)
     {
         LeanTween.moveX(gameObject, -30, 4f);
         LeanTween.scale(gameObject, new Vector3(0.1f, 0.1f, 0.1f), 2f);
     }
     else
     {
         LeanTween.moveX(gameObject, 30, 4f);
         LeanTween.scale(gameObject, new Vector3(0.1f, 0.1f, 0.1f), 2f);
     }
 }