mirror of
https://github.com/ApfelTeeSaft/Slender.git
synced 2026-08-27 11:53:34 +00:00
31 lines
464 B
C#
31 lines
464 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class FollowTransform : MonoBehaviour
|
|
{
|
|
public Transform targetTransform;
|
|
|
|
public bool faceForward;
|
|
|
|
private Transform thisTransform;
|
|
|
|
public virtual void Start()
|
|
{
|
|
thisTransform = transform;
|
|
}
|
|
|
|
public virtual void Update()
|
|
{
|
|
thisTransform.position = targetTransform.position;
|
|
if (faceForward)
|
|
{
|
|
thisTransform.forward = targetTransform.forward;
|
|
}
|
|
}
|
|
|
|
public virtual void Main()
|
|
{
|
|
}
|
|
}
|