修改mesh
This commit is contained in:
23
Assets/Scripts/ThirdParty/Rope/Examples/01_DynamicAttach/BackAndForthMovement.cs
vendored
Normal file
23
Assets/Scripts/ThirdParty/Rope/Examples/01_DynamicAttach/BackAndForthMovement.cs
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Example
|
||||
{
|
||||
public class BackAndForthMovement : MonoBehaviour
|
||||
{
|
||||
public Vector3 amount = new Vector3(2.0f, 0.0f, 0.0f);
|
||||
|
||||
protected Vector3 startPos;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
startPos = transform.position;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
transform.position = startPos + amount * Mathf.Sin(Time.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user