public void InitCameraParams()
    {
        CamRatio.SetupCamera(this._camera, 0f);
        GameObject   gameObject = GameObject.FindGameObjectWithTag("SpawnPoint");
        CameraParams component  = gameObject.GetComponent <CameraParams>();

        this._camera.fieldOfView = component.cameraFov;
        this._cameraConfiner     = SimpleConfiner.Create(component);
    }
示例#2
0
 public static IConfineCamera Create(Component c)
 {
     if (!c)
     {
         return(null);
     }
     if (c is CameraParams)
     {
         CameraParams   cameraParams   = c as CameraParams;
         SimpleConfiner simpleConfiner = new SimpleConfiner();
         simpleConfiner.rangeX    = cameraParams.rangeX;
         simpleConfiner.rangeZ    = cameraParams.rangeZ;
         simpleConfiner.rangeX1   = cameraParams.rangeX;
         simpleConfiner.rangeZ1   = cameraParams.rangeZ;
         simpleConfiner.rangeX2   = cameraParams.rangeX;
         simpleConfiner.rangeZ2.x = cameraParams.rangeZ.x - 5f;
         simpleConfiner.rangeZ2.y = cameraParams.rangeZ.y - 5f;
         return(simpleConfiner);
     }
     return(null);
 }