public void Update() { // This is an item, on the floor, that has a collider. Yep. if (MouseOver) { if (AllowPickup && !Item.IsEquipped()) { // Show the user that they can pick this item up. if (InputManager.Active) { string key = InputManager.GetInput("Pick up").ToString(); string itemName = RichText.InBold(RichText.InColour(Item.Name, ItemRarityUtils.GetColour(Item.Rarity))); ActionHUD.DisplayAction("PickupPrompt".Translate(key, itemName)); } if (InputManager.InputDown("Pick up")) { // Check client-server situation... if (isServer) { // Pick up manually. Item.RequestDataUpdate(); PickupAccepted(Item.Data); Destroy(this.gameObject); } else { // Pick up using the command. Player.Local.NetUtils.CmdRequestPickup(Player.Local.gameObject, this.gameObject); } } } } }
public void OnDestroy() { if (Instance == this) { Instance = null; } }
public void Update() { Vector2 mousePos = InputManager.GetMousePos(); int mouseX = (int)mousePos.x; int mouseY = (int)mousePos.y; bool mouseInside = mouseX == Furniture.X && mouseY == Furniture.Y; if (mouseInside) { string key = InputManager.GetInput("Interact").ToString(); ActionHUD.DisplayAction("Blueprint_OpenPrompt".Translate(key)); if (InputManager.InputDown("Interact")) { Workbench.Bench.Open = true; } } }
public void Start() { Instance = this; Text = GetComponentInChildren <Text>(); }