// Update is called once per frame void OnEnable() { currNav = GameController.instance.player.GetComponent <Player_Control>().equipment[(int)bodyPart.Hand]; Nav = ((Equipable_Nav)ItemController.instance.items[currNav.itemFileName]); if (Nav.isOnline) { GameController.instance.Map_RenderFull(); Offline.SetActive(false); } else { GameController.instance.Map_RenderHalf(); Offline.SetActive(true); } if (Nav.SpendBattery) { Battery.SetActive(true); } else { Battery.SetActive(false); } if (currNav.valFloat < 0 && Nav.SpendBattery) { Display.SetActive(false); } else { Display.SetActive(true); } }
public void SetData(FriendData data) { foreach (UnityEngine.UI.Button b in unfriend) { b.onClick.RemoveAllListeners(); b.onClick.AddListener(() => { FriendManager.callRemoveFriend(data); SmallWindow.singleton.close(gameObject); }); } Tname.text = data.Name; level.text = "Level " + data.Level.ToString(); statistics.text = data.Staticsics; status.text = data.status.ToString(); if (data.icon != new Sprite()) { Icon.sprite = data.icon; } else { Icon.sprite = defaultIcon; } switch (data.status) { case friendStatus.Online: Offline.SetActive(false); Online.SetActive(true); break; case friendStatus.Offline: Offline.SetActive(true); Online.SetActive(false); break; case friendStatus.Playing: Offline.SetActive(false); Online.SetActive(true); break; } }