您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
20 行
752 B
20 行
752 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
//Simple scripts that "negates" the rotation of target object - used for Morgan as in order to fix the VFX Graph SDF issues that occur
|
|
//when Body_Null is offseted and the prefab is rotated.
|
|
//A proper fix inside the VFX Graph is desirable but after trying for a bit I couldn't find any.
|
|
|
|
|
|
[ExecuteInEditMode]
|
|
public class NegateRotation : MonoBehaviour
|
|
{
|
|
public Transform rotationReference;
|
|
|
|
void Update()
|
|
{
|
|
if (rotationReference) transform.localEulerAngles = new Vector3(transform.eulerAngles.x, -rotationReference.localRotation.eulerAngles.y, transform.eulerAngles.z);
|
|
//else Debug.LogWarning("Rotation Reference Not Assigned!");
|
|
}
|
|
}
|