C# Client 0.0.0.7
C# Library to interface with Corelink
Loading...
Searching...
No Matches
TransformPasser.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5namespace Corelink
6{
11 public class TransformPasser
12 {
13 public Vector3 position = new Vector3(0, 0, 0);
14 public Vector3 localPosition = new Vector3(0, 0, 0);
15 public Vector3 eulerAngles = new Vector3(0, 0, 0);
16 public Vector3 localEulerAngles = new Vector3(0, 0, 0);
17 public Vector3 localScale = new Vector3(1, 1, 1);
18 public Quaternion rotation;
19 public Quaternion localRotation;
20
24 public TransformPasser(){}
31 public TransformPasser(Transform transform)
32 {
33 this.position = transform.position;
34 this.localPosition = transform.localPosition;
35 this.eulerAngles = transform.eulerAngles;
36 this.localEulerAngles = transform.localEulerAngles;
37 this.localScale = transform.localScale;
38 this.rotation = transform.rotation;
39 this.localRotation = transform.localRotation;
40 }
41
49 public void LoadTransform(Transform destination, TransformPasser saved)
50 {
51 Debug.Log("Dest: " + destination.position + "Saved: " + saved.position);
52 destination.position = saved.position;
53 destination.localPosition = saved.localPosition;
54 destination.eulerAngles = saved.eulerAngles;
55 destination.localEulerAngles = saved.localEulerAngles;
56 destination.localScale = saved.localScale;
57 destination.rotation = saved.rotation;
58 destination.localRotation = saved.localRotation;
59 }
60 }
61}