public override void LoadDiffFrame(string binarySave) { byte[] byteArray = Convert.FromBase64String(binarySave); MemoryStream mf = new MemoryStream(byteArray); BinaryFormatter bf = new BinaryFormatter(); SphereDiffFrameData data = (SphereDiffFrameData)bf.Deserialize(mf); transform.position = VectorArrayConverter.arrayToVector3(data.position); transform.rotation = Quaternion.Euler(VectorArrayConverter.arrayToVector3(data.rotation)); }
public void LoadFrame(string binarySave) { byte[] byteArray = Convert.FromBase64String(binarySave); MemoryStream mf = new MemoryStream(byteArray); BinaryFormatter bf = new BinaryFormatter(); EnemyFrameData data = (EnemyFrameData)bf.Deserialize(mf); id = new Guid(data.id); hasBeenKilled = data.hasBeenKilled; transform.position = VectorArrayConverter.arrayToVector3(data.position); transform.rotation = Quaternion.Euler(VectorArrayConverter.arrayToVector3(data.rotation)); }
public override void LoadFrame(string binarySave) { byte[] byteArray = Convert.FromBase64String(binarySave); MemoryStream mf = new MemoryStream(byteArray); BinaryFormatter bf = new BinaryFormatter(); BulletBaseFrameSave data = (BulletBaseFrameSave)bf.Deserialize(mf); id = new Guid(data.id); transform.position = VectorArrayConverter.arrayToVector3(data.position); transform.rotation = Quaternion.Euler(VectorArrayConverter.arrayToVector3(data.rotation)); direction = VectorArrayConverter.arrayToVector3(data.direction); speed = data.speed; }
public override void LoadDiffFrame(string binarySave) { byte[] byteArray = Convert.FromBase64String(binarySave); MemoryStream mf = new MemoryStream(byteArray); BinaryFormatter bf = new BinaryFormatter(); PlayerDiffFrameData data = (PlayerDiffFrameData)bf.Deserialize(mf); transform.position = VectorArrayConverter.arrayToVector3(data.position); transform.rotation = Quaternion.Euler(VectorArrayConverter.arrayToVector3(data.rotation)); if (data.killerGUID != null) { killerGUID = new Guid(data.killerGUID); if (GameObjectStateManager.Instance.doesParentExist(killerGUID)) { Destroy(killerGUID); } } }