IEnumerator BeginToRotate() { MiniItween mm = MiniItween.RotateTo(this.gameObject, new Vector3(gameObject.transform.localRotation.x - 60.0f, 0.0f, 0.0f), 2.0f); mm.myDelegateFuncWithObject += _mm; yield return(null); }
public void SetFinalPos() { if(key)return; MiniItween m = MiniItween.MoveTo(gameObject, CradSystemFx.GetInstance().mPetBoxPos, 0.4f); MiniItween.ScaleTo(gameObject, new Vector3(0,0,0), 0.4f); MiniItween.RotateTo(gameObject, Quaternion.Euler(new Vector3(0,180,0)), 1.5f); m.myDelegateFuncWithObject += SetFinalPos; }
//如果多出来的区域,要滑动回去 //Vector3 ResetPos1 = new Vector3(28.07034f,0,20.4f); // Vector3 ResetPos2 = new Vector3(25.13108f,0,30.87951f); // Vector3 ResetPos3 =new Vector3(30.11301f,0,41.37781f); // Vector3 ResetPos4 = new Vector3(30f,0,30f); private bool SwipToMin() { Vector3 curAngle = transform.rotation.eulerAngles; bool result = false; if (curAngle.x > MAX_NEAR_X && curAngle.z > MAX_NEAR_Z) { MiniItween.RotateTo(gameObject, new Vector3(MAX_NEAR_X, 0, MAX_NEAR_Z), BACKTIME); //MiniItween.RotateTo(gameObject, ResetPos3, BACKTIME); result = true; } else if (curAngle.x > MAX_NEAR_X && curAngle.z < MIN_NEAR_Z) { //MiniItween.RotateTo(gameObject, ResetPos1, BACKTIME); MiniItween.RotateTo(gameObject, new Vector3(MAX_NEAR_X, 0, MIN_NEAR_Z), BACKTIME); result = true; } else if (curAngle.x < MIN_NEAR_X && curAngle.z < MIN_NEAR_Z) { //MiniItween.RotateTo(gameObject, ResetPos1, BACKTIME); MiniItween.RotateTo(gameObject, new Vector3(MIN_NEAR_X, 0, MIN_NEAR_Z), BACKTIME); result = true; } else if (curAngle.x < MIN_NEAR_X && curAngle.z > MAX_NEAR_Z) { //MiniItween.RotateTo(gameObject, ResetPos3, BACKTIME); MiniItween.RotateTo(gameObject, new Vector3(MIN_NEAR_X, 0, MAX_NEAR_Z), BACKTIME); result = true; } else if (curAngle.x > MAX_NEAR_X) { MiniItween.RotateTo(gameObject, new Vector3(MAX_NEAR_X, 0, curAngle.z), BACKTIME); //MiniItween.RotateTo(gameObject, ResetPos4, BACKTIME); result = true; } else if (curAngle.x < MIN_NEAR_X) { MiniItween.RotateTo(gameObject, new Vector3(MIN_NEAR_X, 0, curAngle.z), BACKTIME); //MiniItween.RotateTo(gameObject, ResetPos2, BACKTIME); result = true; } else if (curAngle.z > MAX_NEAR_Z) { //MiniItween.RotateTo(gameObject, ResetPos3, BACKTIME); MiniItween.RotateTo(gameObject, new Vector3(curAngle.x, 0, MAX_NEAR_Z), BACKTIME); result = true; } else if (curAngle.z < MIN_NEAR_Z) { //MiniItween.RotateTo(gameObject, ResetPos1, BACKTIME); MiniItween.RotateTo(gameObject, new Vector3(curAngle.x, 0, MIN_NEAR_Z), BACKTIME); result = true; } return(result); }
IEnumerator DoRotate(float delayTime, Vector3 v3, float animTime, MiniItween.EasingType animType, bool RotSelf) { yield return(new WaitForSeconds(delayTime)); if (RotSelf) { MiniItween.RotateTo(this.gameObject, v3 + v3_OriginRotation, animTime, animType, false); } else { MiniItween.RotateTo(this.gameObject, v3 + v3_OriginRotation, animTime, animType, true); } }
public void Rotate(bool right) { if (right) { Quaternion to = Quaternion.Euler(new Vector3(0, NowRotation.y + angel, 0)); MiniItween.RotateTo(StageOBJ, to, time); } else { Quaternion to = Quaternion.Euler(new Vector3(0, NowRotation.y - angel, 0)); MiniItween.RotateTo(StageOBJ, to, time); } }
/// <summary> /// 翻转动画,可以使用技能 /// </summary> /// <returns>The animation.</returns> IEnumerator ShowAnimationOpen(int skillIconId, int NuQi) { Vector3 Quart = new Vector3(0f, 90f, 0f); Vector3 Half = new Vector3(0f, 180f, 0f); //播放声效 Core.Data.soundManager.SoundFxPlay(SoundFx.Btn2); //播放特效 goPartExplore.gameObject.SetActive(true); //先放大 MiniItween.ScaleTo(Icon_BG.gameObject, Min_Scale, Scale_Time, ScaleType); yield return(new WaitForSeconds(Scale_Time)); //再旋转 MiniItween.RotateTo(Icon_BG.gameObject, Quart, Half_Rotate_Time); yield return(new WaitForSeconds(Half_Rotate_Time)); // 换贴图 Icon_BG.spriteName = "nuqijizhengmian"; //开始显示技能图标 Icon.transform.localScale = Min_Scale; Icon.transform.localRotation = Quaternion.Euler(-Quart); Icon.gameObject.SetActive(true); // Icon.spriteName = skillIconId.ToString(); Icon.gameObject.GetComponent <UIButton> ().normalSprite = skillIconId.ToString(); txtPoint.text = NuQi.ToString(); //再次旋转90° MiniItween.RotateTo(Icon_BG.gameObject, Half, Half_Rotate_Time); MiniItween.RotateTo(Icon.gameObject, Vector3.zero, Half_Rotate_Time); yield return(new WaitForSeconds(Half_Rotate_Time)); //显示粒子效果 goParticle.gameObject.SetActive(true); //再次缩小回去 MiniItween.ScaleTo(Icon_BG.gameObject, Vector3.one, Scale_Time, ScaleType); MiniItween.ScaleTo(Icon.gameObject, Vector3.one, Scale_Time, ScaleType); yield return(new WaitForSeconds(Scale_Time)); //震动 Core.Data.soundManager.SoundFxPlay(SoundFx.Btn3); MiniItween.Shake(gameObject, ShakeVec, Shake_Time, MiniItween.EasingType.EaseOutCirc); //goPoint.SetActive(true); //1S后消除 Invoke("hideExplore", 1f); }
/// <summary> /// 翻转动画,不可以使用技能 /// </summary> /// <returns>The animation close.</returns> IEnumerator ShowAnimationClose() { Vector3 Quart = new Vector3(0f, 90f, 0f); //先关闭消耗怒气点信息,再次关闭特效 //goPoint.SetActive(false); goParticle.gameObject.SetActive(false); Core.Data.soundManager.SoundFxPlay(SoundFx.Btn2); //先放大 MiniItween.ScaleTo(Icon_BG.gameObject, Min_Scale, Scale_Time, ScaleType); MiniItween.ScaleTo(Icon.gameObject, Min_Scale, Scale_Time, ScaleType); yield return(new WaitForSeconds(Scale_Time)); //再旋转 MiniItween.RotateTo(Icon_BG.gameObject, Quart, Half_Rotate_Time); MiniItween.RotateTo(Icon.gameObject, Quart, Half_Rotate_Time); yield return(new WaitForSeconds(Half_Rotate_Time)); //隐藏技能图标 Icon.gameObject.SetActive(false); Icon.transform.localRotation = Quaternion.Euler(Vector3.zero); Icon_BG.spriteName = "nuqijibeimian"; //再次旋转90° MiniItween.RotateTo(Icon_BG.gameObject, Vector3.zero, Half_Rotate_Time); yield return(new WaitForSeconds(Half_Rotate_Time)); //再次缩小回去 MiniItween.ScaleTo(Icon_BG.gameObject, Vector3.one, Scale_Time, ScaleType); yield return(new WaitForSeconds(Scale_Time)); //震动 Core.Data.soundManager.SoundFxPlay(SoundFx.Btn3); MiniItween.Shake(gameObject, ShakeVec, Shake_Time, MiniItween.EasingType.EaseOutCirc); }
void Return_Rot() { Vector3 Go_pos; if (Now_Pos_V3.z - Default_Rot.z < -L_Max) { Go_pos = Now_Pos_V3; Go_pos.z += BakeDistance; //结束旋转任务 MiniItween.DeleteType(this.gameObject, MiniItween.Type.Rotate); MiniItween.RotateTo(this.gameObject, Go_pos, BakeTime, MiniItween.EasingType.EaseInOutCubic); } else if (Now_Pos_V3.z - Default_Rot.z > R_Max) { Go_pos = Now_Pos_V3; Go_pos.z -= BakeDistance; //结束旋转任务 MiniItween.DeleteType(this.gameObject, MiniItween.Type.Rotate); MiniItween.RotateTo(this.gameObject, Go_pos, BakeTime, MiniItween.EasingType.EaseInOutCubic); } else if (Now_Pos_V3.x - Default_Rot.x < -U_Max) { Go_pos = Now_Pos_V3; Go_pos.x += BakeDistance; //结束旋转任务 MiniItween.DeleteType(this.gameObject, MiniItween.Type.Rotate); MiniItween.RotateTo(this.gameObject, Go_pos, BakeTime, MiniItween.EasingType.EaseInOutCubic); } else if (Now_Pos_V3.x - Default_Rot.x > D_Max) { Go_pos = Now_Pos_V3; Go_pos.x -= BakeDistance; //结束旋转任务 MiniItween.DeleteType(this.gameObject, MiniItween.Type.Rotate); MiniItween.RotateTo(this.gameObject, Go_pos, BakeTime, MiniItween.EasingType.EaseInOutCubic); } }