如何使用Unity的Cardboard SDK for Android进行放大/缩小

时间:2017-02-17 18:28:49

标签: android unity3d zoom google-cardboard fieldofview

我正在使用Unity3D构建Cardboard应用程序,该应用程序应该能够使用磁性触发器进行放大/缩小。 在StereoController.cs中,更改了MatchMonoFOV = 1和MatchByZoom = 1。 然后我用这个方法创建了一个脚本,仅用于放大:

library(shiny)
library(dplyr)
library(DT)

data=as.matrix(cbind(names=letters[1:10], position=1:10, val=runif(10)))

ui <- fluidPage(
  sidebarPanel(
    textInput("name",label = "name", value = "")
  ),

  mainPanel(

    dataTableOutput("res"))
)

server <- function (input, output) { 

  ## function to turn txt into link --------------
  ToLink <- function(txt,link) {
    paste0('<a href=',link,">",txt,'</a>')
  }


  ## form table ---------------------
  res.table <- reactive({
    req(input$name !="") # to make sure input$name in not empty

    res <- data %>% 
      data.frame(stringsAsFactors = F) %>% 
      filter(names==input$name) %>% 
      select(names,position)

    # turn the names into link/s, if more than one value, provide a vector of urls
    res$names <- ToLink(res$names,"https://www.google.com") #Use ur url/s

    return(res)
  })

  ## render datatable -------------------------
  output$res=renderDataTable({

    res.table()

  }, escape = FALSE # make sure escape=FALSE
  )}

shinyApp(ui = ui, server = server)

不幸的是,这只适用于UnityEditor,但不适用于Headset。 各种建议都会非常感激!

0 个答案:

没有答案