Example #1
0
    public Vector3 GetNode()
    {
        PseudoVector3 node = (PseudoVector3)nodes.First.Value;

        nodes.RemoveFirst();
        return(new Vector3(node.x, node.y, node.z));
    }
 /// <summary>
 /// Constructor. This is private because we don't want to be able to construct a PseudoGameObject.
 /// We only want to be able to typecast it from an already made GameObject.
 /// </summary>
 /// <param name="go">Go.</param>
 public PseudoGameObject(T go)
 {
     this.position    = go.transform.position;
     this.information = new List <FieldInformation>();
     foreach (FieldInfo field in go.GetType().GetFields())
     {
         if (((field.FieldType.IsSerializable && field.FieldType.GetElementType() == null) || (field.FieldType.GetElementType() != null && field.FieldType.GetElementType().IsSerializable)))
         {
             this.information.Add(new FieldInformation(field.DeclaringType.ToString(), field.Name, field.GetValue(go)));
         }
     }
     MonoBehaviour.Destroy(go.gameObject);
 }
Example #3
0
    public void AddNode(Vector3 nP)
    {
        PseudoVector3 nodePosition = new PseudoVector3(nP.x, nP.y, nP.z);

        nodes.AddFirst(nodePosition);
    }