public static rotateY ( GameObject gameObject, float to, float time ) : LTDescr, | ||
gameObject | GameObject | |
to | float | |
time | float | |
return | LTDescr, |
public void FlipCard(bool animate = false) { if (!animate) { transform.eulerAngles = new Vector3( transform.eulerAngles.x, 0f, transform.eulerAngles.z ); ToggleBackFace(); } else { _flipCount = 1; GameScript.AnimationState = GameScript.GameAnimationState.Animating; LeanTween .rotateY(gameObject, 90f, 0.2f) .setLoopPingPong(1) .setOnComplete(() => { _flipCount++; if (_flipCount % 2 == 0) { ToggleBackFace(); } if (_flipCount % 3 == 0) { GameScript.AnimationState = GameScript.GameAnimationState.Idle; } }) .setOnCompleteOnRepeat(true) .setEaseInQuart(); LeanTween.rotateZ(gameObject, 40f, 0.2f).setLoopPingPong(1).setEaseInQuart(); } }
private void TurnLeft() { canMove = false; LeanTween.rotateY(gameObject, transform.rotation.eulerAngles.y - 90.0f, turnSpeed) .setOnComplete(() => canMove = true); }
IEnumerator Win(Collider other) { Strip.SetActive(false); //other.gameObject.transform.Find("Male").gameObject.GetComponent<Animator>().SetTrigger("jump"); //other.gameObject.transform.Find("Male").gameObject.GetComponent<PlayerMovement>().FinalMove(); // yield return new WaitForSeconds(0.6f); // SkateBoard.SetActive(true); // other.gameObject.SetActive(false); WinCAm.Priority = 100; //ConfettiPlay(); // Lea GameObject gameObject = Player.gameObject.transform.parent.gameObject; gameObject.GetComponent <PlayerMovement>().SetMove(false); Player.SetBool("run", false); Player.SetBool("up", false); Player.SetBool("down", false); name.SetActive(false); LeanTween.rotateY(Player.gameObject, 180, 0.5f); yield return(new WaitForSeconds(0.5f)); Player.SetTrigger("dance"); yield return(new WaitForSeconds(0.8f)); ConfettiPlay(); //MainCAm.SetActive(false); //skate.SetActive(false); }
override public void Func(GameObject mainTarget) { Vector3 target = mainTarget.transform.rotation.eulerAngles; target.y = target.y + amount; LeanTween.rotateY(mainTarget, target.y, 1); }
private IEnumerator Animate() { LeanTween.cancelAll(false); transform.position = _startPos; transform.rotation = Quaternion.identity; LeanTween.moveX(gameObject, 1.0f, 0.5f) .setOnComplete(() => { LeanTween.moveX(OtherChip, -0.05f, 0.1f) .setEase(LeanTweenType.easeOutSine) .setOnComplete(() => { LeanTween.moveX(OtherChip, 0.0f, 0.1f); }); LeanTween.moveX(gameObject, 0.0f, 0.4f) .setEase(LeanTweenType.easeOutSine); LeanTween.rotateY(gameObject, -180.0f, 0.4f) .setEase(LeanTweenType.easeOutSine); LeanTween.delayedCall(0.30f, () => { DropEffect.Play(); }); }); yield return(new WaitForSeconds(1.0f)); //transform.position = _startPos; }
private void ShowSelectedCountry() { foreach (Transform t in transform) { if (t.gameObject.name == Country) { _countryObject = t.gameObject; break; } } var camPos = Camera.main.transform.position; var globePos = transform.position; var countryPos = transform.position - transform.TransformPoint(_countryObject.transform.position); _rotationAngle = GetAngleOfRotationByDirections( new Vector2(camPos.x, camPos.z), new Vector2(globePos.x, globePos.z), new Vector2(countryPos.x, countryPos.z) ); var aBitToTheSide = 20f; LTDescr ltRotate = LeanTween.rotateY(gameObject, _rotationAngle + aBitToTheSide, 5f); ltRotate.setEase(LeanTweenType.easeInOutBack); LeanTween.move(gameObject, new Vector3(-0.3f, 0.35f, -2.35f), 4f); }
public IEnumerator InitCard() //처음 카드 보낼때 { TouchOff.SetActive(true); ChangeNum++; //랜덤 이미지 왼쪽 if (SceneChangeManager.SCENE.Level == 0) //색+모양 { LCardNum = Random.Range(0, 12); order.Add(LCardNum); LCard.GetComponent <Image>().sprite = BackImage[LCardNum]; //랜덤 이미지2 (오른쪽) RCardNum = Random.Range(0, 12); order.Add(RCardNum); } else if (SceneChangeManager.SCENE.Level == 1)//모양 조합 { LCardNum2 = Random.Range(0, 81); order.Add(LCardNum2); LCard.GetComponent <Image>().sprite = BackImage2[LCardNum2]; //랜덤 이미지2 (오른쪽) RCardNum2 = Random.Range(0, 81); order.Add(RCardNum2); } //이동 SoundManager.instance.CardPlace(); LeanTween.move(LCard, Target.transform.position, 1.0f).setEase(LeanTweenType.easeOutQuint); yield return(new WaitForSeconds(1.0f)); LeanTween.rotateY(LCard, 180f, 0.2f).setEase(LeanTweenType.linear); LeanTween.rotateY(RCard, 180f, 0.2f).setEase(LeanTweenType.linear); yield return(new WaitForSeconds(0.1f)); LCard.GetComponent <Image>().sprite = OriginImage; //왼쪽 뒤집히고 모양 if (SceneChangeManager.SCENE.Level == 0) //색+모양 { RCard.GetComponent <Image>().sprite = BackImage[RCardNum]; //오른쪽 새로운 모양 } else if (SceneChangeManager.SCENE.Level == 1) //모양조합 { RCard.GetComponent <Image>().sprite = BackImage2[RCardNum2]; } if (SceneChangeManager.SCENE.NBack == 2) //nBack 난이도 { yield return(new WaitForSeconds(0.5f)); StartCoroutine("CardMove"); } else { TouchOff.SetActive(false); } }
// Update is called once per frame void Update() { if (isHit) { if (Time.time > hitTime) { renderer.materials = defaultMaterials; isHit = false; hitPoints -= 1; if (hitPoints <= 0) { Destroy(gameObject); } } } if (Time.time > moveTime) { if (!DungeonData.inDebugMode) { var newPos = transform.position + transform.forward * 4.0f; if (CanMoveToPosition(newPos)) { animator.SetBool("Walk", true); LeanTween.moveLocal(gameObject, newPos, 2f) .setOnComplete(() => { animator.SetBool("Walk", false); }); } else { var dir = Random.Range(0, 2); if (dir == 0) { dir = -1; } if (CanMoveToPosition(transform.position + transform.right * dir * 4.0f)) { LeanTween.rotateY(gameObject, transform.rotation.eulerAngles.y + 90.0f * dir, 1f); } else if (CanMoveToPosition(transform.position - transform.right * dir * 4.0f)) { LeanTween.rotateY(gameObject, transform.rotation.eulerAngles.y - 90.0f * dir, 1f); } else { LeanTween.rotateY(gameObject, transform.rotation.eulerAngles.y - 180.0f, 2f); } } } moveTime = Time.time + moveRate; } }
private void RotateLeft() { if (LeanTween.isTweening(gameObject) == false) { _actualAngle -= 90f; LeanTween.rotateY(gameObject, _actualAngle, _rotateAnimationTime); } }
void RotateAnim() { LeanTween.rotateY(this.gameObject, 180, 3).setOnComplete(() => { LeanTween.rotateY(this.gameObject, 0, 3).setOnComplete(() => { RotateAnim(); }); }); }
private void PickUpAnim() { LeanTween.moveLocalY(this.gameObject, 0.65f, 0.5f); LeanTween.sequence(). append(LeanTween.rotateY(this.gameObject, 90f, 0.5f)). append(LeanTween.scale(this.gameObject, Vector3.zero, 0.4f)); }
private void Rotate() { if (rot >= 360) { rot = 0.0f; } rot += 90.0f; LeanTween.rotateY(this.gameObject, rot, 2.0f).setEase(typeEase).setOnComplete(Rotate).setDelay(1.0f); }
public void RotateY() { Debug.Log("RotateY()"); if (startPositionOffset) { objectToAnimate.GetComponent <Transform>().eulerAngles = from; } _tweenObject = LeanTween.rotateY(objectToAnimate, to.y, duration); }
public void StartBossFight() { _isActive = true; _player = GameObject.Find("/Player").transform; LeanTween.rotateY(gameObject, 270, 0.75f).setEase(LeanTweenType.easeOutQuad); _animator.SetTrigger("startFight"); _bossFightState = "idle"; }
void Update() { if(Input.GetMouseButtonDown(0)) { LeanTween.pause(card); LeanTween.rotateY(card, shakeAmount, shakeTime).setEase(tweenOption).setEaseShake().setLoopCount(5); SoundManager.GetInstance().Play(EFFECT_TYPE.SummonFail); } }
private void Close() { closeTween = LeanTween.rotateY(gameObject, startAngle, closeTime); closeTween.setEase(LeanTweenType.easeOutElastic); closeTween.setOnComplete(() => { animating = false; }); }
private void RotateY() { if (startOffset) { var rotation = _objRectTransform.rotation; rotation = Quaternion.Euler(rotation.x, floatFrom, rotation.z); _objRectTransform.rotation = rotation; } _tweenObject = LeanTween.rotateY(objectToAnimate, floatTo, duration); }
private void RotateY() { _objRectTransform = _objectToAnimate.GetComponent <RectTransform>(); if (_startPositionOffset) { _objRectTransform.rotation = Quaternion.Euler(_objRectTransform.rotation.x, _floatFrom, _objRectTransform.rotation.z); } _tweenObject = LeanTween.rotateY(_objectToAnimate, _floatTo, _duration); }
public bool ShowShirt(float delay) { if (IsAnimated) { return(false); } IsAnimated = true; LeanTween.rotateY(gameObject, 0, AnimateTime).setOnComplete(OnRotateComplete, null).setDelay(delay); LeanTween.delayedCall(gameObject, delay + AnimateTime / 2f, SwapSymToShirt); return(true); }
void SetVisualEffect() { //Force reset the material GetComponent <Renderer>().material = CubeDefaultMat; _rotateTweenId = LeanTween.rotateY(gameObject, transform.localEulerAngles.y + 90f, 2f).setEase(LeanTweenType.easeInOutCubic).setLoopPingPong().id; float perctIncrease = 5f; Vector3 targetScale = new Vector3(perctIncrease * 0.01f / transform.localScale.x, perctIncrease * 0.01f / transform.localScale.y, perctIncrease * 0.01f / transform.localScale.z); _scaleTweenId = LeanTween.scale(gameObject, targetScale, 2f).setEase(LeanTweenType.easeInOutCubic).setLoopPingPong().id; }
public bool ShowSymbol(OnBoxAnimateEvent callback, object param) { if (IsAnimated) { return(false); } IsAnimated = true; onAnimateComplete = callback; LeanTween.rotateY(gameObject, 180, AnimateTime).setOnComplete(OnRotateComplete, param); LeanTween.delayedCall(gameObject, AnimateTime / 2f, SwapShirtToSym); return(true); }
public IEnumerator CardMove() //카드 이동 함수 { ChangeNum++; TouchOff.SetActive(true); //초기화부분 //다시 시작되면 RCard의 이미지가 LCard에 복사되서 왼쪽으로 가고 RCard는 새로 랜덤 LCard.transform.position = CardOriginPosition; //처음포지션으로 가야지 LCard.GetComponent <Image>().sprite = RCard.GetComponent <Image>().sprite; //R카드 복사 RCard.GetComponent <Image>().sprite = OriginImage; //다시 왼쪽으로 가고 오른쪽 카드는 랜덤 SoundManager.instance.CardPlace(); LeanTween.move(LCard, Target.transform.position, 1.0f).setEase(LeanTweenType.easeOutQuint); //카드 이동 yield return(new WaitForSeconds(1.0f)); if (LCard.transform.eulerAngles.y == 180f || LCard.transform.eulerAngles.y == -180f) //카드 뒤집기 효과 { LeanTween.rotateY(LCard, 0f, 0.2f).setEase(LeanTweenType.linear); LeanTween.rotateY(RCard, 0f, 0.2f).setEase(LeanTweenType.linear); } else { LeanTween.rotateY(LCard, 180f, 0.2f).setEase(LeanTweenType.linear); LeanTween.rotateY(RCard, 180f, 0.2f).setEase(LeanTweenType.linear); } yield return(new WaitForSeconds(0.1f)); if (SceneChangeManager.SCENE.Level == 0) //색+모양 { RCardNum = Random.Range(0, 12); Percentage(); order.Add(RCardNum); LCard.GetComponent <Image>().sprite = OriginImage; //왼쪽 뒤집히고 모양 RCard.GetComponent <Image>().sprite = BackImage[RCardNum]; //오른쪽 새로운 모양 } else if (SceneChangeManager.SCENE.Level == 1) //모양조합 { RCardNum2 = Random.Range(0, 81); Percentage(); order.Add(RCardNum2); LCard.GetComponent <Image>().sprite = OriginImage; //왼쪽 뒤집히고 모양 RCard.GetComponent <Image>().sprite = BackImage2[RCardNum2]; //오른쪽 새로운 모양 } TouchOff.SetActive(false); }
private IEnumerator Opening() { isShow = true; TebakGambarController.Instance.flipped.Add(this); LeanTween.rotateY(gameObject, 90f, 0.25f); yield return(new WaitForSeconds(0.25f)); frontCard.SetActive(true); LeanTween.rotateY(gameObject, 0f, 0.25f); print("Open Card"); GetComponent <Button>().enabled = false; }
void finalMove() { LeanTween.moveLocal(bee, finalrunBezier, 4.0f).setOrientToPath(true); LeanTween.rotateY(beeRotationParent, 150, 0.5f).setOnComplete( () => { LeanTween.rotateY(beeRotationParent, 210, 0.25f).setLoopPingPong(8).setOnComplete( () => { beeRotationParent.transform.Rotate(new Vector3(0, 180, 0)); kickCircle(); }); }); }
public IEnumerator CardMove() //카드 이동함수 { ChangeNum++; TouchOff.SetActive(true); //초기화부분 //다시 시작되면 RCard의 이미지가 LCard에 복사되서 왼쪽으로 가고 RCard는 새로 랜덤 LCard.transform.position = CardOriginPosition; //처음포지션으로 가야지 LCard.GetComponent <Image>().sprite = RCard.GetComponent <Image>().sprite; //R카드 복사 RCard.GetComponent <Image>().sprite = OriginImage; //다시 왼쪽으로 가고 오른쪽 카드는 랜덤 SoundManager.instance.CardPlace(); LeanTween.move(LCard, Target.transform.position, 1.0f).setEase(LeanTweenType.easeOutQuint); yield return(new WaitForSeconds(1.0f)); if (LCard.transform.eulerAngles.y == 180f || LCard.transform.eulerAngles.y == -180f) //카드 회전 설정 { LeanTween.rotateY(LCard, 0f, 0.2f).setEase(LeanTweenType.linear); LeanTween.rotateY(RCard, 0f, 0.2f).setEase(LeanTweenType.linear); } else { LeanTween.rotateY(LCard, 180f, 0.2f).setEase(LeanTweenType.linear); LeanTween.rotateY(RCard, 180f, 0.2f).setEase(LeanTweenType.linear); } yield return(new WaitForSeconds(0.1f)); RCardNum = Random.Range(0, 12); order.Add(RCardNum); LCard.GetComponent <Image>().sprite = OriginImage; //왼쪽 뒤집히고 모양 RCard.GetComponent <Image>().sprite = BackImage[RCardNum]; //오른쪽 새로운 모양 TouchOff.SetActive(false); if (correct == 1 && TwoBack == 0) { yield return(new WaitForSeconds(0.5f)); StartCoroutine("CardMove"); TwoBack++; } else { GameObject.Find("Canvas").transform.Find("TutorialPanel").gameObject.SetActive(true); Tuto[4].SetActive(false); Tuto[5].SetActive(false); Tuto[3].SetActive(true); } }
IEnumerator Move() { //yield return new WaitForSeconds(0.4f); this.gameObject.transform.LookAt(BonusPos[count]); LeanTween.moveLocal(this.gameObject, BonusPos[count].position, 0.8f); count++; yield return(new WaitForSeconds(0.8f)); points.SetActive(true); this.gameObject.transform.LookAt(BonusPos[count]); LeanTween.moveLocal(this.gameObject, BonusPos[count].position, 0.8f); yield return(new WaitForSeconds(0.4f)); count++; yield return(new WaitForSeconds(0.4f)); this.gameObject.transform.LookAt(BonusPos[count]); LeanTween.moveLocal(this.gameObject, BonusPos[count].position, 0.8f); yield return(new WaitForSeconds(0.4f)); count++; yield return(new WaitForSeconds(0.4f)); this.gameObject.transform.LookAt(BonusPos[count]); LeanTween.moveLocal(this.gameObject, BonusPos[count].position, 0.8f); yield return(new WaitForSeconds(0.4f)); count++; yield return(new WaitForSeconds(0.4f)); this.gameObject.transform.LookAt(BonusPos[count]); LeanTween.moveLocal(this.gameObject, BonusPos[count].position, 0.8f); yield return(new WaitForSeconds(0.4f)); count++; yield return(new WaitForSeconds(0.4f)); this.gameObject.transform.LookAt(BonusPos[count]); LeanTween.moveLocal(this.gameObject, BonusPos[count].position, 0.8f); yield return(new WaitForSeconds(0.4f)); points.SetActive(false); count++; yield return(new WaitForSeconds(0.4f)); ConfettiPlay(); LeanTween.rotateY(Player.gameObject, 180, 0.5f); yield return(new WaitForSeconds(0.5f)); Player.SetTrigger("dance"); }
public void MakeCharacterFaceToCamera() { CCAction.Stop(m_CurRole.gameObject); Vector3 direction = Camera.main.transform.position - m_CurRole.transform.position; direction.y = 0; Quaternion rotation = Quaternion.LookRotation(direction); float angle = Quaternion.Angle(m_CurRole.transform.rotation, rotation); if (angle > 0.1f) { LeanTween.rotateY(m_CurRole.gameObject, rotation.eulerAngles.y, angle / 360).setEase(LeanTweenType.easeOutQuad); } }
private IEnumerator WaitAndSpawn(float waitTime) { yield return(new WaitForSeconds(waitTime)); for (int i = 0; i < spawners.Length; i++) { GameObject gameObject; gameObject = (GameObject)Instantiate(weapons[Random.Range(0, 4)], spawners[i].transform.position, Quaternion.identity); gameObject.transform.SetParent(GameObject.FindGameObjectWithTag("Cart").transform); gameObject.transform.localScale = new Vector3(1.7f, 1.5f, 1.5f); LeanTween.rotateX(gameObject, -75, 1f).setEaseInOutSine(); LeanTween.rotateY(gameObject, 80, 1f).setEaseInOutSine(); LeanTween.rotateZ(gameObject, -70, 1f).setEaseInOutSine(); } }
public void Open(bool inWards) { if (animating) { return; } animating = true; //play doorbell sound AudioManager.instance?.Play3DSound(AudioEffect.doorbell, 1, transform.position); openTween = LeanTween.rotateY(gameObject, startAngle + maxAngle * (inWards ? -1 : 1), openTime); openTween.setEase(LeanTweenType.easeOutCirc); openTween.setOnComplete(() => { Close(); }); }
private IEnumerator ShowTheImageFirst(GameObject obj) { ObjectTebak ot = obj.GetComponent <ObjectTebak>(); ot.frontCard.SetActive(true); ot.GetComponent <Button>().enabled = false; yield return(new WaitForSeconds(1.5f)); LeanTween.rotateY(obj, 90f, 0.5f); yield return(new WaitForSeconds(0.5f)); ot.frontCard.SetActive(false); LeanTween.rotateY(obj, 0f, 0.5f); ot.GetComponent <Button>().enabled = true; }