程序

导航报错SetDestination() can only be called on an active agent that has been placed on a NavMesh

原因:初始化导航组件NavMeshAgent 的时候,agent 离navmesh太远。isOnNavMesh属性为false;

解决办法: 在初始化预制体的时候,传入诞生点位置和旋转信息。

GameObject.Instantiate(m_shooter, m_currBirthPoint.transform.position,m_currBirthPoint.transform.rotation) as GameObject;

而不是直接初始化,后设置诞生点位置。

GameObject.Instantiate(m_shooter);
shooter.transform.position = m_currBirthPoint.transform.position;

另外:在重新使用SetActive(true);的时候,也要确保agent 离navmesh足够近。 建议在设置SetActive(false);的时候,就不要改变位置信息,以免重新激活时离导航网格太远。

CentOS 7 编译安装NodeJS

最新版本的Nodejs无法找到centos包管理器的安装方式,介于此我们采用编译NodeJS二进制源码包的方式安装NodeJS

  1. 下载源文件 https://nodejs.org/zh-cn/download/
  2. 解压压缩包 tar -zxvf node-v10.15.0.tar.gz
  3. 安装必要的编译软件 yum install gcc gcc-c++
  4. 进入到node源码包解压目录 [root@localhost ~]# cd node-v10.15.0
  5. 执行configure文件编译node源码 [root@localhost node-v10.15.0]# ./configure --prefix=/usr/local/node --prefix=/usr/local/node 指定NodeJS安装位置
  6. make && make install
  7. 环境变量设置vi /etc/profile.d/node.sh export PATH=$PATH:/usr/local/node/bin
  8. 立刻配置生效 source /etc/profile.d/node.sh

编译过程比较漫长也可以直接下载编译好的二进制包,压缩包扩展名为.tar.xz,使用tar -xvf xxxx进行解压。设好环境变量,即可。

关于mysql最大连接数

如果设置my.cnf文件不起作用,就用sql语句来修改吧

#查询最大连接数
show variables like '%max_connections%';
#设置最大连接数
set GLOBAL max_connections=800;
#查询当前连接进程
show full processlist;