【m】插件上传
This commit is contained in:
21
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Multiplay/FollowTransform.cs
vendored
Normal file
21
Packages/com.unity.renderstreaming@3.1.0-exp.9/Samples~/Example/Multiplay/FollowTransform.cs
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.RenderStreaming.Samples
|
||||
{
|
||||
class FollowTransform : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Transform target;
|
||||
[SerializeField] Vector3 offset;
|
||||
|
||||
[SerializeField] bool followPosition;
|
||||
[SerializeField] bool followRotation;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (followPosition)
|
||||
transform.localPosition = target.localPosition + offset;
|
||||
if (followRotation)
|
||||
transform.localRotation = target.localRotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user