public GameObject player;
private TrailRenderer tr;
private Vector3 v;
void Start () {
tr = player.GetComponent<TrailRenderer>();
}
void Update () {
v = tr.GetPosition(0);
}
每当我尝试对Trail Renderer使用GetPosition()方法时,我都会收到错误:“'TrailRenderer'不包含'GetPosition'的定义,也没有扩展方法'GetPosition'接受类型'的第一个参数可以找到TrailRenderer'。
任何人都知道发生了什么事?
答案 0 :(得分:3)
Unity 5.6 中添加了nubSeq' :: forall a. Ord a => Seq a -> Seq a
nubSeq' xs = Fold.foldr cons nil xs Set.empty where
cons :: a -> (Set a -> Seq a) -> (Set a -> Seq a)
cons x xs seen
| x `elem` seen = xs seen
| otherwise = x <| xs (Set.insert x seen)
nil :: Set a -> Seq a
nil _ = Seq.empty
功能,但您使用的是 Unity 5.5 。这就是你不能使用它的原因。您需要更新Unity版本才能使用此功能。