调用游戏脚本
Unity作用,脚本也是一个GameObject的基本的Component,也可以使用GetComponent<>()进行调用,<>内部输入脚本的名称即可。可以调用脚本的public
变量。
Line Render
在游戏场景绘制一条光线。添加一个Line Render组件。
获取定点函数:
public void SetPosition(int index, Vector3 position);
index可以视为定点的索引,一帧结束后,会把所有的index定点进行连接。
参照这个博客:
https://blog.csdn.net/zuoyamin/article/details/8997729