Esempio n. 1
0
 void StartVideo(string path) {
   currentVideoPath = path;
   currentSettingsPath = Path.Combine(Path.GetDirectoryName(path), Path.GetFileNameWithoutExtension(path) + ".viewSettings");
   if (System.IO.File.Exists(currentSettingsPath)) {
     string json = File.ReadAllText(currentSettingsPath, System.Text.Encoding.UTF8);
     ViewSettings newViewSettings = DeJson.Deserialize.To<ViewSettings>(json);
     viewSettings.Copy(newViewSettings);
     UpdateViewSettings(false);
   } else {
     string name = Path.GetFileNameWithoutExtension(path).ToLowerInvariant();
     if (name.Contains("over")) { viewSettings.layout = Layout.TopBottom; }
     if (name.Contains("bt")) { viewSettings.layout = Layout.BottomTop; }
     if (name.Contains("rl")) { viewSettings.layout = Layout.RightLeft; }
     if (name.Contains("lr")) { viewSettings.layout = Layout.LeftRight; }
     if (name.Contains("tb")) { viewSettings.layout = Layout.TopBottom; }
     if (name.Contains("sbs")) { viewSettings.layout = Layout.LeftRight; }
     if (name.Contains("360")) { viewSettings.fieldOfView = FieldOfView.View360; }
     if (name.Contains("half")) { viewSettings.fieldOfView = FieldOfView.View180; }
     if (name.Contains("180")) { viewSettings.fieldOfView = FieldOfView.View180; }
     if (name.Contains("360")) { viewSettings.fieldOfView = FieldOfView.View360; }
     if (name.Contains("f180")) { viewSettings.projectionType = ProjectionType.Fisheye; }
     if (name.Contains("vr180")) { viewSettings.projectionType = ProjectionType.Fisheye; }
     UpdateViewSettings();
   }
   videoWrapper.SetUrl("file://" + path.Replace('\\', '/'));
   nameElement.text = currentVideoPath;
   CmdPlay();
 }
Esempio n. 2
0
 public void Copy(ViewSettings src) {
   projectionType = src.projectionType;
   fieldOfView = src.fieldOfView;
   layout = src.layout;
   yFlip = src.yFlip;
   scale = src.scale;
 }
Esempio n. 3
0
 public void SetViewSettings(ViewSettings vs) {
   Material mat = applyToMaterial._material;
   mat.SetFloat("_Mapping", ProjectionTypeToMapping(vs.projectionType));
   Enable(mat, "_MAPPING_6_FRAMES_LAYOUT", vs.projectionType == ProjectionType.None);
   Enable(mat, "_MAPPING_LATITUDE_LONGITUDE_LAYOUT", vs.projectionType == ProjectionType.Equirectangular);
   Enable(mat, "_MAPPING_FISHEYE_LAYOUT", vs.projectionType == ProjectionType.Fisheye);
   mat.SetFloat("_ImageType", FieldOfViewToImageType(vs.fieldOfView));
   mat.SetFloat("_Layout", LayoutToLayout(vs.layout));
 }
Esempio n. 4
0
 public void SetViewSettings(ViewSettings vs)
 {
 }