require

Unity报错:This MeshCollider requires the mesh to be marked.....

拈花ヽ惹草 提交于 2020-01-02 13:40:07
运行或者打包时候报错:This MeshCollider requires the mesh to be marked as readable in order to be usable with the given transform. 解决方法:开启mesh的读写 可以写一个批量处理的脚本: using UnityEngine; using UnityEditor; using System.IO; public class FixModel { [MenuItem("Tools/FixModel")] static void Fix() { var fs = Directory.GetFiles(Application.dataPath, "*.FBX", SearchOption.AllDirectories); foreach(var f in fs) { var path = f.Replace(Application.dataPath, "Assets"); var imp = AssetImporter.GetAtPath(path) as ModelImporter; if(null == imp) { Debug.LogError(Path.GetFileName(f) + " is not a Model"); } else { if(!imp

跨域详解

半腔热情 提交于 2020-01-02 05:49:24
什么是跨域? 跨域是指一个域下的文档或脚本试图去请求另一个域下的资源,这里跨域是广义的。 广义的跨域: 1.) 资源跳转: A链接、重定向、表单提交 2.) 资源嵌入: <link>、<script>、<img>、<frame>等dom标签,还有样式中background:url()、@font-face()等文件外链 3.) 脚本请求: js发起的ajax请求、dom和js对象的跨域操作等 其实我们通常所说的跨域是狭义的,是由浏览器同源策略限制的一类请求场景。 什么是同源策略? 同源策略/SOP(Same origin policy)是一种约定,由Netscape公司1995年引入浏览器,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,浏览器很容易受到XSS、CSFR等攻击。所谓同源是指"协议+域名+端口"三者相同,即便两个不同的域名指向同一个ip地址,也非同源。 同源策略限制以下几种行为: 1.) Cookie、LocalStorage 和 IndexDB 无法读取 2.) DOM 和 Js对象无法获得 3.) AJAX 请求不能发送 常见跨域场景 URL 说明 是否允许通信 http://www.domain.com/a.js http://www.domain.com/b.js 同一域名,不同文件或路径 允许 http://www.domain.com/lab/c

前端解决跨域的九种方法

允我心安 提交于 2020-01-02 05:44:35
什么是跨域? 跨域是指一个域下的文档或脚本试图去请求另一个域下的资源,这里跨域是广义的。 广义的跨域: 1、 资源跳转:A链接、重定向、表单提交 2、 资源嵌入: < link>、 < script> 、 < img>、 < frame>等dom标签,还有样式中background:url()、@font-face()等文件外链 3、 脚本请求: js发起的ajax请求、dom和js对象的跨域操作等 其实我们通常所说的跨域是狭义的,是由浏览器同源策略限制的一类请求场景。 什么是同源策略? 同源策略/SOP(Same origin policy)是一种约定,由Netscape公司1995年引入浏览器,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,浏览器很容易受到XSS、CSFR等攻击。所谓同源是指"协议+域名+端口"三者相同,即便两个不同的域名指向同一个ip地址,也非同源。 同源策略限制以下几种行为: 1、Cookie、LocalStorage 和 IndexDB 无法读取 2、 DOM 和 Js对象无法获得 3、 AJAX 请求不能发送 常见跨域场景 URL 说明 是否允许通信 http://www.demo.com/a.js http://www.demo.com/b.js 同一域名,不同文件或路径 允许 http://www.demo.com/lab/c.js

js跨域请求解决方案

*爱你&永不变心* 提交于 2020-01-02 05:42:03
什么是跨域? 跨域是指一个域下的文档或脚本试图去请求另一个域下的资源,这里跨域是广义的。 广义的跨域: 1.) 资源跳转: A链接、重定向、表单提交 2.) 资源嵌入: <link>、<script>、<img>、<frame>等dom标签,还有样式中background:url()、@font-face()等文件外链 3.) 脚本请求: js发起的ajax请求、dom和js对象的跨域操作等 其实我们通常所说的跨域是狭义的,是由浏览器同源策略限制的一类请求场景。 什么是同源策略? 同源策略/SOP(Same origin policy)是一种约定,由Netscape公司1995年引入浏览器,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,浏览器很容易受到XSS、CSFR等攻击。所谓同源是指"协议+域名+端口"三者相同,即便两个不同的域名指向同一个ip地址,也非同源。 同源策略限制以下几种行为: 1.) Cookie、LocalStorage 和 IndexDB 无法读取 2.) DOM 和 Js对象无法获得 3.) AJAX 请求不能发送 常见跨域场景 URL 说明 是否允许通信 http://www.domain.com/a.js http://www.domain.com/b.js 同一域名,不同文件或路径 允许 http://www.domain.com/lab/c

nodejs之get/post请求的几种方式

£可爱£侵袭症+ 提交于 2020-01-02 01:38:58
最近一段时间在学习前端向服务器发送数据和请求数据,下面总结了一下向服务器发送请求用get和post的几种不同请求方式: 1.用form表单的方法: (1)get方法 前端代码: <form action = "/login" method = "GET"> <label for = "username">账号:</label> <input type = "text" name ="username" placeholder = "请输入账号" required> <br> <label for = "password">密码:</label> <input type = "password" name = "password" placeholder = "请输入密码" required> <br> <input type = "submit" value = "登陆"> </form> 服务器代码: 用get方法首先要配置json文件,在command中输入命令npm-init ,然后要安装所需要的express模块,还需要在文件夹里面创建一个放置静态资源的文件夹(wwwroot),然后代码如下: var express = require('express'); // 引入模块 var web = express(); // 使用模块创建一个web应用 web.use

In Node.js, how can I load my modules once and then use them throughout the app?

孤街醉人 提交于 2020-01-01 12:33:30
问题 I want to create one global module file, and then have all my files require that global module file. Inside that file, I would load all the modules once and export a dictionary of loaded modules. How can I do that? I actually tried creating this file...and every time I require('global_modules') , all the modules kept reloading. It's O(n). I want the file to be something like this (but it doesn't work): //global_modules.js - only load these one time var modules = { account_controller: '

How does Ruby know where to find a required file?

▼魔方 西西 提交于 2020-01-01 11:33:28
问题 Here is one more newbie question: require 'tasks/rails' I saw this line in Rakefile in the root path of every rails project. I guess this line is used to require vendor/rails/railties/lib/tasks/rails.rb to get all rake tasks loaded: $VERBOSE = nil # Load Rails rakefile extensions Dir["#{File.dirname(__FILE__)}/*.rake"].each { |ext| load ext } # Load any custom rakefile extensions Dir["#{RAILS_ROOT}/lib/tasks/**/*.rake"].sort.each { |ext| load ext } Dir["#{RAILS_ROOT}/vendor/plugins/*/**/tasks

I am struggling with the requirejs optimizer and non AMD modules

半腔热情 提交于 2020-01-01 04:19:06
问题 I am struggling with the requirejs optimizer. This code will work if I just load it in the browser without optimization. If I run the optimizer I get : ENOENT, no such file or directory 'C:\Users\dev\checkout\src\main\webapp\resources\scripts\ json2.js' In module tree: main This is the code requirejs.config({ paths : { jquery : "lib/jquery", bootstrap : "lib/bootstrap", modals : "lib/modals", tablesort : "lib/tablesort", json2 : "lib/json2" }, shim : { "bootstrap" : [ "jquery" ], "modals" : [

Node.JS load module async

人走茶凉 提交于 2020-01-01 02:25:19
问题 I would like to have the ability to load a module that has been changed. I would have to of course unload the module first. Since this is a webserver setup, I am asking if there is a way to load the module in an async fashion, to avoid freezing the webserver for the duration of the read of the updated file. Awhile back Node.JS removed the require.async function. So, on the latest version of Node.JS, what would be the recommended alternative? Should I read the entire file first, and then use

Node.JS load module async

主宰稳场 提交于 2020-01-01 02:25:11
问题 I would like to have the ability to load a module that has been changed. I would have to of course unload the module first. Since this is a webserver setup, I am asking if there is a way to load the module in an async fashion, to avoid freezing the webserver for the duration of the read of the updated file. Awhile back Node.JS removed the require.async function. So, on the latest version of Node.JS, what would be the recommended alternative? Should I read the entire file first, and then use