public override void Init(JediumBehaviourSnapshot snapshot) { base.Init(snapshot); if (snapshot.BehaviourType != "Take") { return; } JediumTakeSnapshot t = (JediumTakeSnapshot)snapshot; AttachPoint = new Vector3(t.X, t.Y, t.Z); AttachRotation = new Quaternion(t.RotX, t.RotY, t.RotZ, t.RotW); Debug.Log("AttachP:" + AttachPoint); Debug.Log("AttachR: " + AttachRotation); }
public override void FromSnapshot(JediumBehaviourSnapshot snap) { if (snap.GetBehaviourType() != "Take") { Log.Warn($"Wrong snapshot type: {snap.GetBehaviourType()}"); } JediumTakeSnapshot takeSnap = (JediumTakeSnapshot)snap; posX = takeSnap.X; posY = takeSnap.Y; posZ = takeSnap.Z; RotX = takeSnap.RotX; RotY = takeSnap.RotY; RotZ = takeSnap.RotZ; RotW = takeSnap.RotW; }