public void Setup(Destination d, TourBuilderScriptable tb)
 {
     instance     = tb;
     dest         = d;
     ansText.text = dest.label;
     target       = tb.nodes[d.dest];
 }
Example #2
0
        /// <summary>
        /// Takes a deserialized node and sets it up in the scene
        /// </summary>
        /// <param name="toBuild">The Deserialized node structure to setup</param>
        /// <returns>the fully setup and built node object</returns>
        public NodeBehaviour BuildNode(Node toBuild)
        {
            GameObject    nodeObj  = Instantiate(nodePrefab, tourObj.transform);
            NodeBehaviour toReturn = nodeObj.GetComponent <NodeBehaviour>();

            //Constructs the node based on the deserialized node in toBuild and adds it to nodes
            toReturn.Setup(toBuild, this);
            return(toReturn);
        }
 public void TeleportToNode(NodeBehaviour n)
 {
     player.transform.SetPositionAndRotation(n.transform.position, n.transform.rotation);
 }