public GameObjectSerializable(PersistedGameObject _go) { Position = new Vector3Serializable(_go.Position); Rotation = new QuaternionSerializable(_go.Rotation); Scale = new Vector3Serializable(_go.Scale); Enabled = _go.Enabled; }
public ShapeData ToShapeData() { return(new ShapeData( Vector3Serializable.FromVector(transform.localScale), ColorRGB.FromColor(material.color), Vector3Serializable.FromVector(transform.position), Vector3Serializable.FromVector(rb.velocity), Vector3Serializable.FromVector(rb.angularVelocity), Vector3Serializable.FromVector(transform.rotation.eulerAngles))); }
public static void AddVector3(this SerializationInfo info, string name, Vector3Serializable v) { if (info is null) { throw new ArgumentNullException(nameof(info)); } info.AddValue(name, v); }
public override bool Equals(object obj) { if (obj is Vector3Serializable || obj is Vector3) { Vector3Serializable vector = ( Vector3Serializable )obj; return(this.x == vector.x && this.y == vector.y && this.z == vector.z); } return(false); }
static public Vector3Serializable CreateVector3Serializable(Vector3 v) { Vector3Serializable save = new Vector3Serializable { x = v.x, y = v.y, z = v.z }; return(save); }
public ShapeData(Vector3Serializable scale, ColorRGB color, Vector3Serializable position, Vector3Serializable velocity, Vector3Serializable angularVelocity, Vector3Serializable rotation) { Scale = scale; Color = color; Position = position; Velocity = velocity; AngularVelocity = angularVelocity; Rotation = rotation; }
public static MagicCubeSaveData CreateSaveData(MagicCubeManager manager) { MagicCubeSaveData savedata = new MagicCubeSaveData(); //deep copies to be safe. foreach (var cubeTile in manager.GetCubeTileListReference()) { savedata.positions.Add(Vector3Serializable.CreateVector3Serializable(cubeTile.transform.position)); savedata.rotations.Add(QuaternionSerializable.CreateQuaternionSerializable(cubeTile.transform.rotation)); savedata.cubeTileIDs.Add(cubeTile.GetComponent <CubeTileInfo>().GetID()); } foreach (var action in manager.GetUndoListReference()) { savedata.undoActions.Add(ActionSaveData.CreateSaveData(action)); } savedata.magicCubeSize = manager.GetMagicCubeSize(); savedata.time = manager.GetTimePassed(); return(savedata); }
public CameraXZData(Camera camera) { Location = camera.transform.position; Zoom = camera.orthographicSize; }
// We will have a SceneItem Instance for every item in our scene, which will allow us to save a serializable itemCode, position, and itemName public SceneItem() { position = new Vector3Serializable(); }
public void SetAngularVelocity(Vector3 veloToSet) { this.angularVelo = new Vector3Serializable(veloToSet.x, veloToSet.y, veloToSet.z); }
public void SetColor(Color colorToSet) { this.color = new Vector3Serializable(colorToSet.r, colorToSet.g, colorToSet.b); }
public RigidBodySerializable(Rigidbody r) { velocity = new Vector3Serializable(r.velocity); angularVelocity = new Vector3Serializable(r.angularVelocity); }
public static Vector2 ToVector2xz(this Vector3Serializable vs) { return(new Vector2(vs.x, vs.z)); }
public SceneItem() { location = new Vector3Serializable(); }
public BezierSplinePointSerializable(BezierSplinePoint other) { this.position = other.position; this.rotation = other.rotation; this.controlPoint = other.controlPoint; }
public void SetPosition(Vector3 posToSet) { this.pos = new Vector3Serializable(posToSet.x, posToSet.y, posToSet.z); }
public void SetRotation(Vector3 rotToSet) { this.rot = new Vector3Serializable(rotToSet.x, rotToSet.y, rotToSet.z); }
public TransformSerializable(Transform t) { position = new Vector3Serializable(t.localPosition); rotation = new QuaternionSerializable(t.localRotation); scale = new Vector3Serializable(t.localScale); }
public PrefabSaveData(PrefabObject prefabObject) { PrefabPath = AssetDatabase.GetAssetPath(prefabObject.GetSourcePrefab()); Position = Vector3Serializable.ToVector3Serializable(prefabObject.GetLocation()); }