You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
4 years ago
|
using System;
|
||
|
using UnityEngine;
|
||
|
[Serializable]
|
||
|
public class MyTransform
|
||
|
{
|
||
|
public MyPosition MyPosition;
|
||
|
public MyRotation MyRotation;
|
||
|
public MyScale MyScale;
|
||
|
public MyTransform()
|
||
|
{
|
||
|
MyPosition = new MyPosition();
|
||
|
MyRotation = new MyRotation();
|
||
|
MyScale = new MyScale();
|
||
|
}
|
||
|
public void setMyPosition(Vector3 position)
|
||
|
{
|
||
|
MyPosition.x = position.x;
|
||
|
MyPosition.y = position.y;
|
||
|
MyPosition.z = position.z;
|
||
|
}
|
||
|
public void setMyRotation(Quaternion rotation)
|
||
|
{
|
||
|
MyRotation.x = rotation.x;
|
||
|
MyRotation.y = rotation.y;
|
||
|
MyRotation.z = rotation.z;
|
||
|
MyRotation.w = rotation.w;
|
||
|
}
|
||
|
public void setMyScale(Vector3 scale)
|
||
|
{
|
||
|
MyScale.x = scale.x;
|
||
|
MyScale.y = scale.y;
|
||
|
MyScale.z = scale.z;
|
||
|
}
|
||
|
public Vector3 getMyPosition()
|
||
|
{
|
||
|
return new Vector3(MyPosition.x, MyPosition.y, MyPosition.z);
|
||
|
}
|
||
|
public Quaternion getMyRotation()
|
||
|
{
|
||
|
return new Quaternion(MyRotation.x, MyRotation.y, MyRotation.z, MyRotation.w);
|
||
|
}
|
||
|
public Vector3 getMyScale()
|
||
|
{
|
||
|
return new Vector3(MyScale.x, MyScale.y, MyScale.z);
|
||
|
}
|
||
|
}
|