using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace XFramework
{
///
/// 可序列化的Vector3
///
[Serializable]
public struct VectorThree
{
public float x;
public float y;
public float z;
public VectorThree(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
public VectorThree(Vector3 vector3)
{
x = vector3.x;
y = vector3.y;
z = vector3.z;
}
public Vector3 GetVector3()
{
return new Vector3(x, y, z);
}
}
///
/// 可序列化的Vector2
///
[Serializable]
public struct VectorTwo
{
public float x;
public float y;
public VectorTwo(float x, float y)
{
this.x = x;
this.y = y;
}
public VectorTwo(Vector2 vector2)
{
x = vector2.x;
y = vector2.y;
}
public Vector2 GetVector2()
{
return new Vector2(x, y);
}
}
///
/// 物体姿态同步数据 位置+角度
///
[Serializable]
public struct TransGesture
{
public VectorThree pos;
public VectorThree rotAngle;
public TransGesture(Vector3 pos, Vector3 eulerAngle)
{
this.pos = new VectorThree( pos);
this.rotAngle = new VectorThree( eulerAngle);
}
public Vector3 GetPos()
{
return new Vector3(pos.x, pos.y, pos.z);
}
public Vector3 GetRotAnlgle()
{
return new Vector3(rotAngle.x, rotAngle.y, rotAngle.z);
}
}
}