Created
January 13, 2020 21:22
-
-
Save SnugglePilot/6830bf10109c65772651dea132aa7136 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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