Skip to content

Instantly share code, notes, and snippets.

@SnugglePilot
Created January 13, 2020 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SnugglePilot/6830bf10109c65772651dea132aa7136 to your computer and use it in GitHub Desktop.
Save SnugglePilot/6830bf10109c65772651dea132aa7136 to your computer and use it in GitHub Desktop.
using UnityEngine;
namespace absurdjoy
{
public abstract class TransformManipulator_Abstract : MonoBehaviour
{
public bool useLocalSpace;
private Transform target;
public virtual void SetTarget(Transform target)
{
this.target = target;
}
public virtual void Input(Transform newState)
{
Input(TransformValues.FromTransform(newState, false));
}
public abstract void Input(TransformValues newState);
protected virtual void Output(TransformValues newState)
{
if (target == null)
{
return;
}
newState.ApplyTo(target, useLocalSpace);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment