JavaScript运行时错误:对象不支持属性或方法'registerElement'
在文件中:... bower_components\polymer\polymer.js第11701行
document.registerElement('polymer-element', {prototype: prototype});
Run Code Online (Sandbox Code Playgroud)
我的凉亭:
{
"name": "Polymer",
"version": "0.0.0",
"main": "main",
"license": "MIT",
"private": true,
"dependencies": {
"polymer": "Polymer/polymer#~0.5.2",
"core-icons": "Polymer/core-icons#~0.5.2",
"core-elements": "Polymer/core-elements#~0.5.2",
"paper-elements": "Polymer/paper-elements#~0.5.2"
}
}
Run Code Online (Sandbox Code Playgroud)
我的页面:
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="/client/polymer-0.5.2/bower_components/polymer/polymer.html">
</head>
<body>
<!-- render data set -->
<template id="auto-bind-demo" is="auto-binding" repeat="{{quotes}}">
<div on-tap="{{quoteClicked}}">
<h3>{{quote}}</h3>
- <em>{{attribution}}</em>
</div>
</template>
<script>
var t = document.querySelector('#auto-bind-demo');
t.quoteClicked = function() {
alert('Quote clicked!');
};
t.quotes = [{
attribution: 'Plautus',
quote: 'Let deeds match words.'
}, { …Run Code Online (Sandbox Code Playgroud) 我制作了一个球出现在 3D 空间中的场景。三角球耗费大量资源。所以我使用带有球纹理的二维表面(四边形)来完成此操作。但现在我需要在每次相机移动时调整形状的方向。我使用位置变换和 LookAt 方法来完成此操作。问题是我可以优化这个吗?如果可以使用着色器旋转形状,这将有很大帮助。
using UnityEngine;
public class WorldSurf : MonoBehaviour
{
GameObject[] matrix;
int xSize = 20;
int ySize = 20;
int zSize = 20;
// Start is called before the first frame update
void Start()
{
matrix = new GameObject[xSize * ySize * zSize];
//var shader = Shader.Find("Legacy Shaders/Diffuse");
var shader = Shader.Find("Sprites/Default");
//var texture = Resources.Load<Texture>("Textures/Ball_01");
var i = 0;
for (var x = 0f; x < xSize; ++x)
{
for (var y = 0f; y …Run Code Online (Sandbox Code Playgroud)