You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
509 B
C#
25 lines
509 B
C#
2 months ago
|
using System;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace D2D
|
||
|
{
|
||
|
public class RotationIgnorer : MonoBehaviour
|
||
|
{
|
||
|
private Transform _target;
|
||
|
|
||
|
private Vector3 _originalSwift;
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
_originalSwift = transform.localPosition;
|
||
|
|
||
|
_target = transform.parent;
|
||
|
transform.parent = null;
|
||
|
}
|
||
|
|
||
|
private void Update()
|
||
|
{
|
||
|
transform.position = _originalSwift + _target.position;
|
||
|
}
|
||
|
}
|
||
|
}
|