//serialization constructor // protected SavedState (SerializationInfo info, StreamingContext context) // { // try { // this.position = (SerVector3)info.GetValue ("position", typeof(SerVector3)); // this.rotation = (SerQuaternion)info.GetValue ("rotation", typeof(SerQuaternion)); // } catch { // //not available if used an older version to save the replay, ignore // } // this.localPosition = (SerVector3)info.GetValue ("localPosition", typeof(SerVector3)); // this.localRotation = (SerQuaternion)info.GetValue ("localRotation", typeof(SerQuaternion)); // // emittingParticles = info.GetBoolean ("emittingParticles"); // isActive = info.GetBoolean ("isActive"); // } //as this is not derived from MonoBehaviour, we have a constructor public SavedState(GameObject go) { if (go != null) { if (go.GetComponent <ParticleEmitter> ()) { emittingParticles = go.GetComponent <ParticleEmitter> ().emit; } this.position = go.transform.position; this.rotation = go.transform.rotation; this.localPosition = go.transform.localPosition; this.localRotation = go.transform.localRotation; this.isActive = go.activeInHierarchy; } else { this.position = Vector3.zero; this.rotation = Quaternion.identity; this.localPosition = Vector3.zero; this.localRotation = Quaternion.identity; this.isActive = false; } }
public bool isDifferentTo(PBQuaternion3 i) { return(x != i.x || y != i.y || z != i.z || w != i.w); }