NetworkTransformBase: virtual SetPosition/Rotation/Scale for users to overwrite if needed

This commit is contained in:
mischa 2023-09-01 15:59:05 +02:00
parent 02db1b03d5
commit ae496ef0ee

View File

@ -146,7 +146,7 @@ protected virtual Vector3 GetScale() =>
coordinateSpace == CoordinateSpace.Local ? target.localScale : target.lossyScale;
// set local/world position
protected void SetPosition(Vector3 position)
protected virtual void SetPosition(Vector3 position)
{
if (coordinateSpace == CoordinateSpace.Local)
target.localPosition = position;
@ -155,7 +155,7 @@ protected void SetPosition(Vector3 position)
}
// set local/world rotation
protected void SetRotation(Quaternion rotation)
protected virtual void SetRotation(Quaternion rotation)
{
if (coordinateSpace == CoordinateSpace.Local)
target.localRotation = rotation;
@ -164,7 +164,7 @@ protected void SetRotation(Quaternion rotation)
}
// set local/world position
protected void SetScale(Vector3 scale)
protected virtual void SetScale(Vector3 scale)
{
if (coordinateSpace == CoordinateSpace.Local)
target.localScale = scale;