コード例 #1
0
ファイル: DataManager.cs プロジェクト: jberg-dev/VRPROJ
 public void SaveNodeData(SocialNetworkNode in_node)
 {
     if (in_node != null)
     {
         this.nodeData = in_node;
     }
     else
     {
         Debug.LogError("in_node was null!");
     }
 }
コード例 #2
0
    /// <summary>
    /// Helper function to display a SocialNetworkNodes' information on the screen.
    /// </summary>
    /// <param name="snn">The node which data should be displayed. Accepts null, but it closes the menu</param>
    public void DisplayInformationMenu(SocialNetworkNode snn)
    {
        // Have to initialize the fields before usage.
        if (fullName == null)
        {
            InitializeInformationMenuTextFields();
        }

        // Hide the menu if you click outside a node
        if (snn == null)
        {
            InformationMenu.SetActive(false);
            return;
        }
        else
        {
            InformationMenu.SetActive(true);
        }

        // Assign the currently selected node to the keeper value;
        data.CURRENTSELECTED = snn;

        // Trigger friend line recalc to decide what lines should be displayed;
        data.TriggerFriendLineRecalc();

        // Assure that the friend lines follow with the node when we move around the GameObjects in space;
        data.AssureLinesFollow();

        // Grab the data from the node and set the displaying text fields;
        fullName.text   = "Name: " + snn.FullName;
        company.text    = "Company: " + snn.Company;
        email.text      = "Email: " + snn.Email;
        phone.text      = "Phone: " + snn.Phone;
        address.text    = "Address: " + snn.Address;
        registered.text = "Joined: " + snn.Registered;
        noFriends.text  = "Number of friends: " + snn.NumberFriends;
    }