// Update is called once per frame void Update() { if (rotator.delta != Vector2.zero) { transform.RotateAround(centerpoint.transform.position, new Vector3(rotator.axis.x, rotator.axis.y), Mathf.Sqrt(Mathf.Pow(rotator.axis.x, 2f) + Mathf.Pow(rotator.axis.y, 2f)) * 20 * Time.deltaTime); data.AssureLinesFollow(); } }
/// <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; }