Пример #1
0
    void CheckServerPortCamera()
    {
        switch (CameraType)
        {
        case PlayerTypeEnum.FeiJi:
            if (XkPlayerCtrl.GetInstanceFeiJi() == null)
            {
                if (XkPlayerCtrl.GetInstanceTanKe() != null)
                {
                    CloseCameraServer();
                    ServerPortCameraCtrl.GetInstanceTK().ActiveServerPortCamera();
                }
                return;
            }
            break;

        case PlayerTypeEnum.TanKe:
            if (XkPlayerCtrl.GetInstanceTanKe() == null)
            {
                if (XkPlayerCtrl.GetInstanceFeiJi() != null)
                {
                    CloseCameraServer();
                    ServerPortCameraCtrl.GetInstanceFJ().ActiveServerPortCamera();
                }
                return;
            }
            break;
        }
    }
Пример #2
0
    public static void RandOpenServerPortCamera()
    {
//		bool isTestTK = false;
//		if (isTestTK) {
//			ServerPortCameraCtrl.GetInstanceTK().ActiveServerPortCamera();
//			return;
//		}

        int randVal = Random.Range(0, 100) % 2;

        if (randVal == 0)
        {
            CountTK = 0;
            CountFJ++;
            if (CountFJ > 2)
            {
                CountFJ = 0;
                CountTK++;
                ServerPortCameraCtrl.GetInstanceTK().ActiveServerPortCamera();
                return;
            }
            ServerPortCameraCtrl.GetInstanceFJ().ActiveServerPortCamera();
        }
        else
        {
            CountFJ = 0;
            CountTK++;
            if (CountTK > 2)
            {
                CountTK = 0;
                CountFJ++;
                ServerPortCameraCtrl.GetInstanceFJ().ActiveServerPortCamera();
                return;
            }
            ServerPortCameraCtrl.GetInstanceTK().ActiveServerPortCamera();
        }
    }
Пример #3
0
    public void SmothMoveCamera()
    {
        if (XKPlayerHeTiData.IsActiveHeTiPlayer)
        {
            if (PlayerSt == PlayerTypeEnum.FeiJi || PlayerSt == PlayerTypeEnum.TanKe)
            {
                this.enabled = false;
                return;
            }
        }

        if (CameraParent == null)
        {
            return;
        }

        if (PlayerScript.PlayerSt == PlayerTypeEnum.FeiJi ||
            PlayerScript.PlayerSt == PlayerTypeEnum.CartoonCamera)
        {
            if (Vector3.Distance(CameraTran.position, CameraParent.position) > 30f)
            {
                CameraTran.position = CameraParent.position;
                CameraTran.rotation = CameraParent.rotation;
            }
            else
            {
//				CameraTran.position = Vector3.Lerp(CameraTran.position, CameraParent.position, Time.deltaTime);
                CameraTran.position = Vector3.Lerp(CameraTran.position, CameraParent.position, GenZongCamPosVal);
            }
        }
        else
        {
            if (!CameraShake.IsCameraShake)
            {
                //CameraTran.position = CameraParent.position;
                if (Vector3.Distance(CameraTran.position, CameraParent.position) > 30f)
                {
                    CameraTran.position = CameraParent.position;
                    CameraTran.rotation = CameraParent.rotation;
                }
                else
                {
                    CameraTran.position = Vector3.Lerp(CameraTran.position, CameraParent.position, Time.deltaTime);
                }
            }
        }
        SmothChangeCameraRot();

        if (PlayerScript.PlayerSt == PlayerTypeEnum.FeiJi)
        {
            if (ServerPortCameraCtrl.GetInstanceFJ() != null)
            {
                ServerPortCameraCtrl.GetInstanceFJ().CheckCameraFollowTran();
            }
        }
        else if (PlayerScript.PlayerSt == PlayerTypeEnum.TanKe)
        {
            if (ServerPortCameraCtrl.GetInstanceTK() != null)
            {
                ServerPortCameraCtrl.GetInstanceTK().CheckCameraFollowTran();
            }
        }
    }