如何更改Google VR视图全屏图标的背景颜色?

时间:2018-07-28 06:15:59

标签: javascript jquery google-vr google-vr-sdk

这是您看到全屏图标的图像

var product_id: String? 

override func viewDidLoad() {
    super.viewDidLoad()

product_id = "myPurchase"

if !(UserDefaults.standard.bool(forKey: "purchased")){
    if (SKPaymentQueue.canMakePayments()) {
        let productID:NSSet = NSSet(object: self.product_id!);
        let productsRequest:SKProductsRequest = SKProductsRequest(productIdentifiers: productID as! Set<String>);
        productsRequest.delegate = self;
        productsRequest.start();
        print("Fetching Products");
    }else{
        print("Can't make purchases");
    }
}
}

func productsRequest (_ request: SKProductsRequest, didReceive response: SKProductsResponse) {

        let count : Int = response.products.count
        if (count>0) {
            let validProduct: SKProduct = response.products[0] as SKProduct
            if (validProduct.productIdentifier == self.product_id) {
                buyProduct(product: validProduct);
            } else {
                print(validProduct.productIdentifier)
            }
        } else {
            print("nothing")
        }
    }

    func buyProduct(product: SKProduct){
        price = localizedPriceForProduct(product)
        //price2 = localizedPriceForProduct(product)
    }

    func localizedPriceForProduct(_ product:SKProduct) -> String {
        let priceFormatter = NumberFormatter()
        priceFormatter.formatterBehavior = NumberFormatter.Behavior.behavior10_4
        priceFormatter.numberStyle = NumberFormatter.Style.currency
        priceFormatter.locale = product.priceLocale
        return priceFormatter.string(from: product.price)!
    }
window.addEventListener('load', onVrViewLoad);

      function onVrViewLoad() {
        var vrView = new VRView.Player('#vrview', {
          image: 'https://cors-anywhere.herokuapp.com/http://d305uc8ofhou21.cloudfront.net/images/vrimage/vr_kitchen.jpg',
          width:'500px',
          height:'300px'});
      }

0 个答案:

没有答案