35 lines
588 B
C#
35 lines
588 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace BITKit.UX.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
|
|
}
|
|
|
|
}
|