void FixedUpdate(){ if (GameController.GetInstance().intoRobot == true && GameController.GetInstance().CurrentPlayer == BallRobot) { if( GameController.GetInstance().ObjectTriggerID.GetComponent<RobotGameOver>().isAvail == true && BallRobot.GetComponent<PlayerControl>().isAvail == true && GameController.GetInstance().BallToRobot == true && GameController.GetInstance().IsRobot == false){ GameController.GetInstance().moveRight[0] = 0; GameController.GetInstance().moveLeft[0] = 0; //当前操作对象变更为小球接触到的有效机器人 GameController.GetInstance().CurrentPlayer = GameController.GetInstance().ObjectID; //被操作的机器人(玩家机器人)半透明状态还原 GameController.GetInstance().ObjectID.gameObject.GetComponent<tk2dSprite>().color = new Color(1f, 1f, 1f, 1.0f); //当前操作对象变的触发更为小球接触到的有效机器人的触发 GameController.GetInstance().CurrentPlayerTrigger = GameController.GetInstance().ObjectTriggerID; CurrentPlayerString = GameController.GetInstance().CurrentPlayer.name.Substring (start - 1, length); //小球不再接触到有效机器人 GameController.GetInstance().PlayerIsTriggered = false; MissingBall = Instantiate(MissingBallPlayer, BallRobot.gameObject.transform.position, Quaternion.identity) as GameObject; //小球被灭活,就消失了 BallRobot.gameObject.SetActive(false); //摄像机位置调整 Sequence BallAnim = new Sequence (new SequenceParms().OnComplete(ChangeRole)); if(GameController.GetInstance().CurrentPlayer.transform.position [0] > GameController.GetInstance().FollowedLeftLine && GameController.GetInstance().CurrentPlayer.transform.position [0] < GameController.GetInstance().FollowedRightLine){ BallAnim.Prepend(HOTween.To (GameObject.Find("Camera01").gameObject.transform, 0.3f,new TweenParms().Prop("position",new Vector3( GameController.GetInstance().CurrentPlayer.transform.position[0], GameController.GetInstance().CurrentPlayer.transform.position[1],-21.3f)))); }else if(GameController.GetInstance().CurrentPlayer.transform.position [0] < GameController.GetInstance().FollowedLeftLine){ BallAnim.Prepend(HOTween.To (GameObject.Find("Camera01").gameObject.transform, 0.3f,new TweenParms().Prop("position",new Vector3( GameController.GetInstance().FollowedLeftLine, GameController.GetInstance().CurrentPlayer.transform.position[1],-21.3f)))); }else if(GameController.GetInstance().CurrentPlayer.transform.position [0] > GameController.GetInstance().FollowedRightLine){ BallAnim.Prepend(HOTween.To (GameObject.Find("Camera01").gameObject.transform, 0.3f,new TweenParms().Prop("position",new Vector3( GameController.GetInstance().FollowedRightLine, GameController.GetInstance().CurrentPlayer.transform.position[1],-21.3f)))); } //小球附身时本体消失的动画 BallAnim.Insert(0,HOTween.To (MissingBall.gameObject.transform, 0.15f,new TweenParms().Prop("localScale", new Vector3(0.1f,1.5f,1f)))); BallAnim.Insert(0.1f,HOTween.To (MissingBall.gameObject.transform, 0.2f,new TweenParms().Prop("position", new Vector3(MissingBall.gameObject.transform.position[0],MissingBall.gameObject.transform.position[1]+2.3f,MissingBall.gameObject.transform.position[2])))); BallAnim.Insert(0.2f,HOTween.To (MissingBall.gameObject.GetComponent<tk2dSprite>(), 0.1f,new TweenParms().Prop("color", new Color(1,1,1,0)))); BallAnim.Play(); } } }
void AimAnim(){ Vector3 v1 = new Vector3 (0,0,179); Vector3 v2 = new Vector3 (0,0,-179); Sequence AimAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); AimAnim.Prepend(HOTween.To(WorkSpaceComponent [0].transform, 1, new TweenParms().Prop("rotation", v1))); AimAnim.Append(HOTween.To(WorkSpaceComponent [0].transform, 1, new TweenParms().Prop("rotation", v2))); AimAnim.Play ();//旋转瞄准镜动画 }
private int WorkNow = 0;//0是行走,1是边走边向右工作,2是只工作,3是边走边向左工作 //load界面的动画加载 // Use this for initialization void Start () { if (Global.GetInstance ().loadName == "Screen0101" && Application.loadedLevelName == "DemoLoading") { Aim01.SetActive (true); Goods01.GetComponent<GoodsInstantiate>().InstantiateGoods = true; G_01 = new Sequence (new SequenceParms ().Loops (-1, LoopType.Restart)); G_01.Prepend (HOTween.To (g_01.gameObject.transform.parent.gameObject.transform, 2, new TweenParms ().Prop ("rotation", new Vector3 (0, 0, 108)).Ease (EaseType.EaseOutQuart))); G_01.Insert (2,HOTween.To (g_01.gameObject.transform.parent.gameObject.transform, 2, new TweenParms ().Prop ("rotation", new Vector3 (0, 0, 0)).Ease (EaseType.EaseOutQuart))); G_01.Insert (2,HOTween.To (gameObject.transform, 0, new TweenParms ().Prop ("localScale", gameObject.transform.localScale).Ease (EaseType.EaseOutQuart))); G_01.Play(); } }
//摄像机初始时播放镜头推进放大动画 void Start () { GuardBody = transform.parent.transform.parent.gameObject.transform; if (isPrefab == 0) { //一般情况下a型号警卫的运动方式 Guard_a_Movement = new Sequence (new SequenceParms ().Loops (-1, LoopType.Restart)); Guard_a_Movement.Prepend (HOTween.To (GuardBody, time, new TweenParms ().Prop ("position", new Vector3 (GuardBody.position [0] - x, GuardBody.position [1], GuardBody.position [2])))); Guard_a_Movement.Append (HOTween.To (transform.parent.gameObject.transform, 2, new TweenParms ().Prop ("rotation", new Vector3 (0, 0, 108)).Ease (EaseType.EaseOutQuart))); Guard_a_Movement.Append (HOTween.To (GuardBody, time, new TweenParms ().Prop ("position", new Vector3 (GuardBody.position [0], GuardBody.position [1], GuardBody.position [2])))); Guard_a_Movement.Append (HOTween.To (transform.parent.gameObject.transform, 2, new TweenParms ().Prop ("rotation", new Vector3 (0, 0, 0)).Ease (EaseType.EaseOutQuart))); Guard_a_Movement.Play (); } }
//用于小球作为操作对象时遇到类型2警卫的GameOver结算 void OnTriggerStay(Collider IsRobotWork){ //如果遇到的警卫为类型2且当前操作对象为小球 if (IsRobotWork.CompareTag("guard-2b") && GameController.GetInstance().IsRobot == false) { if(JudgeOnce == true){ foreach (Transform child in IsRobotWork.transform.parent.transform.parent.transform) { //获得警卫的组件 LightComponent.Add (child.gameObject); } JudgeOnce = false; //新建警卫的HOTween补间动画 Sequence Guard02Alert = new Sequence (new SequenceParms().Loops(10,LoopType.Restart)); //警卫颜色闪烁 Guard02Alert.Prepend(HOTween.To (IsRobotWork.gameObject.GetComponent<tk2dSprite> (), 0.08f,new TweenParms().Prop("color", new Color (1f, 1f, 1f, 0.5f)))); Guard02Alert.Append(HOTween.To (IsRobotWork.gameObject.GetComponent<tk2dSprite> (), 0.08f,new TweenParms().Prop("color", new Color (1f, 1f, 1f, 1f)))); Guard02Alert.Play(); //计算粒子子弹发射角度 float ShootAngle01 = Vector3.Angle( new Vector3(100f,0f,0f), transform.position*100.0f-LightComponent[1].transform.position*100.0f) *-Mathf.Sign( Vector3.Cross( new Vector3(100f,0f,0f),transform.position*100.0f-LightComponent[1].transform.position*100.0f)[2]); LightComponent[1].transform.rotation = Quaternion.Euler(ShootAngle01,90,0); LightComponent[1].GetComponent<ParticleSystem>().Play(); if(Application.loadedLevelName != "DemoTech"){ gameObject.GetComponent<Rigidbody>().Sleep(); GetComponent<PlayerControl>().isAvail = false; //新建整体的HOTween补间动画 TweenParms Gameover = new TweenParms(); //颜色Aplaha通道渐变至255(即屏幕渐渐变黑) Gameover.Prop("color",new Color(1,1,1,1)); //回调函数GameOverScene Gameover.OnComplete(GameOverScene); HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2f, Gameover); }else{ if(gameObject.name == "BallRobot"){ JudgeOnce = true; gameObject.GetComponent<Rigidbody>().Sleep(); GetComponent<PlayerControl>().isAvail = false; GameController.GetInstance ().FilmMode = true; ButtonPause.GetComponent<UIButton> ().isEnabled = false; ButtonViewer.GetComponent<UIButton> ().isEnabled = false; TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。"; TweenParms Action03 = new TweenParms (); Action03.Prop ("position", new Vector3 (GameController.GetInstance().BallPosition [0], GameController.GetInstance().BallPosition [1], -21.3f)); Action03.Ease (EaseType.EaseOutQuart); HOTween.To (Camera01.transform, 2.0f, Action03); gameObject.transform.position = GameController.GetInstance().BallPosition; Robot01.transform.position = GameController.GetInstance().Robot01Position; StartCoroutine (Miss (1.5f)); } } } } //如果遇到了警卫3并且还被控制状态 if (IsRobotWork.CompareTag("guard-3") && GameController.GetInstance().IsRobot == false) { if (JudgeOnce == true) { foreach (Transform child in IsRobotWork.transform.parent.transform.parent.transform) { //获得警卫的组件 LightComponent.Add(child.gameObject); } JudgeOnce = false; //新建警卫的HOTween补间动画 Sequence Guard02Alert = new Sequence(new SequenceParms().Loops(10, LoopType.Restart)); //警卫颜色闪烁 Guard02Alert.Prepend(HOTween.To(IsRobotWork.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 0.5f)))); Guard02Alert.Append(HOTween.To(IsRobotWork.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 1f)))); Guard02Alert.Play(); //计算粒子子弹发射角度 float ShootAngle01 = Vector3.Angle( new Vector3(100f, 0f, 0f), transform.position * 100.0f - LightComponent[1].transform.position * 100.0f) * -Mathf.Sign( Vector3.Cross( new Vector3(100f, 0f, 0f), transform.position * 100.0f - LightComponent[1].transform.position * 100.0f)[2]); LightComponent[1].transform.rotation = Quaternion.Euler(ShootAngle01, 90, 0); LightComponent[1].GetComponent<ParticleSystem>().Play(); if (Application.loadedLevelName != "DemoTech") { GetComponent<PlayerControl>().isAvail = false; //新建整体的HOTween补间动画 TweenParms Gameover = new TweenParms(); //颜色Aplaha通道渐变至255(即屏幕渐渐变黑) Gameover.Prop("color", new Color(1, 1, 1, 1)); //回调函数GameOverScene Gameover.OnComplete(GameOverScene); HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2f, Gameover); } else { if (gameObject.name == "BallRobot") { JudgeOnce = true; gameObject.GetComponent<Rigidbody>().Sleep(); GetComponent<PlayerControl>().isAvail = false; GameController.GetInstance().FilmMode = true; ButtonPause.GetComponent<UIButton>().isEnabled = false; ButtonViewer.GetComponent<UIButton>().isEnabled = false; TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。"; TweenParms Action03 = new TweenParms(); Action03.Prop("position", new Vector3(GameController.GetInstance().BallPosition[0], GameController.GetInstance().BallPosition[1], -21.3f)); Action03.Ease(EaseType.EaseOutQuart); HOTween.To(Camera01.transform, 2.0f, Action03); gameObject.transform.position = GameController.GetInstance().BallPosition; Robot01.transform.position = GameController.GetInstance().Robot01Position; StartCoroutine(Miss(1.5f)); } } } } //如果遇到了二号电梯并且还被控制状态 if (IsRobotWork.CompareTag("elevator2") && GameController.GetInstance().IsRobot == false) { if (JudgeOnce == true) { if (Application.loadedLevelName != "DemoTech") { if(GameController.GetInstance().ShootOnce == true){ GameController.GetInstance().ShootOnce = false; Pi = Instantiate(BallPlayerDes, transform.position, Quaternion.identity) as GameObject; gameObject.GetComponent<tk2dSprite> ().color = new Color (1,1,1,0); gameObject.GetComponent<Rigidbody>().Sleep(); GameObject.Find("Camera01").transform.position = new Vector3(Pi.transform.position[0],Pi.transform.position[1],-23.1f); StartCoroutine(WaitDie(2.0f)); } GetComponent<PlayerControl>().isAvail = false; //新建整体的HOTween补间动画 TweenParms Gameover = new TweenParms(); //颜色Aplaha通道渐变至255(即屏幕渐渐变黑) Gameover.Prop("color", new Color(1, 1, 1, 1)); //回调函数GameOverScene Gameover.OnComplete(GameOverScene); HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2f, Gameover); } else { if (gameObject.name == "BallRobot") { JudgeOnce = true; gameObject.GetComponent<Rigidbody>().Sleep(); GetComponent<PlayerControl>().isAvail = false; GameController.GetInstance().FilmMode = true; ButtonPause.GetComponent<UIButton>().isEnabled = false; ButtonViewer.GetComponent<UIButton>().isEnabled = false; TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。"; TweenParms Action03 = new TweenParms(); Action03.Prop("position", new Vector3(GameController.GetInstance().BallPosition[0], GameController.GetInstance().BallPosition[1], -21.3f)); Action03.Ease(EaseType.EaseOutQuart); HOTween.To(Camera01.transform, 2.0f, Action03); gameObject.transform.position = GameController.GetInstance().BallPosition; Robot01.transform.position = GameController.GetInstance().Robot01Position; StartCoroutine(Miss(1.5f)); } } } } }
void Start(){ BG1 = GameObject.Find("BG1").gameObject.GetComponent<Rigidbody>(); BG2 = GameObject.Find("BG2").gameObject.GetComponent<Rigidbody>(); switch (Application.loadedLevelName) { case "DemoTech": GameController.GetInstance().CameraSizeFollowed = 7.1f;//摄像机跟随时的画面深度 GameController.GetInstance().CameraSizeAll = 12.95f;//摄像机在观察者模式时的画面深度 GameController.GetInstance().ViewerLeftLine = -23.70f;//摄像机在观察者模式时的左极限 GameController.GetInstance().ViewerRightLine = 51.00f;//摄像机在观察者模式时的右极限 GameController.GetInstance().ViewerUpLine = 7.00f;//摄像机在观察者模式时的上极限 GameController.GetInstance().ViewerDownLine = 6.80f;//摄像机在观察者模式时的下极限 GameController.GetInstance().FollowedLeftLine = -33.50f;//摄像机跟随时的左极限 GameController.GetInstance().FollowedRightLine = 60.00f;//摄像机跟随时的右极限 break; case "Screen0101": GameController.GetInstance().CameraSizeFollowed = 7.1f;//摄像机跟随时的画面深度 GameController.GetInstance().CameraSizeAll = 12.95f;//摄像机在观察者模式时的画面深度 GameController.GetInstance().ViewerLeftLine = -23.40f;//摄像机在观察者模式时的左极限 GameController.GetInstance().ViewerRightLine = 50.00f;//摄像机在观察者模式时的右极限 GameController.GetInstance().ViewerUpLine = 7.00f;//摄像机在观察者模式时的上极限 GameController.GetInstance().ViewerDownLine = 6.80f;//摄像机在观察者模式时的下极限 GameController.GetInstance().FollowedLeftLine = -33.50f;//摄像机跟随时的左极限 GameController.GetInstance().FollowedRightLine = 60.00f;//摄像机跟随时的右极限 break; case "Screen0102": GameController.GetInstance().CameraSizeFollowed = 7.1f;//摄像机跟随时的画面深度 GameController.GetInstance().CameraSizeAll = 12.95f;//摄像机在观察者模式时的画面深度 GameController.GetInstance().ViewerLeftLine = -23.60f;//摄像机在观察者模式时的左极限 GameController.GetInstance().ViewerRightLine = 34.70f;//摄像机在观察者模式时的右极限 GameController.GetInstance().ViewerUpLine = 14.00f;//摄像机在观察者模式时的上极限 GameController.GetInstance().ViewerDownLine = 6.80f;//摄像机在观察者模式时的下极限 GameController.GetInstance().FollowedLeftLine = -33.50f;//摄像机跟随时的左极限 GameController.GetInstance().FollowedRightLine = 60.00f;//摄像机跟随时的右极限 break; case "Screen0103": GameController.GetInstance().CameraSizeFollowed = 7.1f;//摄像机跟随时的画面深度 GameController.GetInstance().CameraSizeAll = 12.95f;//摄像机在观察者模式时的画面深度 GameController.GetInstance().ViewerLeftLine = -23.60f;//摄像机在观察者模式时的左极限 GameController.GetInstance().ViewerRightLine = 42.72f;//摄像机在观察者模式时的右极限 GameController.GetInstance().ViewerUpLine = 14.00f;//摄像机在观察者模式时的上极限 GameController.GetInstance().ViewerDownLine = 7.71f;//摄像机在观察者模式时的下极限 GameController.GetInstance().FollowedLeftLine = -33.50f;//摄像机跟随时的左极限 GameController.GetInstance().FollowedRightLine = 60.00f;//摄像机跟随时的右极限 break; case "Screen0104": GameController.GetInstance().CameraSizeFollowed = 7.1f;//摄像机跟随时的画面深度 GameController.GetInstance().CameraSizeAll = 12.95f;//摄像机在观察者模式时的画面深度 GameController.GetInstance().ViewerLeftLine = -23.60f;//摄像机在观察者模式时的左极限 GameController.GetInstance().ViewerRightLine = 42.72f;//摄像机在观察者模式时的右极限 GameController.GetInstance().ViewerUpLine = 14.00f;//摄像机在观察者模式时的上极限 GameController.GetInstance().ViewerDownLine = 7.79f;//摄像机在观察者模式时的下极限 GameController.GetInstance().FollowedLeftLine = -33.50f;//摄像机跟随时的左极限 GameController.GetInstance().FollowedRightLine = 60.00f;//摄像机跟随时的右极限 break; case "Screen0105": GameController.GetInstance().CameraSizeFollowed = 7.1f;//摄像机跟随时的画面深度 GameController.GetInstance().CameraSizeAll = 12.95f;//摄像机在观察者模式时的画面深度 GameController.GetInstance().ViewerLeftLine = -23.3f;//摄像机在观察者模式时的左极限 GameController.GetInstance().ViewerRightLine = 49.60f;//摄像机在观察者模式时的右极限 GameController.GetInstance().ViewerUpLine = 14.60f;//摄像机在观察者模式时的上极限 GameController.GetInstance().ViewerDownLine = -15.30f;//摄像机在观察者模式时的下极限 GameController.GetInstance().FollowedLeftLine = -33.50f;//摄像机跟随时的左极限 GameController.GetInstance().FollowedRightLine = 60.00f;//摄像机跟随时的右极限 break; case "Screen0201": GameController.GetInstance().CameraSizeFollowed = 7.1f;//摄像机跟随时的画面深度 GameController.GetInstance().CameraSizeAll = 12.95f;//摄像机在观察者模式时的画面深度 GameController.GetInstance().ViewerLeftLine = -23.3f;//摄像机在观察者模式时的左极限 GameController.GetInstance().ViewerRightLine = 43.21f;//摄像机在观察者模式时的右极限 GameController.GetInstance().ViewerUpLine = 6.44f;//摄像机在观察者模式时的上极限 GameController.GetInstance().ViewerDownLine = 7.510f;//摄像机在观察者模式时的下极限 GameController.GetInstance().FollowedLeftLine = -33.50f;//摄像机跟随时的左极限 GameController.GetInstance().FollowedRightLine = 60.00f;//摄像机跟随时的右极限 break; } Sequence CameraInitialization = new Sequence (); CameraInitialization.Prepend (HOTween.To (Camera01, 2, new TweenParms ().Prop ("orthographicSize", GameController.GetInstance().CameraSizeFollowed).Ease (EaseType.EaseOutQuart))); CameraInitialization.Insert (0, HOTween.To (Camera01.transform, 2, new TweenParms ().Prop ("position", new Vector3(WinTag.transform.position[0], WinTag.transform.position[1], Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart))); if(GameController.GetInstance().ViewerLeftLine - 3.0f <= GameController.GetInstance().CurrentPlayer.transform.position[0]){ CameraInitialization.Insert (3, HOTween.To (Camera01.transform, 2, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().CurrentPlayer.transform.position[0], GameController.GetInstance().CurrentPlayer.transform.position[1], Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart).OnComplete(CameraInitializationBack))); }else{ CameraInitialization.Insert (3, HOTween.To (Camera01.transform, 2, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().FollowedLeftLine, GameController.GetInstance().CurrentPlayer.transform.position[1], Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart).OnComplete(CameraInitializationBack))); } CameraInitialization.Play (); }
void Update(){ if(GameController.GetInstance().CameraInitializationState == true){ if(GameController.GetInstance().FilmMode == false){ if (GameController.GetInstance().intoViewMode == true && GameController.GetInstance().isCameraFollowed == true) { GameController.GetInstance().isCameraFollowed = false; Sequence AllView = new Sequence (); AllView.Prepend (HOTween.To (Camera01, 1, new TweenParms ().Prop ("orthographicSize", GameController.GetInstance().CameraSizeAll).Ease (EaseType.EaseOutQuart))); if(GameController.GetInstance().CurrentPlayer.transform.position [0] < GameController.GetInstance().ViewerLeftLine){ AllView.Insert (0, HOTween.To (Camera01.transform, 1, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().ViewerLeftLine+0.13f, 6.9f, Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart))); }else if(GameController.GetInstance().CurrentPlayer.transform.position [0] > GameController.GetInstance().ViewerRightLine) { AllView.Insert (0, HOTween.To (Camera01.transform, 1, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().ViewerRightLine-1f, 6.9f, Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart))); }else{ AllView.Insert (0, HOTween.To (Camera01.transform, 1, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().CurrentPlayer.transform.position[0], 6.9f, Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart))); } AllView.Play (); } else if(GameController.GetInstance().outViewMode == true && GameController.GetInstance().isCameraFollowed == false){ GameController.GetInstance().isCameraFollowed = true; Sequence CameraInitialization = new Sequence (); CameraInitialization.Prepend (HOTween.To (Camera01, 1, new TweenParms ().Prop ("orthographicSize", GameController.GetInstance().CameraSizeFollowed).Ease (EaseType.EaseOutQuart))); if(GameController.GetInstance().CurrentPlayer.transform.position [0] < GameController.GetInstance().ViewerLeftLine){ CameraInitialization.Insert (0, HOTween.To (Camera01.transform, 1, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().ViewerLeftLine+0.13f, GameController.GetInstance().CurrentPlayer.gameObject.transform.position[1], Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart))); }else if(GameController.GetInstance().CurrentPlayer.transform.position [0] > GameController.GetInstance().ViewerRightLine) { CameraInitialization.Insert (0, HOTween.To (Camera01.transform, 1, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().ViewerRightLine-1f, GameController.GetInstance().CurrentPlayer.gameObject.transform.position[1], Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart))); }else{ CameraInitialization.Insert (0, HOTween.To (Camera01.transform, 1, new TweenParms ().Prop ("position", new Vector3(GameController.GetInstance().CurrentPlayer.gameObject.transform.position[0], GameController.GetInstance().CurrentPlayer.gameObject.transform.position[1], Camera01.transform.position[2])).Ease (EaseType.EaseOutQuart))); } CameraInitialization.Play (); GameController.GetInstance().isCameraFollowed = true; } if(GameController.GetInstance().isCameraFollowed == false){ if(transform.position[0] > GameController.GetInstance().ViewerLeftLine && transform.position[0] < GameController.GetInstance().ViewerRightLine){ transform.position = new Vector3(transform.position[0]-GameController.GetInstance().deltaMove[0]*0.02f,transform.position[1],-21.3f); } if(transform.position[1] < GameController.GetInstance().ViewerUpLine && transform.position[1] > GameController.GetInstance().ViewerDownLine){ transform.position = new Vector3(transform.position[0],transform.position[1]-GameController.GetInstance().deltaMove[1]*0.02f,-21.3f); } if(transform.position[0] < GameController.GetInstance().ViewerLeftLine && GameController.GetInstance().deltaMove[0] < 0){ transform.position = new Vector3(transform.position[0]-GameController.GetInstance().deltaMove[0]*0.02f,transform.position[1],-21.3f); } if(transform.position[0] > GameController.GetInstance().ViewerRightLine && GameController.GetInstance().deltaMove[0] > 0){ transform.position = new Vector3(transform.position[0]-GameController.GetInstance().deltaMove[0]*0.02f,transform.position[1],-21.3f); } if(transform.position[1] < GameController.GetInstance().ViewerDownLine && GameController.GetInstance().deltaMove[1] < 0){ transform.position = new Vector3(transform.position[0],transform.position[1]-GameController.GetInstance().deltaMove[1]*0.02f,-21.3f); } if(transform.position[1] > GameController.GetInstance().ViewerUpLine && GameController.GetInstance().deltaMove[1] > 0){ transform.position = new Vector3(transform.position[0],transform.position[1]-GameController.GetInstance().deltaMove[1]*0.02f,-21.3f); } } } BG1.velocity = new Vector3(Camera01.velocity[0]/4,Camera01.velocity[1]/20,0); BG2.velocity = new Vector3(Camera01.velocity[0]/6,Camera01.velocity[1]/20,0); } }
//用于机器人作为操作对象时遇到类型1警卫的GameOver结算 void Update(){ //如果遇到类型1警卫且当前机器人不在工作 if(RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsTriggered == true && GetComponent<RobotTrigger>().IsActive == true){ if (RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_b == true && isWork == false) { RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_b = false; IsRobotWorks = RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.gameObject; if(JudgeOnce == true){ foreach (Transform child in RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.transform.parent.transform.parent.transform) { LightComponent.Add (child.gameObject); } //如果当前机器人为玩家机器人 if (gameObject.transform.parent.gameObject == GameController.GetInstance().CurrentPlayer && Application.loadedLevelName != "DemoTech") { JudgeOnce = false; isAvail = false; gameObject.transform.parent.gameObject.GetComponent<Rigidbody>().Sleep(); WaitNow(); //新建整体的HOTween补间动画 TweenParms Gameover = new TweenParms (); //新建当前机器人的HOTween补间动画 TweenParms DestoryRobotAnim = new TweenParms (); //颜色渐渐变黑 DestoryRobotAnim.Prop ("color", new Color (0, 0, 0, 1)); HOTween.To (gameObject.transform.parent.gameObject.GetComponent<tk2dSprite> (), 0.2f, DestoryRobotAnim); //颜色Aplaha通道渐变至255(即屏幕渐渐变黑) Gameover.Prop ("color", new Color (1, 1, 1, 1)); //回调函数GameOverScene Gameover.OnComplete (GameOverScene); HOTween.To (GameObject.Find ("over").gameObject.GetComponent<tk2dSprite> (), 2, Gameover); LightComponent[0].GetComponent<tk2dSprite>().SetSprite("红灯"); LightComponent[1].GetComponent<tk2dSprite>().SetSprite("红光"); StartCoroutine(WaitLight(2.0f)); //如果不是玩家机器人 }else if(gameObject.transform.parent.gameObject == GameController.GetInstance().CurrentPlayer && Application.loadedLevelName == "DemoTech" && GameController.GetInstance ().FilmMode == false){ JudgeOnce = true; BallRobot.SetActive(true); GameController.GetInstance ().FilmMode = true; ButtonPause.GetComponent<UIButton> ().isEnabled = false; ButtonViewer.GetComponent<UIButton> ().isEnabled = false; TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。"; for(Count = 0; Count < GameController.GetInstance ().WorkSpaceCollection.Count; Count++){ if(GameObject.Find ("FollowedObject").GetComponent<PlayerChange> ().CurrentPlayerString == GameController.GetInstance ().WorkSpaceCollection[Count].gameObject.name.Substring (start - 1, length)){ GameController.GetInstance ().WorkSpaceCollection[Count].GetComponent<AimCreater>().WorkSpaceComponent [0].SetActive (false); } } TweenParms Action03 = new TweenParms (); Action03.Prop ("position", new Vector3 (GameController.GetInstance().BallPosition [0], GameController.GetInstance().BallPosition [1], -21.3f)); Action03.Ease (EaseType.EaseOutQuart); HOTween.To (Camera01.transform, 2.0f, Action03); BallRobot.transform.position = GameController.GetInstance().BallPosition; Robot01.transform.position = GameController.GetInstance().Robot01Position; GameController.GetInstance().CurrentPlayer = BallRobot; GameController.GetInstance().CurrentPlayerTrigger = BallRobot; GameController.GetInstance().IsRobot = false; GameController.GetInstance().BallToRobot = true; StartCoroutine (Miss (1.5f)); }else if(gameObject.transform.parent.gameObject != GameController.GetInstance().CurrentPlayer && isDeath == false){ JudgeOnce = false; WaitNow(); gameObject.transform.parent.gameObject.GetComponent<Rigidbody>().Sleep(); //机器人失效,不能操作 isAvail = false; //当前tag标签改为NoRobot gameObject.tag = "NoRobot"; //新建当前机器人的HOTween补间动画 TweenParms DestoryRobotAnim = new TweenParms (); //颜色渐渐变黑 DestoryRobotAnim.Prop ("color", new Color (0, 0, 0, 1)); HOTween.To (gameObject.transform.parent.gameObject.GetComponent<tk2dSprite> (), 0.2f, DestoryRobotAnim); LightComponent[1].GetComponent<tk2dSprite>().SetSprite("红灯"); LightComponent[0].GetComponent<tk2dSprite>().SetSprite("红光"); if(gameObject.transform.parent.gameObject.name == "Robot_a1-Body-3-SP"){ GameController.GetInstance ().Robot02IsDie = true; } if(GameController.GetInstance ().FilmMode == true){ for(Count = 0; Count < GameController.GetInstance ().WorkSpaceCollection.Count; Count++){ if(MyName == GameController.GetInstance ().WorkSpaceCollection[Count].gameObject.name.Substring (start - 1, length)){ GameController.GetInstance ().WorkSpaceCollection[Count].GetComponent<AimCreater>().WorkSpaceComponent [0].SetActive (false); } } } StartCoroutine(WaitLight(2.0f)); } } } //如果遇到了警卫3并且还被控制状态 if (RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_c == true && gameObject.transform.parent.gameObject == GameController.GetInstance().CurrentPlayer && Application.loadedLevelName != "DemoTech"){ RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_c = false; if (JudgeOnce == true) { foreach (Transform child in RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.transform.parent.transform.parent.transform) { //获得警卫的组件 LightComponent.Add(child.gameObject); } JudgeOnce = false; //新建警卫的HOTween补间动画 Sequence Guard02Alert = new Sequence(new SequenceParms().Loops(10, LoopType.Restart)); //警卫颜色闪烁 Guard02Alert.Prepend(HOTween.To(RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 0.5f)))); Guard02Alert.Append(HOTween.To(RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 1f)))); Guard02Alert.Play(); //计算粒子子弹发射角度 float ShootAngle01 = Vector3.Angle( new Vector3(100f, 0f, 0f), transform.position * 100.0f - LightComponent[1].transform.position * 100.0f) * -Mathf.Sign( Vector3.Cross( new Vector3(100f, 0f, 0f), transform.position * 100.0f - LightComponent[1].transform.position * 100.0f)[2]); LightComponent[1].transform.rotation = Quaternion.Euler(ShootAngle01, 90, 0); LightComponent[1].GetComponent<ParticleSystem>().Play(); //新建整体的HOTween补间动画 TweenParms Gameover = new TweenParms(); //新建当前机器人的HOTween补间动画 TweenParms DestoryRobotAnim = new TweenParms(); //颜色渐渐变黑 DestoryRobotAnim.Prop("color", new Color(0, 0, 0, 1)); HOTween.To(gameObject.transform.parent.gameObject.GetComponent<tk2dSprite>(), 0.2f, DestoryRobotAnim); //颜色Aplaha通道渐变至255(即屏幕渐渐变黑) Gameover.Prop("color", new Color(1, 1, 1, 1)); //回调函数GameOverScene Gameover.OnComplete(GameOverScene); HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2, Gameover); } } } }
void WaitNow(){ isDeath = true; float ShootAngle01 = Vector3.Angle( new Vector3(100f,0f,0f), transform.position*100.0f-LightComponent[3].transform.position*100.0f) *-Mathf.Sign( Vector3.Cross( new Vector3(100f,0f,0f),transform.position*100.0f-LightComponent[3].transform.position*100.0f)[2]); LightComponent[3].transform.rotation = Quaternion.Euler(ShootAngle01,90,0); LightComponent[3].GetComponent<ParticleSystem>().Play(); //新建警卫的HOTween补间动画 Sequence Guard01Alert = new Sequence (new SequenceParms().Loops(10,LoopType.Restart)); //警卫颜色闪烁 Guard01Alert.Prepend(HOTween.To (IsRobotWorks.gameObject.GetComponent<tk2dSprite> (), 0.08f,new TweenParms().Prop("color", new Color (1f, 1f, 1f, 1f)))); Guard01Alert.Append(HOTween.To (IsRobotWorks.gameObject.GetComponent<tk2dSprite> (), 0.08f,new TweenParms().Prop("color", new Color (1f, 1f, 1f, 0.5f)))); Guard01Alert.Play(); }
void ViewerModeOut(){ if(isOutView == 0 && isView == 2){ TextAim.GetComponent<UILabel>().text = "点击此处的鹰眼开关,关闭鹰眼。"; OutViewTap = new Sequence (new SequenceParms().Loops(-1,LoopType.Restart)); isOutView = 1; Circle05.SetActive (true); OutViewTap.Prepend(HOTween.To (Circle05.transform, 1.2f, new TweenParms ().Prop ("localScale", new Vector3(1.2f,1.2f,0f)).Ease (EaseType.EaseInOutQuint))); OutViewTap.Insert (0,HOTween.To (Circle05.GetComponent<UISprite>(), 1.2f, new TweenParms ().Prop ("color", new Color(0.6f,0.6f,0.6f,0f)).Ease (EaseType.EaseInOutQuint))); OutViewTap.Play (); } if(GameController.GetInstance().outViewMode == true && isOutView == 1){ isOutView = 2; OutViewTap.Kill(); Circle05.SetActive(false); StartCoroutine(WaitFinal(2f)); } }
void ViewerMode(){ if(isView == 0 && isIntoView == 2){ TextAim.GetComponent<UILabel>().text = "手指在屏幕上拖动,来切换视野。"; isView = 1; Arrow03.SetActive (true); Arrow04.SetActive (true); ViewTap = new Sequence (new SequenceParms().Loops(-1,LoopType.Restart)); ViewTap.Prepend(HOTween.To (Arrow03.GetComponent<UISprite>(), 0.01f, new TweenParms ().Prop ("color", new Color(1f,1f,1f,1f)).Ease (EaseType.EaseInOutQuint))); ViewTap.Insert(0.01f,HOTween.To (Arrow03.GetComponent<UISprite>(), 1.2f, new TweenParms ().Prop ("color", new Color(1f,1f,1f,0f)).Ease (EaseType.EaseInOutQuint))); ViewTap.Insert(0.01f,HOTween.To (Arrow03.transform, 1.2f, new TweenParms ().Prop ("position", new Vector3(Arrow03.transform.position[0]-48f, Arrow03.transform.position[1], Arrow03.transform.position[2])).Ease (EaseType.EaseInOutQuint))); ViewTap.Insert(1.21f,HOTween.To (Arrow04.GetComponent<UISprite>(), 0.01f, new TweenParms ().Prop ("color", new Color(1f,1f,1f,1f)).Ease (EaseType.EaseInOutQuint))); ViewTap.Insert(1.22f,HOTween.To (Arrow04.GetComponent<UISprite>(), 1.2f, new TweenParms ().Prop ("color", new Color(1f,1f,1f,0f)).Ease (EaseType.EaseInOutQuint))); ViewTap.Insert(1.22f,HOTween.To (Arrow04.transform, 1.2f, new TweenParms ().Prop ("position", new Vector3(Arrow03.transform.position[0]+48f, Arrow04.transform.position[1], Arrow04.transform.position[2])).Ease (EaseType.EaseInOutQuint))); ViewTap.Play (); StartCoroutine(OutViewer(5f)); } }
void FingerDownSwipe(){ if(isDownSwiped == true && isDownOnce == false){ isDownOnce = true; isDownSwiped = false; Arrow02.SetActive (true); DownFingerSwipe = new Sequence (new SequenceParms().Loops(-1,LoopType.Restart)); DownFingerSwipe.Prepend(HOTween.To (Arrow02.GetComponent<UISprite>(), 0.01f, new TweenParms ().Prop ("color", new Color(1f,1f,1f,1f)).Ease (EaseType.EaseInOutQuint))); DownFingerSwipe.Insert(0.01f,HOTween.To (Arrow02.GetComponent<UISprite>(), 1.2f, new TweenParms ().Prop ("color", new Color(1f,1f,1f,0f)).Ease (EaseType.EaseInOutQuint))); DownFingerSwipe.Insert(0.01f,HOTween.To (Arrow02.transform, 1.2f, new TweenParms ().Prop ("position", new Vector3(Arrow02.transform.position[0], Arrow02.transform.position[1]-30f, Arrow02.transform.position[2])).Ease (EaseType.EaseInOutQuint))); DownFingerSwipe.Play (); } }
void Ball02Solve(){ if (isSolve == true && GameController.GetInstance ().PlayerIsTriggered == false && GameController.GetInstance ().AutoOpenDoor02 == false) { TextAim.GetComponent<UILabel>().text = "因此我们需要使用间谍小球的特殊技能:机械附着。"; BallRobot02.GetComponent<Rigidbody> ().AddForce (-GameController.GetInstance ().MovePower, 0, 0); Camera01.transform.position = new Vector3 (BallRobot02.transform.position [0], BallRobot02.transform.position [1], -21.3f); } else if (GameController.GetInstance ().AutoOpenDoor02 == true && GameController.GetInstance ().IsOnce == true) { GameController.GetInstance ().IsOnce = false; BallRobot02.GetComponent<Rigidbody> ().Sleep (); Door02.GetComponent<tk2dSpriteAnimator> ().Play ("DoorOpen"); StartCoroutine (WaitDoor (1.2f)); } else if (GameController.GetInstance ().PlayerIsTriggered == true && GameController.GetInstance ().ObjectID.name == "Robot_a1-Body-2-SP") { TextAim.GetComponent<UILabel>().text = "试着手指向上滑屏,附着进这个机器人体内!"; GameController.GetInstance ().CurrentPlayer = BallRobot02; isUpSwiped = true; isSolve = false; BallRobot02.GetComponent<Rigidbody> ().Sleep (); if (GameController.GetInstance ().intoRobot == true) { BallRobot02.gameObject.SetActive (false); MissingBall = Instantiate (MissingBallPlayer, BallRobot02.gameObject.transform.position, Quaternion.identity) as GameObject; Sequence BallAnim = new Sequence (new SequenceParms ()); BallAnim.Prepend (HOTween.To (Camera01.gameObject.transform, 0.3f, new TweenParms ().Prop ("position", new Vector3 (Robot01.transform.position [0], Robot01.transform.position [1], -21.3f)))); BallAnim.Insert (0, HOTween.To (MissingBall.gameObject.transform, 0.15f, new TweenParms ().Prop ("localScale", new Vector3 (0.1f, 1.5f, 1f)))); BallAnim.Insert (0.1f, HOTween.To (MissingBall.gameObject.transform, 0.2f, new TweenParms ().Prop ("position", new Vector3 (MissingBall.gameObject.transform.position [0], MissingBall.gameObject.transform.position [1] + 2.3f, MissingBall.gameObject.transform.position [2])))); BallAnim.Insert (0.2f, HOTween.To (MissingBall.gameObject.GetComponent<tk2dSprite> (), 0.1f, new TweenParms ().Prop ("color", new Color (1, 1, 1, 0)))); BallAnim.Play (); //被操作的机器人(玩家机器人)半透明状态还原 GameController.GetInstance().ObjectID.gameObject.GetComponent<tk2dSprite>().color = new Color(1f, 1f, 1f, 1.0f); TweenParms Action05 = new TweenParms (); Action05.Prop ("position", new Vector3 (Robot01.transform.position [0], Robot01.transform.position [1], -21.3f)); Action05.Ease (EaseType.EaseOutQuart); HOTween.To (Camera01.transform, 0.3f, Action05); GameController.GetInstance ().CurrentPlayerTrigger = Robot01Trigger; GameController.GetInstance ().CurrentPlayerTrigger.GetComponent<WorkSpaceController>().isWorkSpacePlay = true; if( GameController.GetInstance().CurrentPlayerTrigger.GetComponent<WorkSpaceController>().isWorkSpacePlay == true){ GameController.GetInstance().CurrentPlayerTrigger.GetComponent<WorkSpaceController>().isWorkSpacePlay = false; GameController.GetInstance().CurrentPlayerTrigger.GetComponent<WorkSpaceController>().WorkSpaceControl(); } StartCoroutine (WaitRobot(0.8f)); } } }
void FingerUp(){ if(isUp == 0 && isLeft == 2){ isUp = 1; Circle03.SetActive (true); TextAim.GetComponent<UILabel>().text = "轻按上键小球向上跳跃"; UpFingerTap = new Sequence (new SequenceParms().Loops(-1,LoopType.Restart)); UpFingerTap.Prepend(HOTween.To (Circle03.transform, 1.2f, new TweenParms ().Prop ("localScale", new Vector3(1.2f,1.2f,0f)).Ease (EaseType.EaseInOutQuint))); UpFingerTap.Insert (0,HOTween.To (Circle03.GetComponent<UISprite>(), 1.2f, new TweenParms ().Prop ("color", new Color(0.6f,0.6f,0.6f,0f)).Ease (EaseType.EaseInOutQuint))); UpFingerTap.Play (); } if(GameController.GetInstance().moveUp[0] == 1 && isUp == 1){ isUp = 2; UpFingerTap.Kill(); DoorOpener01.SetActive(true); Circle03.SetActive(false); TextAim.GetComponent<UILabel>().text = "前进!目标:潜入敌方工厂设施!"; } }
void FingerLeft() { if(isLeft == 0 && isRight == 2){ isLeft = 1; Circle02.SetActive (true); TextAim.GetComponent<UILabel>().text = "按住左键向左移动"; LeftFingerTap = new Sequence (new SequenceParms().Loops(-1,LoopType.Restart)); LeftFingerTap.Prepend(HOTween.To (Circle02.transform, 1.2f, new TweenParms ().Prop ("localScale", new Vector3(1.2f,1.2f,0f)).Ease (EaseType.EaseInOutQuint))); LeftFingerTap.Insert (0,HOTween.To (Circle02.GetComponent<UISprite>(), 1.2f, new TweenParms ().Prop ("color", new Color(0.6f,0.6f,0.6f,0f)).Ease (EaseType.EaseInOutQuint))); LeftFingerTap.Play (); } if(GameController.GetInstance().moveLeft[0] == 1 && isLeft == 1){ isLeft = 2; LeftFingerTap.Kill(); Circle02.SetActive(false); } }
void Awake(){ //工作台动画列表 switch (AnimType) { case 0: v1 = new Vector3 (0,0,180); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation", v1))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation", v1))); break; case 1: v1 = new Vector3 (-0.78f, 0, 0); ComponentAnim = new Sequence (new SequenceParms ().Loops (-1, LoopType.Restart)); ComponentAnim.Prepend (HOTween.To (transform, 1.5f, new TweenParms ().Prop ("position",transform.position + v1).Ease (EaseType.Linear))); ComponentAnim.Append (HOTween.To (transform, 1.5f, new TweenParms ().Prop ("position", transform.position).Ease (EaseType.Linear))); break; case 2: v1 = new Vector3 (0,0,180); v2 = new Vector3 (0,0,180); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation", v1))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation", v2))); break; case 3: v1=new Vector3(0.23f,0,0); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 0.5f, new TweenParms().Prop("position", transform.position+v1).Ease(EaseType.Linear))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("position", transform.position).Ease(EaseType.Linear))); break; case 4: v1 = new Vector3 (-0.23f, 0, 0); ComponentAnim = new Sequence (new SequenceParms ().Loops (-1, LoopType.Restart)); ComponentAnim.Prepend (HOTween.To (transform, 0.5f, new TweenParms ().Prop ("position", transform.position + v1).Ease (EaseType.Linear))); ComponentAnim.Append (HOTween.To (transform, 0.5f, new TweenParms ().Prop ("position", transform.position).Ease (EaseType.Linear))); break; case 5: v1 = new Vector3 (0,0,180); v2 = new Vector3 (0,0,180); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation", v1))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation", v2))); break; case 6: v1 = new Vector3 (0,0,-45); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation",-v1).Ease(EaseType.EaseInBack))); ComponentAnim.Append(HOTween.To(transform, 2f, new TweenParms().Prop("position",transform.position))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation",new Vector3(0,0,0)).Ease(EaseType.EaseInBack))); break; case 7: v1 = new Vector3 (0,0,-45); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 0.5f, new TweenParms().Prop("position",transform.position))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation",-v1).Ease(EaseType.EaseInBack))); ComponentAnim.Append(HOTween.To(transform, 1f, new TweenParms().Prop("position",transform.position))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation",new Vector3(0,0,0)).Ease(EaseType.EaseInBack))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("position",transform.position))); break; case 8: v1 = new Vector3 (0,0,-45); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 1f, new TweenParms().Prop("position",transform.position))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation",-v1).Ease(EaseType.EaseInBack))); ComponentAnim.Append(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation",new Vector3(0,0,0)).Ease(EaseType.EaseInBack))); ComponentAnim.Append(HOTween.To(transform, 1f, new TweenParms().Prop("position",transform.position))); break; case 9: v1 = new Vector3(0,0.44f,0); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 1.5f, new TweenParms().Prop("position", transform.position+v1).Ease(EaseType.EaseInCirc))); ComponentAnim.Append(HOTween.To(transform, 1f, new TweenParms().Prop("position", transform.position).Ease(EaseType.Linear))); break; case 10: v1 = new Vector3 (0, 1.56f, 0); ComponentAnim = new Sequence (new SequenceParms ().Loops (-1, LoopType.Restart)); ComponentAnim.Prepend (HOTween. To (transform, 1.5f, new TweenParms ().Prop ("position", transform.position + v1).Ease (EaseType.EaseInCirc))); ComponentAnim.Append (HOTween.To (transform, 1f, new TweenParms ().Prop ("position", transform.position).Ease (EaseType.Linear))); break; case 12: v1 = new Vector3 (0,0,-60); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Yoyo)); ComponentAnim.Prepend(HOTween.To(transform, 0.5f, new TweenParms().Prop("rotation",v1).Ease(EaseType.Linear))); break; case 13: v1 = new Vector3 (0,0,0.0156f); ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 0.2f, new TweenParms().Prop("position",transform.position+v1))); break; case 14: ComponentAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart)); ComponentAnim.Prepend(HOTween.To(transform, 1.25f, new TweenParms().Prop("rotation",new Vector3(0,0,15)))); ComponentAnim.Append(HOTween.To(transform, 1.25f, new TweenParms().Prop("rotation",new Vector3(0,0,0)).Delay(0.5f))); break; } }