91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類型: .cs
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-15
  • 語言: C#
  • 標簽: Unity??

資源簡介

基于Unity引擎編寫的適合在3D場景中內畫平滑線的腳本,無需修改可直接使用,僅供學習參考。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections;
using?System.Reflection;
using?UnityEngine;

public?class?example?:?MonoBehaviour?{
public?Transform[]?Target?=?new?Transform[5];
public?Vector3[]?TargetV3?=?new?Vector3[5];
private?LineRenderer?lineRenderer;
private?int?SmoothSens?=?20;
private?int?Targetlenght?=?0;

void?Start(){
Targetlenght?=?Target.Length;
}

????void?Update()?{
Targetlenght?=?Target.Length;
for?(int?i?=?0;?i? {
TargetV3[i]?=?Target[i].position;
}
DrawPathHelper(TargetV3Color.red);
}

public?void?DrawPathHelper(Vector3[]?path?Color?color){
Targetlenght?=?Target.Length;
SmoothSens?=?20;

lineRenderer?=?GetComponent();
lineRenderer.SetVertexCount(SmoothSens*Targetlenght+1);
lineRenderer.SetWidth(0.1f?0.1f);

Vector3[]?vector3s?=?PathControlPointGenerator(path);
Vector3?prevPt?=?Interp(vector3s0);
Gizmos.color=color;
int?SmoothAmount?=?path.Length*SmoothSens;
for?(int?i?=?1;?i?<=?SmoothAmount;?i++)?{
float?pm?=?(float)?i?/?SmoothAmount;
Vector3?currPt?=?Interp(vector3spm);
lineRenderer.SetPosition(i-1?currPt);
lineRenderer.SetPosition(i?prevPt);

prevPt?=?currPt;
}
}

public?Vector3[]?PathControlPointGenerator(Vector3[]?path){
Vector3[]?suppliedPath;
Vector3[]?vector3s;

//create?and?store?path?points:
suppliedPath?=?path;

//populate?calculate?path;
int?offset?=?2;

評論

共有 條評論