// Update is called once per frame void Update() { if (!CheckForCameraController()) { return; } if (!IsOwner) { return; } WorldItem targetItem = HandleItemSelection(); if (targetItem != null) { targetItem.Highlight(); } if (im.GetUse() && targetItem != null) { HandleItemPickup(targetItem); } if (im.GetDropItem() && actionSlots.shared_item != null) { actionSlots.DropItem(); } }
// Update is called once per frame void Update() { if (!CheckForCameraController()) { return; } if (!isOwner) { return; } WorldItem targetItem = null; if (cam_controller.GetViewMode() == ViewMode.Shooter) { Camera cam = cam_controller.controlled_camera; targetItem = utils.RayCastExplosiveSelect <WorldItem>(origin: cam.transform.position, path: cam.transform.forward * select_reach_dist, radius: explosive_rad); } if (targetItem != null) { targetItem.Highlight(); } if (im.GetPickUp() && targetItem != null) { AddItemToInventory(targetItem); } if (im.GetDropItem() && actionSlots.shared_item != null) { actionSlots.DropItem(); } }