示例#1
0
    public override void setLoadData(object obj)
    {
        PhysicsObjectData data = (PhysicsObjectData)obj;

        gameObject.transform.localPosition = new Vector3(data.x, data.y, data.z);
        gameObject.transform.localRotation = new Quaternion(data.rx, data.ry, data.rz, data.rw);
        gameObject.SetActive(data.enabled);
        Debug.Log("load:" + gameObject.transform.localPosition.ToString() + " " + gameObject.transform.localRotation.ToString());
    }
示例#2
0
 void Awake()
 {
     safeLocation = new PhysicsObjectData {
         x       = gameObject.transform.localPosition.x,
         y       = gameObject.transform.localPosition.y,
         z       = gameObject.transform.localPosition.z,
         rx      = gameObject.transform.localRotation.x,
         ry      = gameObject.transform.localRotation.y,
         rz      = gameObject.transform.localRotation.z,
         rw      = gameObject.transform.localRotation.w,
         enabled = gameObject.activeSelf
     };
 }