Exemplo n.º 1
0
    void OnFinishMoveCameraByRotation()
    {
        Transform        tran_0 = ZiYouYiDongCamPtahTran.GetChild(MarkCurrentIndex);
        Transform        tran_1 = ZiYouYiDongCamPtahTran.GetChild(MarkCurrentIndex + 1);
        CartoonShootMark mark   = tran_0.GetComponent <CartoonShootMark>();

        Transform[] path = new Transform[2];

        tran_0.position = MainCamTran.position;
        tran_0.rotation = MainCamTran.rotation;
        path[0]         = tran_0;
        path[1]         = tran_1;
        iTween.MoveTo(CameraObj, iTween.Hash("path", path,
                                             "speed", mark.MoveSpeed,
                                             "orienttopath", true,
                                             "easeType", iTween.EaseType.linear,
                                             "oncomplete", "OnFinishMoveCameraByZiYouYiDongPath"));
    }
Exemplo n.º 2
0
    void MoveCameraByZiYouYiDongPath()
    {
        if (CartoonShootPathScript.iTweenEventIndex != -1)
        {
            ITweenEventArray[CartoonShootPathScript.iTweenEventIndex].enabled = true;
        }
        else
        {
            if (CartoonShootPathScript.IsMoveByPathSpeed)
            {
                iTweenEvent itweenScript = CartoonShootPathScript.ITweenEventCom;
                if (itweenScript != null)
                {
                    itweenScript.enabled = true;
                }
                else
                {
                    if (ZiYouYiDongCamPtahTran.childCount <= 1)
                    {
                        return;
                    }

                    List <Transform> nodes = new List <Transform>(ZiYouYiDongCamPtahTran.GetComponentsInChildren <Transform>())
                    {
                    };
                    nodes.Remove(ZiYouYiDongCamPtahTran);
                    if (CartoonShootPathScript.IsAimObj)
                    {
                        iTween.MoveTo(CameraObj, iTween.Hash("path", nodes.ToArray(),
                                                             "speed", CartoonShootPathScript.MoveSpeed,
                                                             "looktarget", CartoonShootPathScript.AimTran,
                                                             "looktime", CartoonShootPathScript.LookTime,
                                                             "easeType", iTween.EaseType.linear,
                                                             "oncomplete", "OnFinishMoveCameraByZiYouYiDongPath"));
                    }
                    else
                    {
                        iTween.MoveTo(CameraObj, iTween.Hash("path", nodes.ToArray(),
                                                             "speed", CartoonShootPathScript.MoveSpeed,
                                                             "orienttopath", true,
                                                             "easeType", iTween.EaseType.linear,
                                                             "oncomplete", "OnFinishMoveCameraByZiYouYiDongPath"));
                    }
                }
            }
            else
            {
                Transform        tran_0 = ZiYouYiDongCamPtahTran.GetChild(MarkCurrentIndex);
                Transform        tran_1 = ZiYouYiDongCamPtahTran.GetChild(MarkCurrentIndex + 1);
                CartoonShootMark mark   = tran_0.GetComponent <CartoonShootMark>();
                Transform[]      path   = new Transform[2];

                tran_0.position = MainCamTran.position;
                tran_0.rotation = MainCamTran.rotation;
                path[0]         = tran_0;
                path[1]         = tran_1;
                if (CartoonShootPathScript.IsAimObj)
                {
                    iTween.MoveTo(CameraObj, iTween.Hash("path", path,
                                                         "speed", mark.MoveSpeed,
                                                         "looktarget", CartoonShootPathScript.AimTran,
                                                         "looktime", CartoonShootPathScript.LookTime,
                                                         "easeType", iTween.EaseType.linear,
                                                         "oncomplete", "OnFinishMoveCameraByZiYouYiDongPath"));
                }
                else
                {
                    iTween.LookTo(CameraObj, iTween.Hash("path", path,
                                                         "looktarget", tran_1,
                                                         "time", mark.LookTime,
                                                         "easeType", iTween.EaseType.linear,
                                                         "oncomplete", "OnFinishMoveCameraByRotation"));
                }
            }
        }
    }