1
This commit is contained in:
34
Src/Unity/Scripts/Rig/TickOverrideTransform.cs
Normal file
34
Src/Unity/Scripts/Rig/TickOverrideTransform.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITFALL.Rig
|
||||
{
|
||||
public class TickOverrideTransform : MonoBehaviour
|
||||
{
|
||||
public Transform Source;
|
||||
public Transform Target;
|
||||
|
||||
private int Id;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
Id = GetInstanceID();
|
||||
TickOverrideTranformService.Register(Id,this);
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
TickOverrideTranformService.UnRegister(Id);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnValidate()
|
||||
{
|
||||
if(!Source)Source = transform;
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user